Update gasprice.service (#2)

- added start with an unprivileged user. commented by default
- added env variables for utf8 support 
- added graceful shutdown
This commit is contained in:
Igor Barinov 2017-12-29 14:41:42 -05:00 committed by banteg
parent 1764742b0f
commit 41d81ad25d
1 changed files with 16 additions and 0 deletions

View File

@ -3,8 +3,24 @@ Description=gasprice
After=network.target
[Service]
; Solves Python3.6 errors on clean Ubuntu 16.04 LTS
Environment=LC_ALL=C.UTF-8
Environment=LANG=C.UTF-8
ExecStart=/usr/local/bin/gasprice
Restart=on-failure
; Run under unprivileged mode instead of root
; Uncomment to apply
; User=www-data
; Group=www-data
; Use graceful shutdown with a reasonable timeout
KillMode=mixed
KillSignal=SIGQUIT
TimeoutStopSec=5s
[Install]
WantedBy=multi-user.target