22.05.2013 10:19 полÑзоваÑÐµÐ»Ñ "C. L. Martinez" <carlopm...@gmail.com> напиÑал: > > Hi all, > > I have a problem with some tcl rc.d startup scripts. Start and status > works ok but stop and restart, doesn't.
Stupid question: does it stop if you kill it by pid directly? I've seen at least one daemon do far that ignores SIGTERM... > Script: > > #!/bin/sh -x > # > # $OpenBSD: suricata_proxyin_agent,v 1.0 > > daemon="/usr/local/bin/suricata_proxyin_agent.tcl" > daemon_flags="-c /data/config/etc/sguil/suricata_proxyin_agent.conf -D" > > . /etc/rc.d/rc.subr > > pexp="/usr/local/bin/tclsh8.5 $daemon" > > rc_cmd $1 > > I have tried several variants like to insert rc_stop specific option > or changing pexp to "/usr/local/bin/tclsh8.5 $daemon $daemon_args" > without luck. > > Debugging script, acts as like the other system startup scripts: > > ..... > > + echo NO > + : NO > + [ XNO = XYES ] > + echo NO > + : NO > + domainname > + [ X != X -a -d /var/yp/binding ] > + echo NO > + : NO > + : NO > + [ -n /usr/local/bin/suricata_proxyin_agent.tcl ] > + unset _RC_DEBUG _RC_FORCE > + getopts df c > + shift 0 > + basename ./suricata_proxyin_agent > + _name=suricata_proxyin_agent > + _RC_RUNDIR=/var/run/rc.d > + _RC_RUNFILE=/var/run/rc.d/suricata_proxyin_agent > + eval _rcflags=${suricata_proxyin_agent_flags} > + _rcflags= > + eval _rcuser=${suricata_proxyin_agent_user} > + _rcuser= > + getcap -f /etc/login.conf suricata_proxyin_agent > + > /dev/null > + 2>&1 > + [ -z ] > + daemon_class=daemon > + [ -z ] > + daemon_user=root > + [ -n ] > + [ -n ] > + [ -n ] > + printf %s -c /data/config/etc/sguil/suricata_proxyin_agent.conf -D > + daemon_flags= -c /data/config/etc/sguil/suricata_proxyin_agent.conf -D > + daemon_flags=-c /data/config/etc/sguil/suricata_proxyin_agent.conf -D > + readonly daemon_class > + unset _rcflags _rcuser > + pexp=/usr/local/bin/suricata_proxyin_agent.tcl -c > /data/config/etc/sguil/suricata_proxyin_agent.conf -D > + rcexec=su -l -c daemon -s /bin/sh root -c > + pexp=/usr/local/bin/tclsh8.5 /usr/local/bin/suricata_proxyin_agent.tcl > + rc_cmd stop > > root@nsm10:/usr/local/etc/rc.d# ps xa |grep suricata_proxyin_agent.tcl > | grep -v grep > 17486 p2- I 0:00.29 /usr/local/bin/tclsh8.5 > /usr/local/bin/suricata_proxyin_agent.tcl -c > /data/config/etc/sguil/suricata_proxyin_agent.conf -D > > Any idea why process is not stopped??