FS#4694 - rsync startup script errors
Attached to Project:
Arch Linux
Opened by Erwin Van de Velde (evdvelde) - Wednesday, 24 May 2006, 12:50 GMT
Last edited by Eric Belanger (Snowman) - Sunday, 16 December 2007, 22:43 GMT
Opened by Erwin Van de Velde (evdvelde) - Wednesday, 24 May 2006, 12:50 GMT
Last edited by Eric Belanger (Snowman) - Sunday, 16 December 2007, 22:43 GMT
|
Details
The rsync startup script fails to restart or stop the daemon
because of missing pid file. The file /var/run/rsyncd.pid is
never created.
|
This task depends upon
Example scenario:
You run an rsync to mirror some files on a remote server. While that's going on, you start up your rsync server with "/etc/rc.d/rsync start". Now the rc.d/rsync script grabs the pid of the WRONG rsync binary and stores it in /var/run/rsync.pid. If you run "/etc/rc.d/rsync stop" it will kill the wrong rsync binary.
Anyone know if bash has a special parameter that returns the PID of the last-executed command? I seem to remember it having something like that...
pgrep -of "/usr/bin/rsync --daemon" > /var/run/rsyncd.pid
The "-o" should return the oldest started instance pid.
Hopefully that would be the session leader (ppid).