Updated install scripts to use systemd if running

This commit is contained in:
Rick Falkvinge
2016-11-04 17:54:21 +01:00
parent 48bf7ae91f
commit e592f5750b
2 changed files with 22 additions and 6 deletions
@@ -5,8 +5,16 @@
mkdir -p /var/lib/swarmops/upload
#todo: check for database upgrade
#start the daemon
/etc/init.d/swarmops-backend start
#if we're running systemd, use systemd;
#otherwise, use upstart
if [ -z $(pidof systemd) ]; then
#start the daemon
/etc/init.d/swarmops-backend start
#register the daemon
update-rc.d swarmops-backend defaults 90 10 > /dev/null
else
systemctl enable swarmops-backend
systemctl start swarmops-backend
fi
#register the daemon
update-rc.d swarmops-backend defaults 90 10 > /dev/null
@@ -1,5 +1,13 @@
#! /bin/bash
update-rc.d -f swarmops-backend remove > /dev/null
/etc/init.d/swarmops-backend stop
# Different paths for systemd and upstart
if [ -z $(pidof systemd) ]; then
update-rc.d -f swarmops-backend remove > /dev/null
/etc/init.d/swarmops-backend stop
else
systemctl stop swarmops-backend
systemctl disable swarmops-backend
fi