Some new discoveries!
Code:
pxc@cista:~$ bnetd -h
usage: bnetd [<options>]
-c FILE, --config=FILE use FILE as configuration file (default is /etc/pvpgn/bnetd.conf)
-d FILE, --hexdump=FILE do hex dump of packets into FILE
-f, --foreground don't daemonize
-D, --debug run in debug mode (run in foreground and log to stdout)
-h, --help, --usage show this information and exit
-v, --version print version number and exit
Note the --foreground option.
Code:
pxc@cista:~$ bnetd -f
Jul 30 13:12:54 [error] eventlog_open: could not open file "/var/lib/pvpgn/bnetd.log" for appending (fopen: Permission denied)
Jul 30 13:12:54 [fatal] eventlog_startup: could not use file "/var/lib/pvpgn/bnetd.log" for the eventlog (exiting)
On my box I did the following to add a new system user for pvpgn with no rights and no shell, and give it complete access to pvpgn-related files.
Code:
sudo useradd -g nogroup -s /bin/false -d /home/pvpgn-srv -r pvpgn-srv
sudo chown pvpgn-srv /etc/pvpgn /var/lib/pvpgn /usr/games/pvpgn /usr/share/games/pvpgn
Now I can run PvPGN as someone other than root (which makes me feel much safer about running a service facing the internet). I start it (through my init script) more or less like this.
Code:
sudo start-stop-daemon --start --exec /usr/sbin/pvpgn --chuid pvpgn-srv
If you set up the user with the same command, you can launch your source compiled version like this:
Code:
su -c '/path/to/bnetd' pvpgn-srv
Just make sure you replace /path/to/bnetd with the path to your executable.
Good luck!
Bookmarks