How to poweroff when there's no systemd/init (e.g. using init=/bin/bash)?
up vote
4
down vote
favorite
poweroff
complains that it can't connect to systemd via DBus (of course, it's not alive). I did sync
followed by kill $$
, thinking that pid 1 dying would cue the kernel to poweroff, but that caused a kernel panic. I then held the power button to force the poweroff.
What's the most proper way to power-off in this scenario?
linux systemd power-management
add a comment |
up vote
4
down vote
favorite
poweroff
complains that it can't connect to systemd via DBus (of course, it's not alive). I did sync
followed by kill $$
, thinking that pid 1 dying would cue the kernel to poweroff, but that caused a kernel panic. I then held the power button to force the poweroff.
What's the most proper way to power-off in this scenario?
linux systemd power-management
add a comment |
up vote
4
down vote
favorite
up vote
4
down vote
favorite
poweroff
complains that it can't connect to systemd via DBus (of course, it's not alive). I did sync
followed by kill $$
, thinking that pid 1 dying would cue the kernel to poweroff, but that caused a kernel panic. I then held the power button to force the poweroff.
What's the most proper way to power-off in this scenario?
linux systemd power-management
poweroff
complains that it can't connect to systemd via DBus (of course, it's not alive). I did sync
followed by kill $$
, thinking that pid 1 dying would cue the kernel to poweroff, but that caused a kernel panic. I then held the power button to force the poweroff.
What's the most proper way to power-off in this scenario?
linux systemd power-management
linux systemd power-management
asked 3 hours ago
JoL
85039
85039
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
up vote
4
down vote
- Unmount the filesystems that you had mounted. The root filesystem is a special case; for this you can use
mount / -o remount,ro
.umount /
also happens to work on Linux, because it is effectively converted to the former command. poweroff -f
The systemd
-specific equivalent of poweroff -f
is systemctl poweroff -f -f
.
That said, you don't need to worry about it too much, unless
- You have mounted an old filesystem like FAT - as used by the EFI system partition - or ext2, which does not implement journalling or equivalent. With a modern filesystem,
sync
is supposed to be enough, and the filesystem will recover quickly on the next boot. - or you might have left a running process that writes to the filesystem, and you had intended to shut it down cleanly. In that case it's useful to umount the filesystems, because it will show a busy error to remind you about the remaining writer.
Just so you know, I'm not forgetting to accept. It's just that I've seen the advice to wait some time before accepting an answer to let others (maybe in different timezones) see the question and have the chance to provide their own answers.
– JoL
2 hours ago
add a comment |
up vote
2
down vote
Ok, so it just occurred to me that I had the option to exec init
. From there, I would probably be able to later poweroff
. I wonder if there are better alternatives, though.
@G-Man won't it start the normal boot process and give you your normal shell eventually?
– muru
1 hour ago
Hmmm. Yeah, I guess so.
– G-Man
1 hour ago
add a comment |
up vote
0
down vote
#exec /sbin/init
is what I use when I can't use "init 0" or any init command which is usually in single user mode to change root passwd.
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
- Unmount the filesystems that you had mounted. The root filesystem is a special case; for this you can use
mount / -o remount,ro
.umount /
also happens to work on Linux, because it is effectively converted to the former command. poweroff -f
The systemd
-specific equivalent of poweroff -f
is systemctl poweroff -f -f
.
That said, you don't need to worry about it too much, unless
- You have mounted an old filesystem like FAT - as used by the EFI system partition - or ext2, which does not implement journalling or equivalent. With a modern filesystem,
sync
is supposed to be enough, and the filesystem will recover quickly on the next boot. - or you might have left a running process that writes to the filesystem, and you had intended to shut it down cleanly. In that case it's useful to umount the filesystems, because it will show a busy error to remind you about the remaining writer.
Just so you know, I'm not forgetting to accept. It's just that I've seen the advice to wait some time before accepting an answer to let others (maybe in different timezones) see the question and have the chance to provide their own answers.
– JoL
2 hours ago
add a comment |
up vote
4
down vote
- Unmount the filesystems that you had mounted. The root filesystem is a special case; for this you can use
mount / -o remount,ro
.umount /
also happens to work on Linux, because it is effectively converted to the former command. poweroff -f
The systemd
-specific equivalent of poweroff -f
is systemctl poweroff -f -f
.
That said, you don't need to worry about it too much, unless
- You have mounted an old filesystem like FAT - as used by the EFI system partition - or ext2, which does not implement journalling or equivalent. With a modern filesystem,
sync
is supposed to be enough, and the filesystem will recover quickly on the next boot. - or you might have left a running process that writes to the filesystem, and you had intended to shut it down cleanly. In that case it's useful to umount the filesystems, because it will show a busy error to remind you about the remaining writer.
Just so you know, I'm not forgetting to accept. It's just that I've seen the advice to wait some time before accepting an answer to let others (maybe in different timezones) see the question and have the chance to provide their own answers.
– JoL
2 hours ago
add a comment |
up vote
4
down vote
up vote
4
down vote
- Unmount the filesystems that you had mounted. The root filesystem is a special case; for this you can use
mount / -o remount,ro
.umount /
also happens to work on Linux, because it is effectively converted to the former command. poweroff -f
The systemd
-specific equivalent of poweroff -f
is systemctl poweroff -f -f
.
That said, you don't need to worry about it too much, unless
- You have mounted an old filesystem like FAT - as used by the EFI system partition - or ext2, which does not implement journalling or equivalent. With a modern filesystem,
sync
is supposed to be enough, and the filesystem will recover quickly on the next boot. - or you might have left a running process that writes to the filesystem, and you had intended to shut it down cleanly. In that case it's useful to umount the filesystems, because it will show a busy error to remind you about the remaining writer.
- Unmount the filesystems that you had mounted. The root filesystem is a special case; for this you can use
mount / -o remount,ro
.umount /
also happens to work on Linux, because it is effectively converted to the former command. poweroff -f
The systemd
-specific equivalent of poweroff -f
is systemctl poweroff -f -f
.
That said, you don't need to worry about it too much, unless
- You have mounted an old filesystem like FAT - as used by the EFI system partition - or ext2, which does not implement journalling or equivalent. With a modern filesystem,
sync
is supposed to be enough, and the filesystem will recover quickly on the next boot. - or you might have left a running process that writes to the filesystem, and you had intended to shut it down cleanly. In that case it's useful to umount the filesystems, because it will show a busy error to remind you about the remaining writer.
edited 3 hours ago
answered 3 hours ago
sourcejedi
22.3k43398
22.3k43398
Just so you know, I'm not forgetting to accept. It's just that I've seen the advice to wait some time before accepting an answer to let others (maybe in different timezones) see the question and have the chance to provide their own answers.
– JoL
2 hours ago
add a comment |
Just so you know, I'm not forgetting to accept. It's just that I've seen the advice to wait some time before accepting an answer to let others (maybe in different timezones) see the question and have the chance to provide their own answers.
– JoL
2 hours ago
Just so you know, I'm not forgetting to accept. It's just that I've seen the advice to wait some time before accepting an answer to let others (maybe in different timezones) see the question and have the chance to provide their own answers.
– JoL
2 hours ago
Just so you know, I'm not forgetting to accept. It's just that I've seen the advice to wait some time before accepting an answer to let others (maybe in different timezones) see the question and have the chance to provide their own answers.
– JoL
2 hours ago
add a comment |
up vote
2
down vote
Ok, so it just occurred to me that I had the option to exec init
. From there, I would probably be able to later poweroff
. I wonder if there are better alternatives, though.
@G-Man won't it start the normal boot process and give you your normal shell eventually?
– muru
1 hour ago
Hmmm. Yeah, I guess so.
– G-Man
1 hour ago
add a comment |
up vote
2
down vote
Ok, so it just occurred to me that I had the option to exec init
. From there, I would probably be able to later poweroff
. I wonder if there are better alternatives, though.
@G-Man won't it start the normal boot process and give you your normal shell eventually?
– muru
1 hour ago
Hmmm. Yeah, I guess so.
– G-Man
1 hour ago
add a comment |
up vote
2
down vote
up vote
2
down vote
Ok, so it just occurred to me that I had the option to exec init
. From there, I would probably be able to later poweroff
. I wonder if there are better alternatives, though.
Ok, so it just occurred to me that I had the option to exec init
. From there, I would probably be able to later poweroff
. I wonder if there are better alternatives, though.
answered 3 hours ago
JoL
85039
85039
@G-Man won't it start the normal boot process and give you your normal shell eventually?
– muru
1 hour ago
Hmmm. Yeah, I guess so.
– G-Man
1 hour ago
add a comment |
@G-Man won't it start the normal boot process and give you your normal shell eventually?
– muru
1 hour ago
Hmmm. Yeah, I guess so.
– G-Man
1 hour ago
@G-Man won't it start the normal boot process and give you your normal shell eventually?
– muru
1 hour ago
@G-Man won't it start the normal boot process and give you your normal shell eventually?
– muru
1 hour ago
Hmmm. Yeah, I guess so.
– G-Man
1 hour ago
Hmmm. Yeah, I guess so.
– G-Man
1 hour ago
add a comment |
up vote
0
down vote
#exec /sbin/init
is what I use when I can't use "init 0" or any init command which is usually in single user mode to change root passwd.
add a comment |
up vote
0
down vote
#exec /sbin/init
is what I use when I can't use "init 0" or any init command which is usually in single user mode to change root passwd.
add a comment |
up vote
0
down vote
up vote
0
down vote
#exec /sbin/init
is what I use when I can't use "init 0" or any init command which is usually in single user mode to change root passwd.
#exec /sbin/init
is what I use when I can't use "init 0" or any init command which is usually in single user mode to change root passwd.
answered 56 mins ago
Calvin Dike
112
112
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f487238%2fhow-to-poweroff-when-theres-no-systemd-init-e-g-using-init-bin-bash%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown