From 9fd58e4130ef1aa34d5cdbb82016ae135cdd1d4b Mon Sep 17 00:00:00 2001 From: Trowbridge Date: Tue, 30 Apr 2019 17:49:02 -0400 Subject: [PATCH] add systemd service --- ubuntu/system_service.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ubuntu/system_service.md diff --git a/ubuntu/system_service.md b/ubuntu/system_service.md new file mode 100644 index 0000000..9ce0bac --- /dev/null +++ b/ubuntu/system_service.md @@ -0,0 +1,21 @@ +`//etc/systemd/system/filename.service` + +``` +[Unit] +Description=forecast_api +After=network.target + +[Service] +ExecStart=/usr/bin/node //opt/forecast_api/index.js +Restart=always +User=fc_api +Environemnt=NODE_ENV=production +WorkingDirectory=//opt/forecast_api + +[Install] +WantedBy=multi-user.target +``` + +`systemctl enable forecast.api` + +`systemctl start forecast_api.service` \ No newline at end of file