a command to turn off or reboot the system

learn more… | top users | synonyms

34
votes
3answers
12k views

What is the difference between Halt and Shutdown commands?

What is the difference between the halt and shutdown commands?
32
votes
4answers
31k views

What is the difference between reboot , init 6 and shutdown -r now?

I just want to know difference between in reboot init 6 shutdown -r now and which is the safest and the best?
31
votes
4answers
1k views

Why can't I execute shutdown when the permission is rwxr-xr-x?

I'm in /sbin and I see that shutdown has permissions rwxr-xr-x. Doesn't this mean that anyone can execute it?
23
votes
2answers
1k views

How does the power button shut the computer down without root permission?

When I try to shutdown the computer from a command line or terminal I must have root privileges: amy@amy:~$ shutdown now shutdown: Need to be root and amy@amy:~$ halt halt: Need to be root but ...
22
votes
6answers
38k views

How to find out from the logs what caused system shutdown?

E.g. I'm seeing this in /var/log/messages: Mar 01 23:12:34 hostname shutdown: shutting down for system halt Is there a way to find out what caused the shutdown? E.g. was it run from console, or ...
15
votes
2answers
10k views

Execute a command before shutdown

I want to execute a simple command just before the computer shuts down (timing is not essential). For startup I can use /etc/rc.local - is there something similar for shutdown? Note that I would ...
14
votes
1answer
1k views

How to prevent shutdown when an SSH user is logged in?

I'm administrating a networked environment and I had an interesting situation arise yesterday. When a host is required to shutdown by a regular user, it refuses to do so if other users are logged in ...
12
votes
3answers
575 views

Why do we need the reboot function in different binaries?

Why do we need the reboot function in different binaries? shutdown -r and reboot Or do they differ in something?
11
votes
2answers
5k views

Is it possible to stop a shutdown command?

Assuming you've just entered the command shutdown -h now (or something equivalent), is there realistically anything you can do (if you're quick enough) to prevent the machine shutting down?
11
votes
1answer
1k views

What happens when I press “Shut Down” from the GUI?

I have been banging my head against this for quite a while now. It's related to this question. I would like to find out exactly what happens when I choose to shut down my Linux box from the GUI. This ...
11
votes
3answers
630 views

Eject CD on shutdown

OK, so I have a simple problem: I have a live CD, and I want the CD to eject when the computer is rebooted or halted. Executing /usr/bin/eject -m makes the CD eject just fine... trouble is, as you ...
11
votes
1answer
497 views

Graceful shutdown in ArchLinux

I'm trying to get a graceful shutdown/reboot in ArchLinux with GNOME Shell. Now, when I ask for shut-down, it immediately shuts down without giving open programs time to gracefully close / save open ...
10
votes
5answers
3k views

How to shut down the computer after a task has been completed?

I usually start a download before I go to school. Which command should I use to automatically make the necessary saves and turn off the computer after a particular task has been completed? (Say, ...
10
votes
8answers
599 views

How to read the messages during power off

I'm using Lubuntu 11.10. Every time I turn off my Sony Vaio I can read FAIL in red letters. But I can not read. I tried to take a photo, but not success. Well, I was not worrying about this but ...
10
votes
4answers
491 views

How do I shutdown, reboot and logout the system from the command-line?

I would like to do that using the command-line, because sometimes my computer freezes and I need to force a shutdown (I know it's not good to the hardware). And: What is the difference between Halt ...
10
votes
5answers
10k views

Stop program running at startup in Linux

How do I stop a program running at startup in Linux. I want to remove some apps from startup to allow them to be managed by supervisord e.g apache2
9
votes
1answer
259 views

Don't let users reboot while root's logged in

On my system users can reboot and shut down the system. From time to time I need to update software (or do anything else) and I don't want users to reboot/shutdown the system until I've finished. Is ...
9
votes
2answers
596 views

How does the system shutdown of a linux kernel work internally?

I have somehow an rough idea of how the userspace and init-system (be it classic init sysV /upstart/ systemd) work at system shutdown. (Essentially there is an order succession of "Stop!", "Please ...
8
votes
5answers
2k views

On Linux, is there an rc.local equivalent for shutdown?

I've got a few commands that I run in rc.local so they are run last in the startup sequence. I would like to know if there is a similar facility for undoing the results of those commands at shutdown, ...
8
votes
3answers
2k views

How can I set that only root + a given user can shut down my pc?

If I'm using Ubuntu 11.04, how can I configure it such that that only two users can shut down/suspend/hibernate my PC: the root user and one regular user?
8
votes
3answers
5k views

How to run a script with systemd right before shutdown?

What do I need to put in the [install] section, so that systemd runs /home/me/so.pl right before shutdown and also before /proc/self/net/dev gets destroyed? [Unit] Description=Log Traffic [Service] ...
7
votes
3answers
2k views

Shutdown from login prompt in tty

Suppose I boot a Linux machine without GUI. When it displays a tty login prompt, can I shutdown the machine with a keyboard sequence? Of course I could type in my username and password and then sudo ...
7
votes
1answer
912 views

How to shutdown with consolekit without sysvinit (but with systemd)

I have systemd (and no sysvinit) installed on a Arch Linux box. However, I cannot shutdown/reboot with consolekit (dbus interface). # systemctl {shutdown,reboot} work just fine, so I guess it's ...
7
votes
1answer
731 views

What's the right way to execute a script before system shutdown (systemd)?

I wrote a script that suspends all my VirtualBox machines, and put a line in /etc/rc.local.shutdown, but it doesn't seem to work, su - XX -c /XX When I'm booting the next time, VirtualBox tells me ...
6
votes
3answers
1k views

How to shutdown Linux at a specific datetime from terminal?

It seems I can shutdown using sudo shutdown by specifying a time or minutes. Is there a way to specify datetime for shutdown?
6
votes
2answers
4k views

Is halt the same as “shutdown -H” and poweroff the same as “shutdown -P”?

I haven't found a clear answer to the differences between the two options to the command shutdown. Is halt the same as shutdown -H and poweroff the same as shutdown -P?
6
votes
1answer
1k views

How to find out what turned off the computer?

Yesterday, after getting back home I found out my computer is turned off. Since it appeared it was cold shutdown (a lot of disk repairs were shown during boot up) I am wondering what was the cause. ...
6
votes
1answer
232 views

How do DE's call ACPI functions?

Okay, first off, this is not a problem I am facing, but I would like to understand this better. If I wish to shutdown / reboot my machine from the command line I need to call: $ sudo poweroff $ sudo ...
5
votes
3answers
2k views

Can I allow a non-root user to log in when /etc/nologin exists?

Suppose a non-root user with sudo privileges executes a delayed shutdown (shutdown +10 or whatever) and logs out. Then, before the shutdown occurs, he wants to log back in and cancel the shutdown. The ...
5
votes
3answers
214 views

Can I make the O/S drive READ ONLY and prevent metadata write back?

Sorry to ask a (probably) stupid question. I am a hardware designer struggling with provision of safe shutdown power to an embedded system. I am aware the Linux normally makes a heavy use of the ...
5
votes
1answer
906 views

How to get a persistent “history”-file even after a non-clean shutdown?

I am trying Ubuntu Server 10.10 in VirtualBox. I like that the commands I run is saved in a "history"-file that can be shown with the history command. But if I just turn off VirtualBox without the ...
5
votes
1answer
509 views

Does `shutdown -P now` safely unmount a USB drive mounted to `/dev/sdb1`?

I typically unmount my USB drive (using umount) from /dev/sdb1 before I shutdown my computer but if I shut it down using shutdown -P now and then restart it, the drive is no longer mounted. Is this ...
5
votes
1answer
659 views

Is there a way to control the delay before shutdown on low battery?

Is there any way to configure shutdown on critically low battery to give me a bit of time before actually shutting down? I've set GNOME Power Manager to shutdown on low battery (hibernating does not ...
5
votes
2answers
762 views

Is it possible to execute a script as first at shutdown/reboot on Debian?

I am currently trying to register a script (located in the /etc/init.d) in a way that makes this script being executed as the first script/programm at shutdown/reboot (change to running level 0 or 6). ...
5
votes
2answers
567 views

How can I ensure only the root user have the right to halt/reboot the system?

CentOS Linux by default allows all users to have permission to "halt" & "reboot" the system by using the commands halt and reboot. How can I configure my system so that only the root user has the ...
5
votes
1answer
194 views

Automatic shutdown after startup

I'm a new newbie Linux Mint user but I have a lot of desire to learn. I played a little with the shutdown command typing: sudo shutdown +20 and then: sudo shutdown -c I then manually hibernate ...
5
votes
1answer
2k views

Execute Script automatically at shutdown on Fedora 15/16

With fedora 15 or 16, I don't find the directory for execute a shell script automaticaly at shutdown...
4
votes
2answers
265 views

Changing shutdown broadcast message

Is it possible to change the default message broadcasted by shutdown to something else?
4
votes
3answers
436 views

Do I need to halt in order to really turn power off?

I tried shutdown -f now, thinking it will do a full power off sequence. Instead, it ends with *Checking battery state... and just hangs there. Should I add -h switch to fully take power off, ...
4
votes
2answers
506 views

List of script( location)s that get run automatically, and when?

Does anybody know (of a resource listing) what scripts are run automatically, and when, from the moment I startup the computer until it's shutdown again. I know several places where I can add scripts ...
4
votes
2answers
873 views

Gnome: how to close all applications?

I've configured the Debian system on my netbook to shut down whenever the battery runs too low. Problem is, shutting down kills all running applications without giving them any chance to save any ...
4
votes
1answer
295 views

What reasons would prevent a machine restart from proceeding?

I am in the process of testing a fanless, atom based PC for use in an embedded application. I am running Voyage Linux version 0.7.5 on the machine. This distribution is derived from Debian Lenny. ...
4
votes
2answers
45 views

Detecting a “plug pulled” scenario with Linux

I was wondering if it's possible to detect a shutdown due to power loss on a Linux system. (Power loss defined as: pressing reset button, pressing power button, pulling the power cord) If so, how? ...
4
votes
3answers
1k views

Can it harm if I shutdown without closing applications?

Can it hurt if I shut down my machine without closing all programs? I normally close all of them by hand, but have heard from others that this is really not necessary anymore (i.e. Linux will take ...
4
votes
1answer
659 views

Using a APC Smart-UPS to shutdown a Ubuntu Server Cluster

I'm currently in the process of designing a solution to shutdown a two Ubuntu Server cluster that uses heartbeat and DRBD to replicate storage and offer a NFS share to some IP cameras. We want to ...
4
votes
0answers
26 views

How to get system to shutdown when Xorg is quit?

I installed nodm, so that Debian starts Xorg and a window manager immediately after booting, without requesting any password and without a login. How can I similarly setup Debian to shutdown the ...
4
votes
0answers
102 views

Execute code on shutdown on Fedora 19

I need to catch any OS shut down and execute some actions before letting the OS be shutted down. I'm using Fedora 19 and C++. I'm able to catch a shutdown signal given by the console with the ...
3
votes
2answers
832 views

Is running “sudo sync” and removing power dangerous for my system?

I run an Ubuntu system, and it sometimes takes a while to shut down. Apparently, GNU/Linux attempts to, in a nutshell, stop all running processes, flush the filesystem journal, and then cut off the ...
3
votes
3answers
1k views

Shutting down from X without a desktop environment

I have recently given up my Desktop Environment and am now only using a Window Manager (i3) and X. It all works very well and I do not miss much. Except for one thing: the shutdown button. I can now ...
3
votes
1answer
727 views

What's the right way to shutdown Arch Linux through dbus interface?

I'm running openbox with Arch Linux, and looks like the old console kit interface has been long gone, %> dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit ...