Hi!
In sources (pcapsipdump.cpp) I see that PID is a CONST, string №195:
const char *pid_file="/var/run/pcapsipdump.pid";
But for running two or more daemons (one daemon for one interface), PID must be a variable, getting from the command line arguments (debian/pcapsipdump.init):
PIDFILE="/var/run/pcapsipdump.pid"
start() {
echo -n $"Starting $NAME: "
start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON --test > /dev/null || return 1
start-stop-daemon --start --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS || return 2
return 0
}
Added in [r131].
Note that daemons self-forking is not the only and not the best way to fork. Some supervisors (inittab, systemd, djb's supervise) prefer supervisor to do the forking. This makes both pid discovery and wait(3) trivial. For example, from bash with any version of pcapsipdump:
Related
Commit: [r131]