I’ve been running OpenSUSE for years and finally upgraded to 13.1 a few days ago. One issue I’ve been trying to chase down is the lack of a pidfile in 13.1 compared to any other OpenSUSE distribution, 12.3 and below.
In my researching the issue, I found two things:
sshd is now handled using systemd.
The default option in /usr/lib/systemd/system/sshd.service
ExecStart=/usr/sbin/sshd -D $SSHD_OPTS
which is essentially the same as in prior distributions, no longer results in a pidfile being created in /var/run/. Just try to run sshd using a command line
Removing -D results in the pidfile being created correctly.
However, removing -D from /usr/lib/systemd/system/sshd.service also ends up with trying to run sshd twice upon rcsshd restart, for example, at least according to the log message about the port being taken (even if I killall -9 -r sshd first).
So, why does -D no longer produce a pidfile in /var/run/? What changed? Without the pidfile, monit isn’t very happy to monitor sshd (switching it to the “check program” mode is buggy right now).
Any help from SUSE maintainers or anyone with an answer is much appreciated.
If you read man sshd, you’ll find /run/sshd.pid is used instead
Contains the process ID of the sshd listening for connections (if there are several daemons
running concurrently for different ports, this contains the process ID of the one started
last). The content of this file is not sensitive; it can be world-readable.
Some old discussions related to systemd and tmpfs changes:
Well afaik not until 208 version, previous versions you still need it and it can be in /etc/tmpfiles.d but i can’t really be sure, well not theou PID file itself but it is defined in that directory/file. ;).
What im interested in this thread is where the $MAINPID is defined because you can see some kill -HUP $MAINPID in the init scripts and systemd startup scripts but i cant seem to find where it is defined, maybe systemd knows that already