SOLVED switch off power instead of "shutdown" command

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
sadhu
Level 5
Level 5
Posts: 862
Joined: Fri Nov 22, 2013 9:48 am
Location: Sri Lanka
Contact:

SOLVED switch off power instead of "shutdown" command

Post by sadhu »

See related question: viewtopic.php?f=49&t=277517

Occasionally I'm in a hurry and don't want to wait for the system to shutdown, as in clicking shutdown from the menu, or issuing 'sudo shutdown now" from the command line. It often takes longer to shut down than to boot up! I notice that after a power-off event, the system does a file system check on the next reboot, but that usually only takes a few seconds. And it still boots faster than it shuts down!

So is there any catastrophic danger to hardware, scrambled disks, fried power supplies, etc, from just switching off the UPS when I'm in a hurry to leave?

This is a single=-user system, networking goes through a dongle, and the only other server is xampp.

Thanks\
-Sadhu
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
sabbe sattā bhavantu sukhitattā. LM 21.2-64 Cinn 5.8.4
User avatar
jimallyn
Level 19
Level 19
Posts: 9075
Joined: Thu Jun 05, 2014 7:34 pm
Location: Wenatchee, WA USA

Re: switch off power instead of "shutdown" command

Post by jimallyn »

sadhu wrote: Thu Sep 13, 2018 2:40 amSo is there any catastrophic danger to hardware, scrambled disks, fried power supplies, etc, from just switching off the UPS when I'm in a hurry to leave?
Yes, there is. While Linux has features that make it less likely to be adversely affected by an improper shutdown, it is still possible that you may corrupt your disk, lose data, etc. Definitely NOT recommended.
“If the government were coming for your TVs and cars, then you'd be upset. But, as it is, they're only coming for your sons.” - Daniel Berrigan
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: switch off power instead of "shutdown" command

Post by catweazel »

sadhu wrote: Thu Sep 13, 2018 2:40 am So is there any catastrophic danger to hardware, scrambled disks, fried power supplies, etc, from just switching off the UPS when I'm in a hurry to leave?
Not if you don't care about scrambled disks and deep-fried data.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
User avatar
sadhu
Level 5
Level 5
Posts: 862
Joined: Fri Nov 22, 2013 9:48 am
Location: Sri Lanka
Contact:

Re: switch off power instead of "shutdown" command

Post by sadhu »

further question:

first, I close all open files/applications before switching off.

Second: why does it take linuxmint twice as long to shut down as to boot?

Thanks
-Sadhu
sabbe sattā bhavantu sukhitattā. LM 21.2-64 Cinn 5.8.4
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: switch off power instead of "shutdown" command

Post by catweazel »

sadhu wrote: Thu Sep 13, 2018 5:20 am Second: why does it take linuxmint twice as long to shut down as to boot?
You might inspect the logs to determine that.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
User avatar
Moem
Level 22
Level 22
Posts: 16229
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: switch off power instead of "shutdown" command

Post by Moem »

sadhu wrote: Thu Sep 13, 2018 5:20 am further question:

first, I close all open files/applications before switching off.
What's the question?
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
gm10

Re: switch off power instead of "shutdown" command

Post by gm10 »

catweazel wrote: Thu Sep 13, 2018 5:31 am You might inspect the logs to determine that.
^ that. Also if it takes a while at the shutdown logo just press Esc to see what's going on.

Mine shuts down nearly instantly.

Known culprits blocking shutdowns are the various cups daemons, whatever that script in system-config-printer was called which prevents all current Ubuntus from logging out successfully, and the gnome-keyring-daemon, for example. Either uninstall if you don't need them or add a session-cleanup-script to lightdm to kill them off manually.
User avatar
sadhu
Level 5
Level 5
Posts: 862
Joined: Fri Nov 22, 2013 9:48 am
Location: Sri Lanka
Contact:

Re: switch off power instead of "shutdown" command

Post by sadhu »

Moem wrote: Thu Sep 13, 2018 5:50 am
sadhu wrote: Thu Sep 13, 2018 5:20 am further question:

first, I close all open files/applications before switching off.
What's the question?
Is there still a danger of scrambled files if everything is closed and I'm back to the desktop?
sabbe sattā bhavantu sukhitattā. LM 21.2-64 Cinn 5.8.4
User avatar
Moem
Level 22
Level 22
Posts: 16229
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: switch off power instead of "shutdown" command

Post by Moem »

sadhu wrote: Thu Sep 13, 2018 7:16 am Is there still a danger of scrambled files if everything is closed and I'm back to the desktop?
Yes. Since the OS and the desktop environment are still running, they can be damaged by a hard shutdown.
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
User avatar
sadhu
Level 5
Level 5
Posts: 862
Joined: Fri Nov 22, 2013 9:48 am
Location: Sri Lanka
Contact:

Re: SOLVED switch off power instead of "shutdown" command

Post by sadhu »

Thanks to everyone for their helpful suggestions.

I usually shut down gracefully, but I have to wait and wait and wait until the computer turns off before I can turn off the UPS. Otherwise, the speakers, monitor and will still be drawing power and running down the UPS batteries. About once a month we get a power cut that lasts four to ten hours, so it's important to shutdown the UPS. (I live in S. Asia)

But then I did some research and found that the UPS is supposed to be able to send a signal causing the machine to shut down gracefully. That's the related question now edited onto the original post. So what I would like to do is switch off power at the wall, causing the UPS to shut down the machine, and then itself, hopefully. Then I can just walk away from it.

I will check the logs and Alt-F8 or Esc to see what's hanging up.


Thanks again.

-Sadhu
sabbe sattā bhavantu sukhitattā. LM 21.2-64 Cinn 5.8.4
User avatar
sdibaja
Level 5
Level 5
Posts: 899
Joined: Sun May 08, 2011 12:57 pm
Location: Baja California, Mexico

Re: SOLVED switch off power instead of "shutdown" command

Post by sdibaja »

power managers are funny, they don't always do it the way you want.

I seldom Shutdown, I prefer suspend ... near instant restart when I return, and minimal power use

My power manager is set to Suspend after 30 minutes of inactivity, and Shutdown when UPS power is low... and it works for me (occasional unreliable power here too)

I created a panel launcher with the command

Code: Select all

systemctl suspend
that suspends instantly ... for when I don't trust the power manager to suspend as instructed
Peter
Mate desktop https://wiki.debian.org/MATE
Debian GNU/Linux operating system: https://www.debian.org/download
Locked

Return to “Hardware Support”