Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
"shutdown -h now" does not function
"shutdown -h now" does not function
I had a laptop running Debian 9. When shutting down the system, I would just run "shutdown -h now".
I recently upgraded to Debian 10 due to some library requirements for software.
Now however "shutdown -h now" does not function.
When I run the command, the laptop looks like it turns off, but when I hit the power button to turn it back on, it just shows a black screen.
In order to get my laptop started again, I have to take the battery out and put it back in. Then when I press the power button it turns on correctly. When it then boots, it tells me the filesystem wasn't unmounted cleanly so I know the shutdown command isn't actually working.
I recently upgraded to Debian 10 due to some library requirements for software.
Now however "shutdown -h now" does not function.
When I run the command, the laptop looks like it turns off, but when I hit the power button to turn it back on, it just shows a black screen.
In order to get my laptop started again, I have to take the battery out and put it back in. Then when I press the power button it turns on correctly. When it then boots, it tells me the filesystem wasn't unmounted cleanly so I know the shutdown command isn't actually working.
Re: "shutdown -h now" does not function
Did you try this:or
Code: Select all
systemctl poweroff
systemctl poweroff -f
systemctl poweroff -ff
Code: Select all
/sbin/halt
Re: "shutdown -h now" does not function
Code: Select all
systemctl poweroff
-
- Posts: 3
- Joined: 2019-11-09 13:29
Re: "shutdown -h now" does not function
I am not sure on why it would be related to the shutdown command in particular, maybe someone can explain?
Re: "shutdown -h now" does not function
Yep google can ... search used was "shudown -h now" +debian +doesn't work and the second result was this puppy. Just being a dork and razzing people.
Although google does know all if/when asked the right questions. Also just for the record I still use "sudo poweroff" to do this (in Stretch and Buster), you can see it's a symlink to the systemctl junk.
Output of above:
Same goes for "sudo reboot" too.
Other related stuff, it's cool so why not share.
Someone can also create a .bash_aliases file in their users /home directory and add aliases for this junk. ie:
alias poweroff="sudo /sbin/poweroff" same again for reboot and if you want to be extra special and uber l33t. Create a file in the sudoers.d directory. Read the read me, there's not many naming conventions but you need to follow them if you want them to work and don't want to have to fix sudo. Anyways ... say I create a file named myfile there, so it'd be, /etc/sudoers.d/myfile I actually have one called that there here's the contents.
Although google does know all if/when asked the right questions. Also just for the record I still use "sudo poweroff" to do this (in Stretch and Buster), you can see it's a symlink to the systemctl junk.
Code: Select all
ls -l /sbin/poweroff
Code: Select all
lrwxrwxrwx 1 root root 14 Aug 20 06:50 /sbin/poweroff -> /bin/systemctl
Other related stuff, it's cool so why not share.
Someone can also create a .bash_aliases file in their users /home directory and add aliases for this junk. ie:
alias poweroff="sudo /sbin/poweroff" same again for reboot and if you want to be extra special and uber l33t. Create a file in the sudoers.d directory. Read the read me, there's not many naming conventions but you need to follow them if you want them to work and don't want to have to fix sudo. Anyways ... say I create a file named myfile there, so it'd be, /etc/sudoers.d/myfile I actually have one called that there here's the contents.
The one's am talking about are the /sbin/poweroff and /sbin/reboot. This means I can run these commands w/o need of entering the password. Coupled with the bash alias I have for them, when I type "poweroff" or "reboot" in a terminal, that's what the OS does w/o passwd needed. Could also use them in a menu list item or a keybind/shortcut too.# Adding some commands I don't need to enter password to run.
yourusernamehere ALL=(ALL) NOPASSWD: /usr/local/bin/ps_mem, /sbin/poweroff, /sbin/reboot, /sbin/iw, /sbin/iwlist, /sbin/iwconfig
Most powerful FREE tech-support tool on the planet * HERE. *
Re: "shutdown -h now" does not function
Hi,
su - (with a hyphen) to su to root, then shutdown -h now
See Head_on_a_Stick's topic:
forums.debian.net/viewtopic.php?f=16&t=142973
su - (with a hyphen) to su to root, then shutdown -h now
See Head_on_a_Stick's topic:
forums.debian.net/viewtopic.php?f=16&t=142973
DebianStable
Code: Select all
$ vrms
No non-free or contrib packages installed on debian! rms would be proud.
Re: "shutdown -h now" does not function
Small summary on a problem solved 3 weeks ago. The problem was:
The only process able to correctly and safely shutdown a laptop is systemd, called by systemctl command.
You have the choice among systemctl halt or poweroff or reboot.
Do you need a root password or any other password to shutdown a laptop as user ?
Definitively and hopefully not !!
Imagine you have to provide a root password to all laptop users you have installed Debian on..... Would you really do that ????
The role of any Display Manager (like SDMM or any other) is to provide the right permissions to users for commands which should not require any "root" password.
The root cause was very likely '/usr/sbin/shutdown' alias not pointing anymore to the right command."shutdown -h now" does not function.
When I run the command, the laptop looks like it turns off, but when I hit the power button to turn it back on, it just shows a black screen.
The only process able to correctly and safely shutdown a laptop is systemd, called by systemctl command.
Code: Select all
ls -l /usr/sbin/shutdown
/usr/sbin/shutdown -> /bin/systemctl
Code: Select all
halt : Shut down and halt the system
poweroff : Shut down and power-off the system
reboot : Shut down and reboot the system
Definitively and hopefully not !!
Imagine you have to provide a root password to all laptop users you have installed Debian on..... Would you really do that ????
The role of any Display Manager (like SDMM or any other) is to provide the right permissions to users for commands which should not require any "root" password.
Re: "shutdown -h now" does not function
It's all easily enough dealt with, all well documented with more clear examples around than someone could need. It's gnu/Nix as such can be 40 diff ways to do whatever(all can even be approved and all work well too.) In my case I don't use a display manager, don't use a DE either (Openbox) nor xfce power-manager plugin thingy etc etc etc. All of which and many other ways no doubt would enable user to poweroff/reboot w/o password. The method outlined above is just the way I've come to prefer doing it, that's the bottom-line a preference and yep, for obvious reason "sudo poweroff" no alias ... or as shown above alias poweroff (no passwd or sudo appended required) makes much more sense to me than typing "shutdown -h now". Plus of course is totally approved and assume that backwards compatibility will remain included in systemd indefinitely.
If/when it ever does change, would take all of 5mins or less to adapt sudoers.d file and .bash_aliases to be whatever an end-user prefers to do those same things shutdown/reboot/suspend or hibernate a system.
If/when it ever does change, would take all of 5mins or less to adapt sudoers.d file and .bash_aliases to be whatever an end-user prefers to do those same things shutdown/reboot/suspend or hibernate a system.
Last edited by Deb-fan on 2019-11-10 14:46, edited 1 time in total.
Most powerful FREE tech-support tool on the planet * HERE. *
Re: "shutdown -h now" does not function
Always very long phrasing..., but would you take less than 30 sec to understand that poweroff process is not managed by any "sudo", but by systemctl through policykit.Deb-fan wrote:would take all of 5mins or less to adapt sudoers.d file and .bash_aliases
https://wiki.debian.org/UserShutdown
Last edited by L_V on 2019-11-11 07:35, edited 2 times in total.
Re: "shutdown -h now" does not function
Lol and if you'd take a sec to read the first couple lines in my first post, yep ... already noted it's linked to systemctl. Which is an intentional backwards compatibility thing folks have implemented because many folks use those cmds to poweroff and reboot.
Andddddddddd P L O N K !!!
Andddddddddd P L O N K !!!
Most powerful FREE tech-support tool on the planet * HERE. *
Re: "shutdown -h now" does not function
Simply impossible in a sec. Try it yourself. Much much too verbose and usually really difficult to catch your message or "problems" in all threads.Deb-fan wrote:Lol and if you'd take a sec to read the first couple lines in my first post
Re: "shutdown -h now" does not function
Ah no worries, I don't ever ask for help, out of 1,000's of posts, across 5-7 forums in the past 8+ yrs, maybe once and didn't get anything useful, as I'd already researched my issue exhaustively before even asking, so people provided google links, I'd already read/tried etc. As for TL:DR = too long didn't/don't read, sheesh peeps, DON'T READ MY POSTS !!! Problem easily solved. Scroll or plonk me dang !
Note2self: Must research a new and improved PLONK'ing method, javascript or summin. As otherwise desired plonks aren't in effect if someone visits a site and isn't signed into their acct. Lmao ... ah it's not that serious but definitely have come to believe liberal use of forums plonk-feature is critical. Never EVER used to do the plonk thing but that's changed radically. Ideally said plonking should detect threads started by a plonkee and remove them so they're not even seen.
Most powerful FREE tech-support tool on the planet * HERE. *
Re: "shutdown -h now" does not function
Doubles back to un-PLONK L_V ... Know english isn't your first language and I do tend to have much to say about gnu/Nix and tech. Though this is a forum meant for discussing that topic. Not very exciting when people post 2 lines about whatever. This forum is mostly on life support as it is. Would think folks would welcome some convo, shrugs. Also yep, have a certain babbling all over the place posting style but that's my way and won't change it to conform to what someone else thinks it should be.
Mentioned folks are absolutely free to not read my posts, scroll and/or slap me on ignore. Anyway group hug !? Plus no worries, will soon burn myself out on gnu/nix forum'ing and go dormant again regardless. Would join the Slackware and Gentoo + possibly the PClinuxOS forums, there's much about them (their communities)feel have mucho potential but am not giving up Debian, so due to differences between these would make meaningful interaction with the folks there somewhat tough me thinks. :/
Mentioned folks are absolutely free to not read my posts, scroll and/or slap me on ignore. Anyway group hug !? Plus no worries, will soon burn myself out on gnu/nix forum'ing and go dormant again regardless. Would join the Slackware and Gentoo + possibly the PClinuxOS forums, there's much about them (their communities)feel have mucho potential but am not giving up Debian, so due to differences between these would make meaningful interaction with the folks there somewhat tough me thinks. :/
Most powerful FREE tech-support tool on the planet * HERE. *
Re: "shutdown -h now" does not function
I often use the shutdown -h now" on my desktop system. I assume it also works on laptops too but it may malfunction here & there.-h
Equivalent to --poweroff, unless --halt is specified.
Code: Select all
user@debian:~$ shutdown -h now
bash: shutdown: command not found
Code: Select all
user@debian:~$ su
Password:
root@debian:/home/user# shutdown -h now
bash: shutdown: command not found
root@debian:/home/user# exit
exit
Code: Select all
user@debian:~$ su -
Password:
root@debian:~# shutdown -h now
DebianStable
Code: Select all
$ vrms
No non-free or contrib packages installed on debian! rms would be proud.