Why use a PID file? Before the PID files option was implemented in the panel; the panel required that the game server process be directly launched by the panel. If it wasn't there's no gurarantee the panel was monitoring the right process.
Why does it matter? Lets say in *nix you want the gameserver to run as a different user by calling the 'su' command. The panel will run the su command, but it'll be tracking that the su process is running, not the process spawned by su (ie the actual game server). Telling the panel you want to use a pid file will allow the panel to track the right process regardless of how it was started. The PID executable setting allows the panel to ensure it's tracking the right process by comparing the reported name and the name in the setting.
So, how do I get a PID file? Some game servers have an option to create one, some do it automatically, and some don't at all. Review the programs switches to see if there is an option. If there isn't, it's still possible to make one. For example, we have a gameserver that takes no arguments, and doesn't create a PID file. Here's my settings in the panel to start it with su to run as another user.
Code: Select all
command: su commandline: awh -c "cd /home/awh/samp/samp022;./samp022svr &1;ps -u awh -C samp022svr -o pid --no-heading > /tmp/samp.pid" Pid file setting: /tmp/samp.pid Executable name: samp022svr
- Srcds has a -pidfile <path&name> command line argument you can use
- All game servers should use their own unique pid file
- When using wrappers, you probably shouldn't give your users access to change the commandline. They could run something you may want them to.
- You will more then likely need to increase the server defintions timeout period if using pid files with a remote node