Re: bug in rc.subr: kills more than it should (patch)

2015-07-22 Thread Antoine Jacoutot
Your initial use case explanation was the reason I made this change. See we do listen to our users, thanks :-) -Original Message- From: "nusenu" Sent: ‎7/‎21/‎2015 23:19 To: "misc@openbsd.org" Cc: "Antoine Jacoutot" Subject: Re: bug in rc.subr: ki

Re: bug in rc.subr: kills more than it should (patch)

2015-07-21 Thread nusenu
>>> imagine you have N services named: >>> >>> service service1 service2 ... >>> >>> or a ab abc ... >>> >>> Now you want to stop 'service' and you run: 'rcctl stop >>> service' >>> >>> all (not just one) of them are gone? >>> >>> >>> rc.subr invokes pkill and does a "startswith" match but does >>>

Re: bug in rc.subr: kills more than it should (patch)

2015-06-20 Thread nusenu
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 >>> If you want to match the exact complete command line, adapt >>> pexp > accordingly and end it with '$'. >>> >>> Can $pexp be set via /etc/rc.conf.local? > No, you need to edit the rc script for that. After thinking about creating a custom r

Re: bug in rc.subr: kills more than it should (patch)

2015-06-20 Thread Antoine Jacoutot
On Sat, Jun 20, 2015 at 10:02:18PM +0200, nusenu wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > >>> Some daemons will happend more stuffs to the command line than > >>> just > > $daemon $daemon_flags > >>> > >>> Then $pexp should include everything that a daemon can append > >

Re: bug in rc.subr: kills more than it should (patch)

2015-06-20 Thread nusenu
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 >>> Some daemons will happend more stuffs to the command line than >>> just > $daemon $daemon_flags >>> >>> Then $pexp should include everything that a daemon can append >>> via rc.conf.local settings? > No. Would you mind elaborating on that?

Re: bug in rc.subr: kills more than it should (patch)

2015-06-20 Thread nusenu
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 > What do you think about this patch to require a perfect > match > when sending invoking pkill/pgrep? > > Won't work. Carefully read pgrep(1) again. >>> >>> After reading the man page again I even found something more >>> f

Re: bug in rc.subr: kills more than it should (patch)

2015-06-20 Thread Antoine Jacoutot
On Sat, Jun 20, 2015 at 09:44:14PM +0200, nusenu wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > > What do you think about this patch to require a perfect > > match > > when sending invoking pkill/pgrep? > > > > Won't work. Carefully read pgrep(1) again. > >

Re: bug in rc.subr: kills more than it should (patch)

2015-06-20 Thread Antoine Jacoutot
On Sat, Jun 20, 2015 at 03:33:20PM +0200, nusenu wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > >>> imagine you have N services named: > >>> > >>> service service1 service2 ... > >>> > >>> Now you want to stop 'service' and you run: 'rcctl stop > >>> service' > >>> > >>> all (no

Re: bug in rc.subr: kills more than it should (patch)

2015-06-20 Thread nusenu
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 >>> imagine you have N services named: >>> >>> service service1 service2 ... >>> >>> Now you want to stop 'service' and you run: 'rcctl stop >>> service' >>> >>> all (not just one) of them are gone? >>> >>> >>> rc.subr invokes pkill and does a "

Re: bug in rc.subr: kills more than it should (patch)

2015-06-16 Thread Antoine Jacoutot
On Tue, Jun 16, 2015 at 10:30:40PM +0200, Antoine Jacoutot wrote: > On Tue, Jun 16, 2015 at 07:38:28PM +, nusenu wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA512 > > > > Hi, > > > > imagine you have N services named: > > > > service > > service1 > > service2 > > ... > > > > or

Re: bug in rc.subr: kills more than it should (patch)

2015-06-16 Thread Antoine Jacoutot
On Tue, Jun 16, 2015 at 07:38:28PM +, nusenu wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > Hi, > > imagine you have N services named: > > service > service1 > service2 > ... > > or > a > ab > abc > ... > > Now you want to stop 'service' and you run: > 'rcctl stop service'

bug in rc.subr: kills more than it should (patch)

2015-06-16 Thread nusenu
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hi, imagine you have N services named: service service1 service2 ... or a ab abc ... Now you want to stop 'service' and you run: 'rcctl stop service' all (not just one) of them are gone? rc.subr invokes pkill and does a "startswith" match but