I've created the following init.d script per this guide, which is designed to start this branch of MaNGOS at boot:
#!/bin/sh
### BEGIN INIT INFO
# Provides: mangosd
# Should-Start: console-screen dbus network-manager
# Required-Start: $all
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start mangosd at boot time
### END INIT INFO
#
set -e
/lib/lsb/init-functions
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/sbin
SCRIPT="/usr/local/sbin/realmd.sh"
SCRIPT2="/usr/local/sbin/mangosd.sh"
PROGRAMNAME="realmd"
PROGRAMNAME2="mangosd"
case "$1" in
start)
$SCRIPT
$SCRIPT2
;;
stop)
pkill $PROGRAMNAME
pkill $PROGRAMNAME2
;;
esac
exit 0
I am able to run this script with sudo /etc/init.d/mangosd start
, which will cause it to work as expected, running realmd.sh and mangosd.sh, which are as follows.
realmd.sh:
#!/bin/sh
# /usr/local/sbin/realmd.sh
/home/rebirth/MaNGOS/bin/realmd &
mangosd.sh:
#!/bin/sh
# /usr/local/sbin/mangosd.sh
cd /home/rebirth/MaNGOS/bin
./mangosd &
All three files have the same permissions, as follows:
-rwxr-xr-x 1 root root 80 Sep 2 20:33 /usr/local/sbin/mangosd.sh
The programs realmd
and mangosd
will then run as expected. Per the guide, I have run sudo insserv mangosd
and verified the boot file was created:
$ ls -la /etc/rc2.d/S04mangosd
lrwxrwxrwx 1 root root 17 Sep 2 18:00 /etc/rc2.d/S04mangosd -> ../init.d/mangosd
I ran sudo reboot
and neither realmd
nor mangosd
started automatically at boot. Running the init.d script manually at this point still works as expected.
I have viewed the following posts relating to this issue:
Init.d script to start Hudson doesn't run at boot on Ubuntu
debian init.d script not running after reboot
Neither provided a solution, however the latter did have another command I hadn't tried, sudo update-rc.d mangosd defaults
. Unfortunately, after running this command and rebooting, realmd
and mangosd
were still not running automatically at boot.
If anyone has any suggestions, or is able to point me in the right direction, I'd really appreciate it. Thank you very much!