a command to turn off or reboot the system

learn more… | top users | synonyms

32
votes
3answers
8k views

What is the difference between Halt and Shutdown commands?

What is the difference between the halt and shutdown commands?
30
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?
30
votes
4answers
19k 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?
22
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 ...
17
votes
6answers
28k 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 ...
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 ...
13
votes
2answers
7k 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 ...
12
votes
3answers
554 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
4k 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
538 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 ...
10
votes
8answers
426 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
418 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
8k 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
215 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 ...
8
votes
5answers
2k 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, ...
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
4k 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] ...
8
votes
2answers
83 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 ...
7
votes
3answers
1k 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?
7
votes
1answer
823 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
623 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
913 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
3answers
1k 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 ...
6
votes
1answer
218 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
2answers
3k views

Halt and poweroff options for shutdown command

I have googled for a while, but I still haven't found a clear answer to the differences between halt and poweroff options for shutdown. So I would like to ask this question here. If it helps, my ...
5
votes
3answers
1k views

The package containing shutdown command

Which Debian or Ubuntu package has the /sbin/shutdown command in it? I want to read the source of that command (and possibly modify it to report notification on desktop) and I didn't know which ...
5
votes
3answers
181 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
805 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
606 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
1answer
834 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. ...
5
votes
2answers
162 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
366 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
143 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
175 views

Changing shutdown broadcast message

Is it possible to change the default message broadcasted by shutdown to something else?
4
votes
2answers
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 ...
4
votes
3answers
420 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
418 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
710 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
283 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
1answer
446 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 ...
4
votes
3answers
889 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
520 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 ...
3
votes
2answers
700 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
982 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
136 views

Rolling your own init: How to shutdown/restart?

After reading this answer, I thought it would be funny to roll my own init on Python, so I wrote this in /init-python. #!/usr/bin/python3 import os import subprocess # Make / writable! ...
3
votes
3answers
283 views

To recover my system so it shut down normally?

I have Linux mint 13(ubuntu 12.04) installed on my thinkpad T520, running for around 1 year. I'm not able to shut down my machine even if I do: sudo shutdown now. At first, it halts after messages of ...
3
votes
1answer
650 views

How to check will my computer is going to reboot(or shutting down)?

When I send a reboot command(or shutdown) command to a Linux machine does it keeps that messages at somewhere and can I query it. I.e. I will send a reboot command and after that I will run another ...
3
votes
1answer
283 views

Have Sun keyboard moon key (116) not shut down my computer

On my Sun keyboard, the top-rightmost key (with a moon image, right above the keypad) shuts down my computer. I'd like it not to, as I hit it by mistake now and then. In /etc/default/keyboard, I only ...