On Wed, May 22, 2013 at 7:02 AM, Antoine Jacoutot <ajacou...@bsdfrog.org> wrote:
> On Wed, May 22, 2013 at 06:57:16AM +0000, C. L. Martinez wrote:
>> On Wed, May 22, 2013 at 6:50 AM, Antoine Jacoutot <ajacou...@bsdfrog.org> 
>> wrote:
>> > On Wed, May 22, 2013 at 06:18:04AM +0000, C. L. Martinez wrote:
>> >> Hi all,
>> >>
>> >>  I have a problem with some tcl rc.d startup scripts. Start and status
>> >
>> > You mean check instead of status, right?
>>
>> Yep, you are rigth Antoine ..
>>
>> >
>> >> works ok but stop and restart, doesn't.
>> >
>> > Running the rc script in debug mode may give you some clue (-d).
>> >
>>
>>
>> Uhmm .. no clues:
>>
>> /usr/local/etc/rc.d/suricata_proxyin_agent -d stop
>>
>> + [ -n /usr/local/bin/suricata_proxyin_agent.tcl ]
>> + unset _RC_DEBUG _RC_FORCE
>> + getopts df c
>> + _RC_DEBUG=-d
>> + getopts df c
>> + shift 1
>> + basename /usr/local/etc/rc.d/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
>> doing rc_read_runfile
>> doing rc_check
>
> Well it seems to stop at rc_check.
> Maybe the pexp doesn't match.
>

>From command line match:

+ 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 -c
/data/config/etc/sguil/suricata_proxyin_agent.conf -D
+ rc_cmd stop
doing rc_read_runfile
doing rc_check
root@nsm10:/tmp#
root@nsm10:/tmp# ps xa
  PID TT  STAT       TIME COMMAND
    1 ??  Is      0:01.21 /sbin/init
17527 ??  Is      0:00.02 syslogd: [priv] (syslogd)
10721 ??  S       0:00.75 /usr/sbin/syslogd -a /var/www/dev/log -a
/var/empty/dev/log
 6621 ??  Is      0:00.06 pflogd: [priv] (pflogd)
 7793 ??  S       0:04.93 pflogd: [running] -s 160 -i pflog0 -f
/var/log/pflog (pflogd)
  160 ??  Ss      0:00.26 ntpd: ntp engine (ntpd)
 8497 ??  Is      0:00.01 ntpd: dns engine (ntpd)
 2615 ??  Is      0:00.01 ntpd: [priv] (ntpd)
22730 ??  Is      0:00.22 /usr/sbin/sshd
20624 ??  Ss      0:02.80 sendmail: accepting connections (sendmail)
 6481 ??  Is      0:00.03 /usr/sbin/inetd
20209 ??  Ss      0:00.71 /usr/sbin/cron
28761 ??  Is      0:00.63 sshd: root@ttyp0 (sshd)
17173 ??  Ss      0:00.45 sshd: root@ttyp1 (sshd)
30836 p0  Is+     0:00.18 -ksh (ksh)
31013 p1  Ss      0:00.14 -ksh (ksh)
17680 p1  R+/3    0:00.28 ps -xa
17486 p2- I       0:00.30 /usr/local/bin/tclsh8.5
/usr/local/bin/suricata_proxyin_agent.tcl -c
/data/config/etc/sguil/suricata_proxyin_agent.conf -D
30991 C0  Is+     0:00.02 /usr/libexec/getty std.9600 ttyC0
25448 C1  Is+     0:00.00 /usr/libexec/getty std.9600 ttyC1

root@nsm10:/tmp# export pexp="/usr/local/bin/tclsh8.5
/usr/local/bin/suricata_proxyin_agent.tcl -c
/data/config/etc/sguil/suricata_proxyin_agent.conf -D"
root@nsm10:/tmp# set
COLUMNS=203
HOME=/root
IFS='
'
KSH_VERSION='@(#)PD KSH v5.2.14 99/07/13.2'
LINES=60
LOGNAME=root
MAIL=/var/mail/root
MAILCHECK=600
OLDPWD=/tmp/l/cxtracker-master
OPTIND=1
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin
PKG_PATH=http://ftp.openbsd.org/pub/OpenBSD/5.3/packages/amd64/
PPID=17173
PS1='\u@\h:\w\$ '
PS2='> '
PS3='#? '
PS4='+ '
PWD=/tmp/l/cxtracker-master/src
RANDOM
SECONDS=5105
SHELL=/bin/ksh
TERM=xterm
TERMCAP='xterm:NP:@8=\EOM:K2=\EOE:SF=\E[%dS:SR=\E[%dT:kB=\E[Z:@7=\EOF:kd=\EOB:kh=\EOH:kl=\EOD:kr=\EOC:ku=\EOA:2:F1=\E[23~:F2=\E[24~:F3=\E[1;2P:F4=\E[1;2Q:F5=\E[1;2R:F6=\E[1;2S:F7=\E[15;2~:F8=\E[17;2~:F9=\E[18;2~:FA=\E[19;2~:FB=\E[20;2~:FC=\E[21;2~:FD=\E[23;2~:FE=\E[24;2~:FF=\E[1;5P:FG=\E[1;5Q:FH=\E[1;5R:FI=\E[1;5S:FJ=\E[15;5~:FK=\E[17;5~:FL=\E[18;5~:FM=\E[19;5~:FN=\E[20;5~:FO=\E[21;5~:FP=\E[23;5~:FQ=\E[24;5~:FR=\E[1;6P:FS=\E[1;6Q:FT=\E[1;6R:FU=\E[1;6S:FV=\E[15;6~:FW=\E[17;6~:FX=\E[18;6~:FY=\E[19;6~:FZ=\E[20;6~:Fa=\E[21;6~:Fb=\E[23;6~:Fc=\E[24;6~:Fd=\E[1;3P:Fe=\E[1;3Q:Ff=\E[1;3R:Fg=\E[1;3S:Fh=\E[15;3~:Fi=\E[17;3~:Fj=\E[18;3~:Fk=\E[19;3~:Fl=\E[20;3~:Fm=\E[21;3~:Fn=\E[23;3~:Fo=\E[24;3~:Fp=\E[1;4P:Fq=\E[1;4Q:Fr=\E[1;4R:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:2:#4=\E[1;2D:%i=\E[1;2C:kF=\E[1;2B:kR=\E[1;2A:2:#2=\E[1;2H:#3=\E[2;2~:%c=\E[6;2~:%e=\E[5;2~:*4=\E[3;2~:*7=\E[1;2F:kI=\E[2~:kN=\E[6~:kP=\E[5~:kD=\E[3~:kI=\E[2~:kN=\E[6~:'
TMOUT=0
USER=root
_=set
pexp='/usr/local/bin/tclsh8.5
/usr/local/bin/suricata_proxyin_agent.tcl -c
/data/config/etc/sguil/suricata_proxyin_agent.conf -D'

root@nsm10:/tmp# pkill -f ${pexp}
root@nsm10:/tmp# ps xa
  PID TT  STAT       TIME COMMAND
    1 ??  Ss      0:01.21 /sbin/init
17527 ??  Is      0:00.02 syslogd: [priv] (syslogd)
10721 ??  S       0:00.76 /usr/sbin/syslogd -a /var/www/dev/log -a
/var/empty/dev/log
 6621 ??  Is      0:00.06 pflogd: [priv] (pflogd)
 7793 ??  S       0:04.93 pflogd: [running] -s 160 -i pflog0 -f
/var/log/pflog (pflogd)
  160 ??  Is      0:00.26 ntpd: ntp engine (ntpd)
 8497 ??  Is      0:00.01 ntpd: dns engine (ntpd)
 2615 ??  Is      0:00.01 ntpd: [priv] (ntpd)
22730 ??  Is      0:00.22 /usr/sbin/sshd
20624 ??  Ss      0:02.80 sendmail: accepting connections (sendmail)
 6481 ??  Is      0:00.03 /usr/sbin/inetd
20209 ??  Ss      0:00.71 /usr/sbin/cron
28761 ??  Is      0:00.63 sshd: root@ttyp0 (sshd)
17173 ??  Ss      0:00.50 sshd: root@ttyp1 (sshd)
 30836 p0  Is+     0:00.18 -ksh (ksh)
31013 p1  Ss      0:00.16 -ksh (ksh)
  909 p1  R+/1    0:00.00 ps -xa
30991 C0  Is+     0:00.02 /usr/libexec/getty std.9600 ttyC0
25448 C1  Is+     0:00.00 /usr/libexec/getty std.9600 ttyC1

Reply via email to