You are not logged in.
Pages: 1
I'm making a Source Dedicated Server using Arch and this guide - http://wiki.garrysmod.com/?title=Linux_ … rver_Setup
I was wondering, is there any way that I can create a daemon from the startup script? (It's near the bottom)
I would like it to have all of the usual start, stop and restart commands that daemons usually have.
Thanks,
tehsusenoh
Offline
Sure thing, check the source of a few daemons in /etc/rc.d/ to see how to build one, it's pretty straightforward.
ᶘ ᵒᴥᵒᶅ
Offline
Here's what I have so far, but I don't know how to do the stat_fail conditions.
#!/bin/bash
daemon_name=srcdsd
. /etc/rc.conf
. /etc/rc.d/functions
start=su - gmod -c 'screen -A -m -d -S gm10server /home/gmod/srcds/orangebox/scrds_run -console -game garrysmod +maxplayers 1 +map gm_flatgrass -autoupdate'
case "$1" in
start)
stat_busy "Starting Source Dedicated Server"
$start >/dev/null 2>&1 </dev/null
add_daemon srcdsd
stat_done
fi
;;
stop)
stat_busy "Stopping Source Dedicated Server"
killall srcds
restart)
$0 stop
sleep 1
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
esac
exit 0
Any issues? This is my first Arch install, so I'm learning.
Offline
Pages: 1