What about run you app in background? Yuri Sent from my iPhone
Il giorno 16/ago/2013, alle ore 06:59, frwa onto <[email protected]> ha scritto: > Yes the script is suppose to be ever running for capture purposes and not > exiting. That is why I move to this method where later I can use tools like > monit to monitor and restart incase its down. But I am stuck now as I cant > load my os. I run on separate shell this test. So I can always open up > another terminal for it. > > > On Fri, Aug 16, 2013 at 4:11 AM, Francalacci Yuri <[email protected]> wrote: >> I suppose your script is never exiting. Do you have the shell available >> after running the script? >> >> Y >> >> >> >> Sent from Android >> >> frwa onto <[email protected]> ha scritto: >> >> Dear Yuri, >> First I had to remove the script else I cant boot. Next upon >> loading I re insert the script and running it accordingly from the >> /etc/init.d and its works perfectly fine no issues. During os load this what >> I can see >> >> Starting crond [Ok] >> Starting atd [Ok] >> >> Below it I can see read it says >> Capturing from eth0 ....... >> >> >> >> On Thu, Aug 15, 2013 at 6:42 PM, Francalacci Yuri <[email protected]> wrote: >>> Start the system without the script. Once booted, run the script >>> (/etc/init.d/yourscript start) from the command line and check where it >>> stops. >>> Yuri >>> >>> >>> >>> Sent from Android >>> >>> frwa onto <[email protected]> ha scritto: >>> >>> >>> Dear All, >>> We have the pfcount to run as system script where below is the >>> skeleton we use to set it. The problem during the loading of the os we >>> notice after the crond is loaded this service is load and it shows the >>> packet start to capture but never able to load the full os and restart >>> there after. How to run it as script without any issue to the os ? >>> >>> #!/bin/bash >>> # chkconfig: 2345 95 05 >>> # myapp daemon >>> # description: myapp daemon >>> # processname: myapp >>> >>> DAEMON_PATH="/usr/local/bin/" >>> DAEMON=myap1.c >>> #DAEMONOPTS="-my opts" >>> NAME=myap1.c >>> DESC="my packet capture" >>> >>> PIDFILE=/var/run/$NAME.pid >>> SCRIPTNAME=/etc/init.d/$NAME >>> >>> case "$1" in >>> start) >>> printf "%-50s" "Starting $NAME..." >>> insmod /usr/local/pfring/kernel/pf_ring.ko >>> /usr/local/bin/myap1.c >>> #cd $DAEMON_PATH >>> #PID=`$DAEMON > /dev/null 2>&1 & echo $!` >>> #echo "Saving PID" $PID " to " $PIDFILE >>> # if [ -z $PID ]; then >>> # printf "%s\n" "Fail" >>> # else >>> # echo $PID > $PIDFILE >>> # printf "%s\n" "Ok" >>> # fi >>> ;; >>> status) >>> printf "%-50s" "Checking $NAME..." >>> if [ -f $PIDFILE ]; then >>> PID=`cat $PIDFILE` >>> if [ -z "`ps axf | grep ${PID} | grep -v grep`" ]; then >>> printf "%s\n" "Process dead but pidfile exists" >>> else >>> echo "Running" >>> fi >>> else >>> printf "%s\n" "Service not running" >>> fi >>> ;; >>> stop) >>> printf "%-50s" "Stopping $NAME" >>> PID=`cat $PIDFILE` >>> cd $DAEMON_PATH >>> if [ -f $PIDFILE ]; then >>> kill -HUP $PID >>> printf "%s\n" "Ok" >>> rm -f $PIDFILE >>> else >>> printf "%s\n" "pidfile not found" >>> fi >>> ;; >>> restart) >>> $0 stop >>> $0 start >>> ;; >>> *) >>> echo "Usage: $0 {status|start|stop|restart}" >>> exit 1 >>> esac >>> >>> _______________________________________________ >>> Ntop-misc mailing list >>> [email protected] >>> http://listgateway.unipi.it/mailman/listinfo/ntop-misc >> >> >> _______________________________________________ >> Ntop-misc mailing list >> [email protected] >> http://listgateway.unipi.it/mailman/listinfo/ntop-misc > > _______________________________________________ > Ntop-misc mailing list > [email protected] > http://listgateway.unipi.it/mailman/listinfo/ntop-misc
_______________________________________________ Ntop-misc mailing list [email protected] http://listgateway.unipi.it/mailman/listinfo/ntop-misc
