On Fri, Mar 08, 2019 at 02:39:47PM +0000, Dmitry Bogatov wrote: Hi,
> [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. > By the way, SIGPWR is not in POSIX, according to signal(7). You're right; in that case, maybe we can use SIGQUIT? I suppose the other option is to wrap all changes in #ifdefs so the new bits are only built on Linux (since it's currently only relevant for Linux, this might be appropriate), but I think that would make the code disproportionately ugly. AndrĂ¡s -- How to lose a guy in 10 days? Buy him a computer.