Copy Debian init script to /usr/libexec/arkmanager

This commit is contained in:
Ben Peddell 2015-06-25 20:29:00 +10:00
parent ebb1ccb2c8
commit f196df51c6
2 changed files with 7 additions and 4 deletions

View File

@ -11,11 +11,14 @@ if [ ! -z "$1" ]; then
if [ -f /lib/lsb/init-functions ]; then
# on debian 8, sysvinit and systemd are present. If systemd is available we use it instead of sysvinit
if [[ -f /etc/systemd/system.conf ]]; then # used by systemd
mkdir -p "/usr/libexec/arkmanager"
cp lsb/arkdaemon "/usr/libexec/arkmanager/arkmanager.init"
chmod +x "/usr/libexec/arkmanager/arkmanager.init"
cp systemd/arkdeamon.service /etc/systemd/system/arkdaemon.service
systemctl daemon-reload
systemctl enable arkdeamon.service
systemctl enable arkdaemon.service
echo "Ark server will now start on boot, if you want to remove this feature run the following line"
echo "systemctl disable unit"
echo "systemctl disable arkmanager.service"
else # systemd not present, so use sysvinit
cp lsb/arkdaemon "${INSTALL_ROOT}/etc/init.d/arkmanager"
chmod +x "${INSTALL_ROOT}/etc/init.d/arkmanager"

View File

@ -3,8 +3,8 @@ Description=Daemon to start ark server
After=network.target
[Service]
ExecStart=/etc/init.d/arkdaemon start
ExecStop=/etc/init.d/arkdaemon stop
ExecStart=/usr/libexec/arkmanager/arkmanager.init start
ExecStop=/usr/libexec/arkmanager/arkmanager.init stop
Type=forking
[Install]