Skip to main content

All Questions

Tagged with
6 votes
1 answer
4k views

How can I catch or stop a Linux shut down from the terminal?

Is there a way to catch or stop a Linux shut down after a reboot, halt or shutdown command has been entered? sudo shutdown -r +10 I should now have 10 minutes before the computer shuts down. If I ...
nelaaro's user avatar
  • 13.8k
5 votes
3 answers
7k views

What is the proper way to enable a normal user to shutdown, halt or reboot the computer?

My dirty solution is to chmod +s /sbin/shutdown. It works but this is probably not good practice and insecure. Moreover after some system updates the suid bit gets reset. What would be the correct way ...
ccpizza's user avatar
  • 7,883
5 votes
1 answer
341 views

Poweroff , damages hardware?

So i've been using poweroff command to shutdown my computer at a specific hour. Is it okay for the hardware to do this (e.g hard drives)? Or should I use other system call?
Fisher's user avatar
  • 213
5 votes
5 answers
5k views

Execute script before shutting down in Ubuntu

When I shut down my computer I want to show some pending tasks that I have to do before leaving the office. I have a local application to manage those tasks, so basically I just want to run a command,...
juanefren's user avatar
  • 327
5 votes
1 answer
3k views

Run a script on systemd service ONLY at shutdown not restart

[Unit] Description=test Before=shutdown.target [Service] ExecStart=/bin/true ExecStop=/usr/local/bin/test.sh RemainAfterExit=yes [Install] WantedBy=multi-user.target I tried a lots of ...
user avatar
5 votes
1 answer
1k views

Run script before other units stop on shutdown

I need to run a script before a set of other services on my machine stop when shutting the machine down. (In my case, terminating an EC2 instance.) I have tried variations on the answer in this ...
2rs2ts's user avatar
  • 717
4 votes
3 answers
3k views

How do I shutdown a Linux box without running init 0

I want to shutdown my computer as if power was cut off (don't ask me why). How do I do this under Linux?
Alexandru's user avatar
  • 355
4 votes
3 answers
3k views

A keyboard shortcut for the "status menu" in GNOME 3

Is there a keyboard shortcut, or can a keyboard shortcut be defined, to open the GNOME 3 "status menu" (the one in the upper right corner with your name on it that you use to log out, restart or shut ...
Lyubomir's user avatar
4 votes
1 answer
1k views

system-wide crontab vs. user crontab to shutdown pc

I'm trying to shutdwon my pc at 2 am once a week. If I use the user crontab of root (sudo crontab -e) 30 2 * * 3 shutdown -h now the shutdown will not be performed. However, if I place the same ...
Philippe's user avatar
  • 937
4 votes
2 answers
1k views

Shutdown Ubuntu Command

What is the command or application that allows a user to shutdown the computer from gnome. And how does it have privileges while halt requires superuser?
agz's user avatar
  • 8,328
4 votes
2 answers
3k views

Will the linux "shutdown" command allow a parameter to determine the pause between sending SIGTERM and SIGKILL?

The man page seems to indicate no. There is /etc/rc.d/init.d/halt on Fedora. It has a hard coded pause in it, but there's got to be a better way than to change that script. Any help would be ...
s2cuts's user avatar
  • 41
4 votes
2 answers
19k views

Why does net rpc shutdown fail with the right credentials?

The command $ net rpc SHUTDOWN -f -I xxx.xxx.xxx.xxx -U uname%psswd Fails with the following errors: Could not connect to server xxx.xxx.xxx.xxx The username or password was not correct. ...
brice's user avatar
  • 2,377
4 votes
3 answers
3k views

How do I shutdown Slitaz from terminal?

I have Slitaz installed on my home server and the only way of interfacing with it is through and SSH connection. I have tried shutdown -h now But it only tells me shutdown is not a command So I ...
Jonno_FTW's user avatar
  • 1,560
4 votes
0 answers
515 views

Autorun zerofree on boot (or on shutdown)

I have a virtualbox vitual server that keeps growing. To keep its virtual disk small I'm manually shrinking it using VBoxManage modifyhd disk.vdi compart after zeroing unused space on the disk using ...
martin.macko.47's user avatar
3 votes
1 answer
3k views

When I quit xmonad, how can I make it shut down applications nicely?

When I quit xmonad (Shift-Mod-Q), it kills all my running applications. This results in me losing my recent terminal history in gnome-terminal and in Chromium complaining on the next start up that it ...
Jonatan Kallus's user avatar

15 30 50 per page
1
2
3 4 5
10