On 04/20/2015 12:15 PM, C.L. Martinez wrote:
On 04/20/2015 11:50 AM, Antoine Jacoutot wrote:
On Mon, Apr 20, 2015 at 11:44:59AM +0000, C.L. Martinez wrote:
Hi all,
I have created a custom rc.d script to launch sslsplit at startup
and stop
it at shutdown. Start option works without problems, but this script
doesn't
stop process.
Here it is:
#!/bin/sh -x
#
daemon="/usr/local/bin/sslsplit"
. /etc/rc.d/rc.subr
rc_reload=NO
rc_cmd $1
Options in rc.conf.local are:
sslsplit_flags="-d -Z -l /var/log/sslsplit -S /tmp -k
/root/configs/sslsplit/ca.key -p /var/run/sslsplit.pid -c
/root/configs/sslsplit/ca.crt -u proxy ssl 127.0.0.1 8443"
You need a pexp variable that patches the process table.
+ pexp=/usr/local/bin/sslsplit -d -Z -l /var/log/sslsplit -S /tmp -k
/root/configs/sslsplit/ca.key -p /var/run/sslsplit.pid -c
/root/configs/sslsplit/ca.crt -u proxy ssl 127.0.0.1 8443
versus
17658 ?? Ss 0:04.65 /usr/local/bin/sslsplit -d -Z -l
/var/log/sslsplit
-S /tmp -k /root/configs/sslsplit/ca.key -p /var/run/sslsplit.pid -c
Uhmm .. I am trying some variants, but it doesn't works:
+ daemon=/usr/local/bin/sslsplit -d -u proxy
+ daemon_flags=-Z -l /var/log/sslsplit -S /tmp -k
/root/configs/sslsplit/ca.key -c /root/configs/sslsplit/ca.crt ssl
127.0.0.1 8443
+ . /etc/rc.d/rc.subr
+ [ -n ]
+ [ -n /usr/local/bin/sslsplit -d -u proxy ]
+ unset _RC_DEBUG _RC_FORCE
+ getopts df c
+ shift 0
+ basename /etc/rc.d/sslsplit
+ _name=sslsplit
+ _RC_RUNDIR=/var/run/rc.d
+ _RC_RUNFILE=/var/run/rc.d/sslsplit
+ _rc_do _rc_parse_conf
+ eval _rcflags=${sslsplit_flags}
+ _rcflags=
+ eval _rcuser=${sslsplit_user}
+ _rcuser=
+ eval _rctimeout=${sslsplit_timeout}
+ _rctimeout=
+ getcap -f /etc/login.conf sslsplit
+ > /dev/null
+ 2>&1
+ [ -z ]
+ daemon_class=daemon
+ [ -z ]
+ daemon_user=root
+ [ -z ]
+ daemon_timeout=30
+ [ -n ]
+ [ -n ]
+ [ -n ]
+ [ -n ]
+ printf %s -Z -l /var/log/sslsplit -S /tmp -k
/root/configs/sslsplit/ca.key -c /root/configs/sslsplit/ca.crt ssl
127.0.0.1 8443
+ daemon_flags= -Z -l /var/log/sslsplit -S /tmp -k
/root/configs/sslsplit/ca.key -c /root/configs/sslsplit/ca.crt ssl
127.0.0.1 8443
+ daemon_flags=-Z -l /var/log/sslsplit -S /tmp -k
/root/configs/sslsplit/ca.key -c /root/configs/sslsplit/ca.crt ssl
127.0.0.1 8443
+ readonly daemon_class
+ unset _rcflags _rcuser
+ pexp=/usr/local/bin/sslsplit -d -u proxy -Z -l /var/log/sslsplit -S
/tmp -k /root/configs/sslsplit/ca.key -c /root/configs/sslsplit/ca.crt
ssl 127.0.0.1 8443
+ rcexec=su -l -c daemon -s /bin/sh root -c
+ rc_reload=NO
+ rc_cmd stop
pexp result is correct now, but daemon is not stopped ...
Ok, now it works... I have removed /var/run/rc.d/sslplit file and now it
is working ...