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
|
||||
After=network.target prosody.service
|
||||
|
||||
# No more than 5 crashes in 12 hours
|
||||
StartLimitIntervalSec=43200
|
||||
StartLimitBurst=5
|
||||
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
# Another Type option: forking
|
||||
User=rhinoreminds
|
||||
WorkingDirectory=/srv/rhinoreminds
|
||||
ExecStart=/srv/rhinoreminds/start_service.sh
|
||||
Type=forking
|
||||
PIDFile=/run/rhinoreminds.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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[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
|
||||
|
||||
source .xmpp_credentials
|
||||
cd data;
|
||||
source .xmpp_credentials;
|
||||
|
||||
export XMPP_JID;
|
||||
export XMPP_PASSWORD;
|
||||
# Execute & disown
|
||||
# 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