* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
@ 2020-03-15 14:30 ` Duncaen
2020-03-15 14:39 ` leahneukirchen
` (18 subsequent siblings)
19 siblings, 0 replies; 20+ messages in thread
From: Duncaen @ 2020-03-15 14:30 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 429 bytes --]
New comment by Duncaen on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-599217657
Comment:
That it doesn't write to the selfpipe seems wrong.
I don't like how this changes the behavior of the stopit file and that this signal can't be disabled or even better optionally enabled by i.e. creating a new file like `/etc/runit/sigpwr` which is checked similar to the STOPIT checks.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
2020-03-15 14:30 ` runit: add support for SIGPWR signal Duncaen
@ 2020-03-15 14:39 ` leahneukirchen
2020-03-15 15:24 ` innerspacepilot
` (17 subsequent siblings)
19 siblings, 0 replies; 20+ messages in thread
From: leahneukirchen @ 2020-03-15 14:39 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 340 bytes --]
New comment by leahneukirchen on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-599218821
Comment:
I'd recommend using Debian's `0013-Shutdown-when-runit-init-receices-SIGPWR.patch`. It is still not configurable, but I think it makes sense. Some USP also send SIGPWR when power gets too low.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
2020-03-15 14:30 ` runit: add support for SIGPWR signal Duncaen
2020-03-15 14:39 ` leahneukirchen
@ 2020-03-15 15:24 ` innerspacepilot
2020-03-15 17:59 ` Duncaen
` (16 subsequent siblings)
19 siblings, 0 replies; 20+ messages in thread
From: innerspacepilot @ 2020-03-15 15:24 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 646 bytes --]
New comment by innerspacepilot on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-599224575
Comment:
Oh well, If I only knew that the patch already exists :(
So, there is no significant differences between patches.
Yep, 0013-Shutdown-when-runit-init-receices-SIGPWR.patch looks better than mine (mine is working anyway).
SIGPWR is sent to init (process 1) directly, so no need to create any files (like stopit). Runit also reboots on getting SIGCONT (it is also not configurable)
@leahneukirchen can you find any UPS daemon that sends sigpwr to init? (seems like it was very loooong time ago)
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
` (2 preceding siblings ...)
2020-03-15 15:24 ` innerspacepilot
@ 2020-03-15 17:59 ` Duncaen
2020-03-15 18:00 ` Duncaen
` (15 subsequent siblings)
19 siblings, 0 replies; 20+ messages in thread
From: Duncaen @ 2020-03-15 17:59 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 525 bytes --]
New comment by Duncaen on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-599243492
Comment:
> SIGPWR is sent to init (process 1) directly, so no need to create any files (like stopit). Runit also reboots on getting SIGCONT (it is also not configurable)
Its configurable through the `/etc/runit/stopit` file. If the file doesn't exist or is not `S_IXUSR`, then runit won't shutdown.
This makes sure only `runit-init 0` can bring down runit, not a random SIGCONT or SIGINT.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
` (3 preceding siblings ...)
2020-03-15 17:59 ` Duncaen
@ 2020-03-15 18:00 ` Duncaen
2020-03-15 18:00 ` Duncaen
` (14 subsequent siblings)
19 siblings, 0 replies; 20+ messages in thread
From: Duncaen @ 2020-03-15 18:00 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 625 bytes --]
New comment by Duncaen on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-599243492
Comment:
> SIGPWR is sent to init (process 1) directly, so no need to create any files (like stopit). Runit also reboots on getting SIGCONT (it is also not configurable)
Its configurable through the `/etc/runit/stopit` file. If the file doesn't exist or is not `S_IXUSR`, then runit won't shutdown.
This makes sure only `runit-init 0` can bring down runit, not a random SIGCONT or SIGINT.
Edit: this is as far as I know, the whole deal about `stopit`, otherwise only `reboot` would exist.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
` (4 preceding siblings ...)
2020-03-15 18:00 ` Duncaen
@ 2020-03-15 18:00 ` Duncaen
2020-03-15 18:00 ` Duncaen
` (13 subsequent siblings)
19 siblings, 0 replies; 20+ messages in thread
From: Duncaen @ 2020-03-15 18:00 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 627 bytes --]
New comment by Duncaen on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-599243492
Comment:
> SIGPWR is sent to init (process 1) directly, so no need to create any files (like stopit). Runit also reboots on getting SIGCONT (it is also not configurable)
Its configurable through the `/etc/runit/stopit` file. If the file doesn't exist or is not `S_IXUSR`, then runit won't shutdown.
This makes sure only `runit-init 0` can bring down runit, not a random SIGCONT or SIGINT.
Edit: this is as far as I know, the whole deal about `stopit`, otherwise only `reboot` would exist.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
` (5 preceding siblings ...)
2020-03-15 18:00 ` Duncaen
@ 2020-03-15 18:00 ` Duncaen
2020-03-15 18:00 ` Duncaen
` (12 subsequent siblings)
19 siblings, 0 replies; 20+ messages in thread
From: Duncaen @ 2020-03-15 18:00 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 626 bytes --]
New comment by Duncaen on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-599243492
Comment:
> SIGPWR is sent to init (process 1) directly, so no need to create any files (like stopit). Runit also reboots on getting SIGCONT (it is also not configurable)
Its configurable through the `/etc/runit/stopit` file. If the file doesn't exist or is not `S_IXUSR`, then runit won't shutdown.
This makes sure only `runit-init 0` can bring down runit, not a random SIGCONT or SIGINT.
Edit: this is as far as I know the whole deal about `stopit`, otherwise only `reboot` would exist.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
` (6 preceding siblings ...)
2020-03-15 18:00 ` Duncaen
@ 2020-03-15 18:00 ` Duncaen
2020-03-15 18:07 ` Duncaen
` (11 subsequent siblings)
19 siblings, 0 replies; 20+ messages in thread
From: Duncaen @ 2020-03-15 18:00 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 630 bytes --]
New comment by Duncaen on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-599243492
Comment:
> SIGPWR is sent to init (process 1) directly, so no need to create any files (like stopit). Runit also reboots on getting SIGCONT (it is also not configurable)
Its configurable through the `/etc/runit/stopit` file. If the file doesn't exist or is not `S_IXUSR`, then runit won't shutdown.
This makes sure only `runit-init 0` can bring down runit, not a random `SIGCONT` or `SIGINT`.
Edit: this is as far as I know the whole deal about `stopit`, otherwise only `reboot` would exist.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
` (7 preceding siblings ...)
2020-03-15 18:00 ` Duncaen
@ 2020-03-15 18:07 ` Duncaen
2020-03-15 18:12 ` Duncaen
` (10 subsequent siblings)
19 siblings, 0 replies; 20+ messages in thread
From: Duncaen @ 2020-03-15 18:07 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 580 bytes --]
New comment by Duncaen on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-599244373
Comment:
```diff
- if ((sigp) || (sigc && (stat(STOPIT, &s) != -1) && (s.st_mode & S_IXUSR))) {
+ if ((sigc || sigp) && (stat(STOPIT, &s) != -1) && (s.st_mode & S_IXUSR))) {
```
If we change the diff like this, on Void Linux the default would be to do the shutdown, as `stopit`
is created on boot (which is another issue, but its easy to remove from `/etc/rc.local`):
```
/etc/runit/1:install -m100 /dev/null /run/runit/stopit
```
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
` (8 preceding siblings ...)
2020-03-15 18:07 ` Duncaen
@ 2020-03-15 18:12 ` Duncaen
2020-03-16 8:00 ` innerspacepilot
` (9 subsequent siblings)
19 siblings, 0 replies; 20+ messages in thread
From: Duncaen @ 2020-03-15 18:12 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 579 bytes --]
New comment by Duncaen on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-599244373
Comment:
```diff
- if ((sigp) || (sigc && (stat(STOPIT, &s) != -1) && (s.st_mode & S_IXUSR))) {
+ if ((sigc || sigp) && (stat(STOPIT, &s) != -1) && (s.st_mode & S_IXUSR)) {
```
If we change the diff like this, on Void Linux the default would be to do the shutdown, as `stopit`
is created on boot (which is another issue, but its easy to remove from `/etc/rc.local`):
```
/etc/runit/1:install -m100 /dev/null /run/runit/stopit
```
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
` (9 preceding siblings ...)
2020-03-15 18:12 ` Duncaen
@ 2020-03-16 8:00 ` innerspacepilot
2020-03-16 8:17 ` innerspacepilot
` (8 subsequent siblings)
19 siblings, 0 replies; 20+ messages in thread
From: innerspacepilot @ 2020-03-16 8:00 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 265 bytes --]
New comment by innerspacepilot on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-599395364
Comment:
@Duncaen Do you need this as a quick fix for users if something goes wrong?
I am going to switch to debian's patch
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
` (10 preceding siblings ...)
2020-03-16 8:00 ` innerspacepilot
@ 2020-03-16 8:17 ` innerspacepilot
2020-03-16 9:40 ` innerspacepilot
` (7 subsequent siblings)
19 siblings, 0 replies; 20+ messages in thread
From: innerspacepilot @ 2020-03-16 8:17 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 227 bytes --]
New comment by innerspacepilot on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-599395364
Comment:
@Duncaen Do you need this as a quick fix for users if something goes wrong?
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
` (11 preceding siblings ...)
2020-03-16 8:17 ` innerspacepilot
@ 2020-03-16 9:40 ` innerspacepilot
2020-03-18 12:26 ` xtraeme
` (6 subsequent siblings)
19 siblings, 0 replies; 20+ messages in thread
From: innerspacepilot @ 2020-03-16 9:40 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 232 bytes --]
New comment by innerspacepilot on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-599437065
Comment:
updated patch with stuff from debian
included fix from @Duncaen. Seems reasonable.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
` (12 preceding siblings ...)
2020-03-16 9:40 ` innerspacepilot
@ 2020-03-18 12:26 ` xtraeme
2020-03-19 13:23 ` Gottox
` (5 subsequent siblings)
19 siblings, 0 replies; 20+ messages in thread
From: xtraeme @ 2020-03-18 12:26 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 180 bytes --]
New comment by xtraeme on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-600593120
Comment:
@void-linux/pkg-committers any comment?
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
` (13 preceding siblings ...)
2020-03-18 12:26 ` xtraeme
@ 2020-03-19 13:23 ` Gottox
2020-03-19 13:50 ` Duncaen
` (4 subsequent siblings)
19 siblings, 0 replies; 20+ messages in thread
From: Gottox @ 2020-03-19 13:23 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 196 bytes --]
New comment by Gottox on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-601175124
Comment:
I haven't done in depth testing, but it look reasonable.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
` (14 preceding siblings ...)
2020-03-19 13:23 ` Gottox
@ 2020-03-19 13:50 ` Duncaen
2020-03-19 13:51 ` Duncaen
` (3 subsequent siblings)
19 siblings, 0 replies; 20+ messages in thread
From: Duncaen @ 2020-03-19 13:50 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 894 bytes --]
New comment by Duncaen on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-601189877
Comment:
I'm not completely happy with it, I would like to have a mechanism to completely disable sigpwr for non containers and users who may run a UPS that sends sigpwr but don't want this to shutdown the system or handle in some other way.
This also requires man page updates, we shouldn't just change how init behaves when it is signaled without documenting it, and considering edge cases.
I would add `/etc/runit/sigpwr` which is checked for for existence and executable bit.
Create it from our core services, and `chmod u+x` it if it is a "container" system.
This would not change anything for normal users, introduce the wanted behavior for "containers" and allows users with USPs that send a signal to pid 1 to enable it by `chmod u+x` the file.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
` (15 preceding siblings ...)
2020-03-19 13:50 ` Duncaen
@ 2020-03-19 13:51 ` Duncaen
2020-03-19 13:54 ` xtraeme
` (2 subsequent siblings)
19 siblings, 0 replies; 20+ messages in thread
From: Duncaen @ 2020-03-19 13:51 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 893 bytes --]
New comment by Duncaen on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-601189877
Comment:
I'm not completely happy with it, I would like to have a mechanism to completely disable sigpwr for non containers and users who may run a UPS that sends sigpwr but don't want this to shutdown the system or handle in some other way.
This also requires man page updates, we shouldn't just change how init behaves when it is signaled without documenting it and considering edge cases.
I would add `/etc/runit/sigpwr` which is checked for for existence and executable bit.
Create it from our core services, and `chmod u+x` it if it is a "container" system.
This would not change anything for normal users, introduce the wanted behavior for "containers" and allows users with USPs that send a signal to pid 1 to enable it by `chmod u+x` the file.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
` (16 preceding siblings ...)
2020-03-19 13:51 ` Duncaen
@ 2020-03-19 13:54 ` xtraeme
2020-03-20 6:50 ` innerspacepilot
2020-03-20 6:50 ` [PR PATCH] [Closed]: " innerspacepilot
19 siblings, 0 replies; 20+ messages in thread
From: xtraeme @ 2020-03-19 13:54 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 178 bytes --]
New comment by xtraeme on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-601192122
Comment:
@Duncaen I agree with your suggestion
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
` (17 preceding siblings ...)
2020-03-19 13:54 ` xtraeme
@ 2020-03-20 6:50 ` innerspacepilot
2020-03-20 6:50 ` [PR PATCH] [Closed]: " innerspacepilot
19 siblings, 0 replies; 20+ messages in thread
From: innerspacepilot @ 2020-03-20 6:50 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 176 bytes --]
New comment by innerspacepilot on void-packages repository
https://github.com/void-linux/void-packages/pull/20098#issuecomment-601558862
Comment:
Well, that's your decision.
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: [PR PATCH] [Closed]: runit: add support for SIGPWR signal
[not found] <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-20098@inbox.vuxu.org>
` (18 preceding siblings ...)
2020-03-20 6:50 ` innerspacepilot
@ 2020-03-20 6:50 ` innerspacepilot
19 siblings, 0 replies; 20+ messages in thread
From: innerspacepilot @ 2020-03-20 6:50 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 657 bytes --]
There's a closed pull request on the void-packages repository
runit: add support for SIGPWR signal
https://github.com/void-linux/void-packages/pull/20098
Description:
Hello!
This patch adds support for SIGPWR signal for runit. On receiving this signal runit gracefully shuts down machine.
This is needed for LXD containers running runit to shut down properly without any need for special configuration.
Seems like nothing else sends SIGPWR to process 0, so there should be no impact on normal operation, but some sort of testing should be done.
There was a huge conversation about it [here](https://www.mail-archive.com/supervision@list.skarnet.org/)
^ permalink raw reply [flat|nested] 20+ messages in thread