Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Unit]
- Description=My App daemon
- After=network.target postgresql.service
- Wants=postgresql.service
- [Service]
- EnvironmentFile=/etc/sysconfig/my-app
- WorkingDirectory=/opt/my-app/ # <- this is where your app lives
- User=root
- Group=root
- Type=simple
- ExecStart=/usr/bin/python server.py # <- this starts your app
- Restart=always
- RestartSec=5s
- [Install]
- WantedBy=multi-user.target
- DB_HOST=localhost
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_NAME=postgres
- service my-app start
- service my-app stop
- service my-app restart
- journalctl -u my-app -e
Add Comment
Please, Sign In to add comment