1,575
edits
Changes
→Finalize the Setup
=Finalize the Setup=
#Configure Debian to autorun our server on boot
##Install ''daemon[http://software.clapper.org/daemonize/ daemonize]'' (for use in our init.d script) by running <pre>sudo apt install daemondaemonize</pre>
##Create a new service file by running <pre>sudo nano /etc/init.d/quakejs</pre>
##Fill the file with the following THIS DOESN'T WORK YET<pre>### BEGIN INIT INFO # Provides: quakejs # Required-Start: $network # Required-Stop: $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: QuakeJs Server # Description: Starts/Stops/Restarts the QuakeJS Server Daemon ### END INIT INFO set -e PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="QuakeJS Server" NAME=quakejs-server USER=quake DIR=/home/quake/quakejs DAEMON=node build/ioq3ded.js +set fs_game baseq3 set dedicated 1 +exec server.cfg #PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME # Gracefully exit if the package has been removed. test -x $DAEMON || exit 0 sleep 2 sudo -u $USER $DAEMON $1 $OPTIONS </pre>