iptraf does not start when executed as cronjob
Hello,
when I try to start iptraf in background mode via cronjob, nothing happens.
When I start iptraf via command-line, everything is fine:
dirac# /usr/sbin/iptraf -s eth0 -t 5 -B -L /var/log/iptraf/file.log
dirac# ps aux | grep iptraf
root 3757 0.1 0.4 2000 912 ? Ss 22:00 0:00
/usr/sbin/iptraf -s eth0 -t 5 -B -L /var/log/iptraf/file.log
If I omit the -L flag the logfile is created automatically since I enables
logging.
dirac# /usr/sbin/iptraf -s eth0 -t 1 -B
dirac# ps aux | grep iptraf
root 11525 0.0 0.4 2000 884 ? Ss 22:03 0:00
/usr/sbin/iptraf -s eth0 -t 1 -B
dirac# ll /var/log/iptraf/
-rw-r-----+ 1 root root 76 2005-10-19 22:00 file.log
-rw-r-----+ 1 root root 76 2005-10-19 22:03 tcp_udp_services-eth0.log
So far, everything is as I expected it to be. Now I try to start it via
cron.
dirac# crontab -l
*/5 * * * * /usr/sbin/iptraf -s eth0 -t 5 -B -L /var/log/iptraf/file.log
And cron does something as this syslog entry shows:
Oct 19 22:10:01 dirac /USR/SBIN/CRON[20371]: (root) CMD (/usr/sbin/iptraf -s
eth0 -t 5 -B -L /var/log/iptraf/file.log)
But nothing happens. I do not get any error messages but neither is there an
iptraf process nor get any logfiles created or updated.
I have two debian boxes(stable), one with all security-updates
one installed from the sarge-dvd 3.1 rev0a with no updates. Same problem on
both of them. I do also have a SuseLinux box that does not show this problem
though.
I do not know whether this is a cron or iptraf problem (or if it is my
fault)
but I would be glad if you could help me.
Thanks
Sebastian
Reply to: