add systemd service
This commit is contained in:
parent
3a47bffe0f
commit
9fd58e4130
21
ubuntu/system_service.md
Normal file
21
ubuntu/system_service.md
Normal file
@ -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`
|
Loading…
Reference in New Issue
Block a user