vpsfreecz / vpsadminos

Host for Linux system containers based on NixOS, ZFS and LXC
https://vpsadminos.org
MIT License
161 stars 27 forks source link

Handle graceful stop of void linux with runit #39

Closed aither64 closed 3 years ago

aither64 commented 4 years ago

LXC shuts down containers by signaling the init system, but that won't work on runit in void. We'll probably have to use exec instead of signal and run runit-init 0 as the manpage describes it:

init 0 tells the Unix process no 1 to shutdown and halt the system. To signal runit(8) the system halt request, runit-init removes all permissions of the file /etc/runit/reboot (chmod 0), and sets the execute by owner permission of the file /etc/runit/stopit (chmod 100). Then a CONT signal is sent to runit(8).

There doesn't seem to a be a way for graceful shutdown without touching files inside the container.

aither64 commented 4 years ago

Not an issue anymore, void itself creates /etc/runit/stopit with the correct permission and graceful shutdown works.

aither64 commented 3 years ago

Still a problem. The file exists but does not have 0100 set.

aither64 commented 3 years ago

Fixed by 39bbe7cafa48fda9743e1a1a22f022bef6afd2da.