Hi all,

It appears to me that 0 indeed is a valid shm key, but it is only returned
when the daemon tries to reconnect to an existing segment, for instance if
the daemon did not close properly. The daemon started perfectly every "first
time" I ran it, but every subsequent launch it failed. ipcs learned that the
daemon left its segment after getting a 9 from start-stop-daemon.

My "fix" was the following patch to debian/init.d:

 DAEMON=/usr/bin/$NAME
 DATA_BASE_DIR="/var/cache/nfdump"
-DAEMON_ARGS="-D -l $DATA_BASE_DIR"
 PIDFILE=/var/run/$NAME.pid
+DAEMON_ARGS="-D -l $DATA_BASE_DIR -P ${PIDFILE}"
 SCRIPTNAME=/etc/init.d/$NAME

Start-stop-daemon is now able to give a 15 on 'stop', which results in
nfcapd to release its segments and properly launch each subsequent time.

Jorik

Reply via email to