Browse Source

Update service files etc.

master
Starbeamrainbowlabs 4 years ago
parent
commit
1314b3ab75
Signed by: sbrl
GPG Key ID: 1BE5172E637709C2
  1. 53
      rhinoreminds.service
  2. 12
      start_service.sh

53
rhinoreminds.service

@ -2,15 +2,58 @@ @@ -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=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=simple
# Another Type option: forking
User=rhinoreminds
WorkingDirectory=/srv/rhinoreminds
ExecStart=/srv/rhinoreminds/start_service.sh
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

12
start_service.sh

@ -1,8 +1,12 @@ @@ -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…
Cancel
Save