Hi patrikg
Why not like another deamons SysV-init-skript rc files make a pid file with the pid number, ...
Here's what happens when you background lldpd:
tc@box:~/lldpd$
tc@box:~/lldpd$
tc@box:~/lldpd$
tc@box:~/lldpd$ sudo /usr/local/sbin/lldpd &
tc@box:~/lldpd$
[1]+ Done sudo /usr/local/sbin/lldpd
tc@box:~/lldpd$ echo $!
5186
tc@box:~/lldpd$ ps aux | grep -v "grep" | grep /usr/local/sbin/lldpd
5187 _lldpd /usr/local/sbin/lldpd
5189 _lldpd /usr/local/sbin/lldpd
tc@box:~/lldpd$
It launches 2 instances of itself and exits. The PID you get back is
for the original instance you launched, which already exited.
Also, lldpd creates its own PID file:
tc@box:~/lldpd$ cat /var/run/lldpd.pid
5187
tc@box:~/lldpd$
... and kill that number. ...
start-stop-daemon stop sends kill signals to all copies of lldpd, regardless
of how many copies are currently running.