This is a sysvinit unit file that provides a "nwnserver" service which starts and stops a nwnserver instance and provides status information on request.
It allows linux based service administrators using a sysvinit init system to easily administer their server. It probably will work with systemd's backwards compatability but I make no promises or gaurantees. I avoid using systemd.
This is tested with nwserver 8193.35-40. You will want to tweak the settings at the head of this unit file as appropriate to your install, and also the dm password in the command line. I do not export that one for likely-obvious security reasons.
2.0 Update: Status and uptime reporting.
To use, simply unzip the zip into /etc/init.d, open it up in nano or your text editor of choice, and change the parameters in the header as is appropriate to your install.
You can interact with the service using the standard means:
service nwnserver start
service nwnserver stop
service nwnserver restart
service nwnserver status
In some sysvinit environments, you may have to go PATH:$PATH:/usr/sbin before the service command will work.
To have the server start on your machine's startup, symlink the unitfile in /etc/rc2.d/S7nwnserver, /etc/rc3.d/S7nwnserver, /etc/rc4.d/S7nwnserver, and /etc/rc5.d/S7nwnserver
This uses the screen application to create an instance of the console you can reattach to, to administrate the server. Provided it starts properly, you can use screen -dr nwn to reattach to the server console at any time (and ctrl-d to deattach).
If you lack it, you can install the screen software with apt get screen - but it is a standard part of most Debian and derivative distributions.
TODO/wishlist:
Attachment | Size |
---|---|
nwnserver unit file v1.0 (159) | 1.68 KB |
nwnserver unit file v2.0 (26) | 1.54 KB |