Re: Generic interrupt command?

2019-02-10 Thread Laurent Bercot
That's a tough call. On the one hand, it makes simple constructs safer. On the other, it adds complexity to interpreting the data programmatically ( the test / [ program errors for integer comparisons with text, and using scanf() to pull in the values for libc style programs wouldn't be so

Re: Generic interrupt command?

2019-02-09 Thread John O'Meara
On Tue, Feb 5, 2019, 2:30 PM Laurent Bercot >Not outputting anything causes kill (on my system at least) to exit non > >0 > > Not outputting anything isn't an option, for the case where -o pid is > used in addition to other fields. The field number and order must be > respected. > Agreed; I

Re: Generic interrupt command?

2019-02-05 Thread Laurent Bercot
Not outputting anything causes kill (on my system at least) to exit non 0 Not outputting anything isn't an option, for the case where -o pid is used in addition to other fields. The field number and order must be respected. It's probably best to use some OOB indicator. How about NA, which I

Re: Generic interrupt command?

2019-02-05 Thread John O'Meara
On Tue, Feb 5, 2019, 2:20 AM Laurent Bercot wrote: > >Be careful, though. If the service is down, kill will use -1 for the PID, > >and will probably signal everything in your system except PID 1. > > That's a good point. Should s6-svstat use 0 as the "service is down" > pid value instead, to

Re: Generic interrupt command?

2019-02-04 Thread Laurent Bercot
Be careful, though. If the service is down, kill will use -1 for the PID, and will probably signal everything in your system except PID 1. That's a good point. Should s6-svstat use 0 as the "service is down" pid value instead, to avoid this ? -- Laurent

Re: Generic interrupt command?

2019-02-04 Thread Roger Pate
On Mon, Feb 4, 2019 at 10:09 PM John O'Meara wrote: > On Sat, Feb 2, 2019, 4:40 PM Steve Litt wrote: >> On Sat, 2 Feb 2019 21:08:10 + Colin Booth wrote: >>> s6-svstat -p /path/to/service | xargs kill SIGNAL >> >> Cool. That's all that's needed. > > Be careful, though. If the service is

Re: Generic interrupt command?

2019-02-04 Thread John O'Meara
On Sat, Feb 2, 2019, 4:40 PM Steve Litt wrote: > On Sat, 2 Feb 2019 21:08:10 + > Colin Booth wrote: > > > s6-svstat -p /path/to/service | xargs kill SIGNAL > > > > Cool. That's all that's needed. > > SteveT > -- > Be careful, though. If the service is down, kill will use -1 for the PID,

Re: Generic interrupt command?

2019-02-02 Thread Jonathan de Boyne Pollard
Colin Booth: As documented here: https://www.skarnet.org/software/s6/s6-svstat.html s6-svstat -p /path/to/service | xargs kill SIGNAL You can thank Jos Backus for similar functionality in the nosh toolset since 2013, with program-readable output that one can use existing tools to pull

Re: Generic interrupt command?

2019-02-02 Thread Colin Booth
On Sat, Feb 02, 2019 at 02:30:14PM -0500, Steve Litt wrote: > On Sat, 02 Feb 2019 09:07:31 + > "Laurent Bercot" wrote: > > > kill -s SIGKILL `sv pid agetty-tty6` > > > I don't know if

Re: Generic interrupt command?

2019-02-02 Thread Laurent Bercot
I think a cool addition to runit program sv and s6's s6-svc would be a command to send an arbitrary signal to the daemon being supervised. Yes, that would be a nice feature. I've been thinking about it for some time. Unfortunately, that's not at all suited to the way the control program

Generic interrupt command?

2019-02-01 Thread Steve Litt
Hi all, I think a cool addition to runit program sv and s6's s6-svc would be a command to send an arbitrary signal to the daemon being supervised. Let's say a -z was added as an arg to s6-svc or a "genericinterrupt" was added as an arg to sv. Now you could say: sv genericinterrupt SIGIO