Questions tagged [shutdown]

a command to turn off or reboot the system

528 questions
190
votes
12 answers

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 someone hit power button, etc.?
alex
  • 7,093
  • 6
  • 28
  • 30
141
votes
4 answers

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?
Rahul Patil
  • 24,281
  • 25
  • 80
  • 96
118
votes
6 answers

What is the difference between Halt and Shutdown commands?

What is the difference between the halt and shutdown commands?
wassimans
  • 1,501
  • 2
  • 13
  • 15
88
votes
3 answers

What is the difference between these commands for bringing down a Linux server?

Reading "What is the difference between Halt and Shutdown commands?" , I generally have an idea what does the command shutdown does, with or without -h/-r options. The "halt" command performs power off of the system to run-level 0 of the…
Win.T
  • 1,115
  • 1
  • 11
  • 14
86
votes
4 answers

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] ExecStart=/home/me/so.pl [Install] ?
sid_com
  • 1,531
  • 3
  • 16
  • 20
81
votes
11 answers

A stop job is running for Session c2 of user

The following message appears almost every time I shutdown my computer: A stop job is running for Session c2 of user ... (1min 30s) It waits for 1min30s then continues the shutdown process. I follow this systemd shutdown diagnosis guide and get the…
dmn
  • 955
  • 1
  • 10
  • 14
70
votes
6 answers

Why does reboot and poweroff require root privileges?

To restart or shut off Linux from the terminal, one can use reboot and poweroff, respectively. However, both of these commands require root privileges. Why is this so? What security risk is posed by not requiring this to have root privileges? The…
Rohan
  • 3,491
  • 9
  • 28
  • 45
67
votes
5 answers

How to shutdown Linux at 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?
Askar
  • 1,078
  • 2
  • 11
  • 16
63
votes
4 answers

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 still like to use the integrated shutdown button from…
c0dehunter
  • 885
  • 2
  • 9
  • 11
55
votes
4 answers

What exactly is "a stop job", as in "A stop job is running..."?

After a shutdown command is issued, sometimes one gets a status message like this: A stop job is running for Session 1 of user xy and then the system hangs for awhile, or forever depending on ??? So what exactly is "a stop job"? Also, why does…
Elliptical view
  • 3,559
  • 4
  • 25
  • 44
42
votes
6 answers

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, after installing the updates, or after downloading a…
El Burro
  • 561
  • 1
  • 5
  • 8
38
votes
2 answers

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 stop now really", "Process I need to kill you to…
humanityANDpeace
  • 13,722
  • 13
  • 61
  • 107
35
votes
2 answers

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 when shutting down using the graphical user interface,…
amyassin
  • 1,361
  • 3
  • 19
  • 22
35
votes
8 answers

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
Frozenskys
  • 707
  • 2
  • 8
  • 12
34
votes
4 answers

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?
Korgan Rivera
  • 2,543
  • 6
  • 28
  • 39
1
2 3
35 36