On Mon, Mar 11, 2019 at 06:12:06PM +0000, Dmitry Bogatov wrote:

> > On Fri, Mar 08, 2019 at 02:39:47PM +0000, Dmitry Bogatov wrote:
> > > [2019-03-07 12:57] Andras Korn <korn-debb...@elan.rulez.org>
> > > > part 1     text/plain                 218
> > > > Sorry, I sent an earlier version of the patch by mistake.
> > > >
> > > > I'm attaching the correct one, which I tested and which works for me.
> > > > [...]
> > > > -      if (sigc && (stat(STOPIT, &s) != -1) && (s.st_mode & S_IXUSR)) {
> > > > +      if ((sigp) || (sigc && (stat(STOPIT, &s) != -1) && (s.st_mode & 
> > > > S_IXUSR))) {
> > > 
> > > As far as I can tell by glance on patch, you want SIGPWR trigger reboot.
> > > If so, why don't you create REBOOT file in, say, /etc/rc.local and make
> > > lxc controller to send SIGCONT?
> >
> > No -- I want SIGPWR to trigger a halt.
> >
> > For the purposes of LXC, any signal will do; I just need for a signal to
> > trigger a shutdown regardless of the permissions on runit.stopit and
> > runit.reboot.
> 
> Halt. Fine. But why can't you pre-provision you container with apporiate
> `stop.*' file with apporiate permissions?

Because that adds complexity elsewhere -- /etc/runit/1 as shipped creates
/run/runit.stopit with mode 0, so either all containers would need ot have a
custom /etc/runit/1, or run a custom script to chmod 100 /run/runit.stopit
on every boot, or have an immutable /run/runit.stopit.

It's not just about me; this affects everyone who wants to use runit inside
an lxc container.

My goal is to make using runit as hassle-free as possible, without
sacrificing any of its core values.

> > > By the way, SIGPWR is not in POSIX, according to signal(7).
> >
> > You're right; in that case, maybe we can use SIGQUIT?
> 
> SIGTERM feels better, imho. TERM is graceful termination, while SIGQUIT
> creates coredump. By default.

SIGPWR would be nice to use as the halt signal because it's the lxc default,
so that runit could be a drop-in replacement for sysvinit in LXC containers.

If we're not going to use SIGPWR it's pretty much all the same which signal
we use, because it will need to be configured explicitly in LXC (but that's
acceptable -- POSIX is important enough).

> But this naming only matters if you explain to me, how solution not
> involving changing C code does not suffice. Two lines for convenience in
> this case, three there -- and we all know where it ends.

I'm sorry, I don't buy the slippery slope argument. I'm not adding a DNS
resolver, a DHCP client or a QR encoder, merely making the user interface a
tiny bit more similar to sysvinit's, to make integration easier. This is
entirely in line with The Unix Way: making one program a drop-in replacement
for another such that other programs interfacing with them don't see a
difference unless they need to. It's why bzip2 and gzip take most of the
same switches etc.

Since you apparently don't agree that this is a good idea, should I take the
patch to Gerrit instead?

AndrĂ¡s

-- 
Warranty is void in case of nuclear war, whether caused by the program or not.

Reply via email to