Re: sudo nohup tcpdump at startup

2015-02-04 Thread Jérémie Courrèges-Anglas
fRANz writes: > On Thu, Jan 29, 2015 at 10:54 PM, Christopher Barry > wrote: > >> what happens if you source /etc/rc.local instead? >> as in: >> [ -f /etc/rc.local ] && . /etc/rc.local > > Hi Christopher, > I'm sorry, same behaviour: some commands were correctly invoked, for example: > > /sbin/i

Re: sudo nohup tcpdump at startup

2015-02-04 Thread Hrvoje Popovski
On 4.2.2015. 15:13, Todd C. Miller wrote: > On Wed, 04 Feb 2015 15:06:41 +0100, Hrvoje Popovski wrote: > >> is there any problem to just put this in crontab? >> >> @reboot /usr/sbin/tcpdump -lnqttti pflog0 2> error.log | /usr/bin/logger >> -t pf -p local2.info & > > You should not try to run the

Re: sudo nohup tcpdump at startup

2015-02-04 Thread Todd C. Miller
On Wed, 04 Feb 2015 15:06:41 +0100, Hrvoje Popovski wrote: > is there any problem to just put this in crontab? > > @reboot /usr/sbin/tcpdump -lnqttti pflog0 2> error.log | /usr/bin/logger > -t pf -p local2.info & You should not try to run the command in the background since cron runs commands as

Re: sudo nohup tcpdump at startup

2015-02-04 Thread Hrvoje Popovski
On 3.2.2015. 5:16, Ted Unangst wrote: > fRANz wrote: >> On Thu, Jan 29, 2015 at 10:54 PM, Christopher Barry >> wrote: >> >>> what happens if you source /etc/rc.local instead? >>> as in: >>> [ -f /etc/rc.local ] && . /etc/rc.local >> >> Hi Christopher, >> I'm sorry, same behaviour: some commands we

Re: sudo nohup tcpdump at startup

2015-02-03 Thread Leclerc, Sebastien
On 2015-02-03 04:16:04, Ted Unangst wrote: > This is the kind of thing I usually put in a small script, and add to root's > crontab. I don't think you need the nohup and sudo, that's probably just > complicating things. e.g. > > #!/bin/sh > tcpdump -n | logger 2> error.log & > > then > @reboot /ro

Re: sudo nohup tcpdump at startup

2015-02-03 Thread Craig Skinner
On 2015-02-02 Mon 20:03 PM |, fRANz wrote: > > # cat /etc/rc.local > /sbin/ifconfig pflog0 up && /sbin/pflogd -f /dev/null > sudo nohup tcpdump -n -v -l -q -n -e -ttt -i pflog0 action block | logger -t > pf -p local2.info & ? /etc/rc.local is run by root on boot. Check the environment rc

Re: sudo nohup tcpdump at startup

2015-02-02 Thread Ted Unangst
fRANz wrote: > On Thu, Jan 29, 2015 at 10:54 PM, Christopher Barry > wrote: > > > what happens if you source /etc/rc.local instead? > > as in: > > [ -f /etc/rc.local ] && . /etc/rc.local > > Hi Christopher, > I'm sorry, same behaviour: some commands were correctly invoked, for example: > > /sbi

Re: sudo nohup tcpdump at startup

2015-02-02 Thread fRANz
On Mon, Feb 2, 2015 at 8:11 PM, Giancarlo Razzolini wrote: > You could use tmux for this. You can start a detached session that in turn > run your command. You can latter attach to it and see what went wrong. My > suggestion is that you call tmux from /etc/rc.local using su -c to make it > run as

Re: sudo nohup tcpdump at startup

2015-02-02 Thread Giancarlo Razzolini
On 02-02-2015 17:03, fRANz wrote: > Again, > it's not a problem hack the rc file but when possible I avoid it, as > suggested many times in this list;-) You could use tmux for this. You can start a detached session that in turn run your command. You can latter attach to it and see what went wrong.

Re: sudo nohup tcpdump at startup

2015-02-02 Thread fRANz
On Thu, Jan 29, 2015 at 10:54 PM, Christopher Barry wrote: > what happens if you source /etc/rc.local instead? > as in: > [ -f /etc/rc.local ] && . /etc/rc.local Hi Christopher, I'm sorry, same behaviour: some commands were correctly invoked, for example: /sbin/ifconfig pflog0 up && /sbin/pflog

Re: sudo nohup tcpdump at startup

2015-01-29 Thread Christopher Barry
On Thu, 29 Jan 2015 20:56:50 +0100 fRANz wrote: >Hello guys, >I implemented this config: > >http://home.nuug.no/~peter/pf/newest/log2syslog.html > >in order to stream pf logs to a remote machine. >If I add the command: > >sudo nohup tcpdump -n -v -l -q -n -e -ttt -i pflog0 action block | >logger

sudo nohup tcpdump at startup

2015-01-29 Thread fRANz
Hello guys, I implemented this config: http://home.nuug.no/~peter/pf/newest/log2syslog.html in order to stream pf logs to a remote machine. If I add the command: sudo nohup tcpdump -n -v -l -q -n -e -ttt -i pflog0 action block | logger -t pf -p local2.info & to the /etc/rc.local file and reboot