-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix ctrlaltdel
and 1
for stopit and reboot files
#50
Conversation
The biggest problem, to me, is that There is no reason for Note that I propose:
This should make our use of NOTE: If we're not creating |
This is now WIP, I added commits with @ahesford's changes, will need to rebase them properly before merging. I agree with the suggestions regarding how we should do it.
grepping for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be fine. I definitely would not add an INSTALL.msg
about this. It's bound to create confusion among the majority who are not relying on the existing permissions and, again, normal reboot/shutdown/ctrl-alt-del behavior should be unaffected.
Like you said, people relying on this configuration are probably knowledgeable enough to debug any changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good if they are squashed.
Squashed. |
The upstream examples all seem to create at least the stopit file on boot. Not sure if there is a good reason, I can only think of issues with creating new files in some edge cases, but not sure how relevant this is for tmpfs /run, chmodding an existing file has less ways of failing. |
So install I would prefer it if both files got configured the same way, so if |
I would either create both Even though I advocated for the on-demand scheme you put together, I don't' have strong convictions about the choice. |
The 100 permission in /run/runit/stopit made it so that signaling runit with SIGCONT would shut the system down. To achieve the correct behavior, we should create the stopit and reboot files with 000 perms, and allow their permissions to be set correctly by calls to `init 0` or `init 6` or by /etc/runit/ctrlaltdel. 1
runit uses the permissions in the /etc/runit/reboot file to determine whether it's going to perform a halt or reboot action. This conditional in 3 meant that touching the reboot file, even with 000 perms, would lead to a reboot, which goes agains what is expected according to the runit documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should do the trick. @Duncaen, are you OK with this?
/run/runit/{stopit,reboot} should have their perms set to 100 by ctrlaltdel, before runit signals itself with SIGCONT, in order to trigger a reboot. This script can be changed by a user to perform different actions. The comments in it explain what each file is for.
Fixed typo in commit message. |
Sorry to resurrect this thread, but I'm wondering what the rationale was for changing That is:
Management of containers depends on runit halting when sent SIGCONT (unless there's another way to do it that I'm missing....) |
SIGCONT is not the proper signal to shutdown a container. SIGINT should work as well. Note that you need |
Do you have a reference for this? lxc/lxc-ci#408 discusses it in a bit of detail, and it was (at least when I started using LXD with void) the only way to get |
SIGINT will trigger a reboot, which results in a shutdown of a container. You can test this easily. |
I just want to make sure we're talking about the same thing here: I'm not referring to Docker containers; I'm referring to incus containers. SIGINT indeed attempts a reboot with incus (but fails the reboot stage, so it has the effect of a shutdown, but with error logs). There is no |
Can you share the error? If it terminates, it has the appropriate capabilities, else it would hang forever. |
It's a standard incus image with the following config applied:
|
Indeed lxd doesn't seem to like that it tries to reboot. You can make ctrlaltdel not do |
The way I currently do it is to |
Fixes #47
Since the
halt
program seems to useinit
directly, I don't think anything else needs to be changed.Needs proper testing as well.
Ping @Duncaen and @leahneukirchen