Update service files etc.
This commit is contained in:
parent
7cbf1ef79c
commit
1314b3ab75
2 changed files with 56 additions and 9 deletions
|
@ -2,15 +2,58 @@
|
||||||
Description=RhinoReminds XMPP Bot
|
Description=RhinoReminds XMPP Bot
|
||||||
After=network.target prosody.service
|
After=network.target prosody.service
|
||||||
|
|
||||||
|
# No more than 5 crashes in 12 hours
|
||||||
|
StartLimitIntervalSec=43200
|
||||||
|
StartLimitBurst=5
|
||||||
|
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=forking
|
||||||
# Another Type option: forking
|
PIDFile=/run/rhinoreminds.pid
|
||||||
User=rhinoreminds
|
# We change our own user
|
||||||
WorkingDirectory=/srv/rhinoreminds
|
User=root
|
||||||
ExecStart=/srv/rhinoreminds/start_service.sh
|
WorkingDirectory=/srv/kraggwapple
|
||||||
|
ExecStart=/srv/kraggwapple/start_service.sh
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
# Other Restart options: or always, on-abort, etc
|
# Other Restart options: or always, on-abort, etc
|
||||||
|
# Delay restarts by 60 seconds
|
||||||
|
RestartSec=60
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[Unit]
|
||||||
|
Description=Kraggwapple XMPP Bot
|
||||||
|
After=network.target prosody.service
|
||||||
|
|
||||||
|
# No more than 5 crashes in 12 hours
|
||||||
|
StartLimitIntervalSec=43200
|
||||||
|
StartLimitBurst=5
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=forking
|
||||||
|
PIDFile=/run/kraggwapple.pid
|
||||||
|
# We change our own user
|
||||||
|
User=root
|
||||||
|
WorkingDirectory=/srv/kraggwapple
|
||||||
|
ExecStart=/srv/kraggwapple/start_service.sh
|
||||||
|
Restart=on-failure
|
||||||
|
# Other Restart options: or always, on-abort, etc
|
||||||
|
# Delay restarts by 60 seconds
|
||||||
|
RestartSec=60
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
source .xmpp_credentials
|
cd data;
|
||||||
|
source .xmpp_credentials;
|
||||||
|
|
||||||
export XMPP_JID;
|
# Execute & disown
|
||||||
export XMPP_PASSWORD;
|
# We pass the environment variables explicitly here, as then we don't accidentally pass something private.
|
||||||
|
# Better to be safe than sorry - defence in depth!
|
||||||
|
sudo -u username_here XMPP_JID="${XMPP_JID}" XMPP_PASSWORD="${XMPP_PASSWORD}" /usr/bin/mono RhinoReminds.exe --domain starbeamrainbowlabs.com
|
||||||
|
echo "$!" >/run/rhinoreminds.pid;
|
||||||
|
disown;
|
||||||
|
|
||||||
exec /usr/bin/mono RhinoReminds.exe --domain starbeamrainbowlabs.com
|
|
||||||
|
|
Loading…
Reference in a new issue