Linux shutdown but reboot

Why do I get a reboot instead of a shutdown?

After two days of installation, strangely my Ubuntu machine is restarting instead of shutdown from both desktop GUI and command line.

sudo shutdown -h now sudo halt # (doesn't shutdown, instead freezes on boot screen Plymouth) 

I had force shutdown by powering off the machine. This is not happening all the times. I have been using Ubuntu for 6 months and never experienced this kind of problem.

Please update your question and tell us what command line shutdown options you have tried and also in what way the shutdown does «not work». How do you «force shutdown«? Are you able to shutdown using the desktop GUI menu? Please do not replay in a comment. Update your question as is recommended in the faq.

«This is not happening all the times.» -> I find that this happens only when the power line is unplugged.

I have the same issue on Ubuntu 15.04 on a Lenovo Yoga 2 11. I tried the grub options, but they did not change anything. I found out, that I can get the system to shutdown properly when I attach the external mouse that was attached during installation. After removing the mouse the problem reappears.

10 Answers 10

Go into your machines BIOS and check for an option called wake-on-lan or something similar and disable it.

This was what caused this problem on my machine.

Surprisingly, I found this worked for my case, though I’m not sure why as there should be no WoL packets being sent to the machine.

On my ASUS BIOS this is option: ADVANCED APM Power-On-By-PCI-E and if I disable that, the shutdown succeeds for me.

I had the same issue with new acer aspre v5 notebook. It has been solved by enabling laptop-mode as running

sudo apt-get install laptop-mode-tools 

I have same issue on my Intel NUC, this makes my situation worse, my mouse and keyboard are frozen frequently.

I faced the same issue after I installed Ubuntu 12.04 on a newly built machine. This answer on another post helped me resolve it:

I resolved by adding acpi=noirq to the kernel arguments

sudo editor /etc/default/grub 
GRUB_CMDLINE_LINUX_DEFAULT="acpi=noirq quiet splash" 

In my case it was a Wake On Lan motherboard (Gigabyte GA-Z77M-D3H) issue.

sudo apt-get install ethtool 
sudo ethtool -s eth0 wol d 

If it works, then edit the /etc/rc.local file and add ethtool -s eth0 wol d , before the exit 0 line.

I think my problem is related to the WOL but I need to use this functionality, so I don’t want to disable it. Any advice?

Читайте также:  Google chrome linux portable

I had this problem on a Thinkpad X230 with Ubuntu 12.04, it always rebooted after shutdown when unplugged. I found the solution described here to work for me:

Install laptop-mode-tools (if it’s not already installed):

sudo apt-get install laptop-mode-tools 

Open grub’s config in /etc/default/grub in a text editor and add (or change) this line:

GRUB_CMDLINE_LINUX_DEFAULT="acpi=noirq quiet splash" 

Update grub using the following command:

🙁 it didn’t worked for me. And even more, my wifi, lcd brightness and other functions in my laptop stop working.

I have had exactly the same problem on my Acer V5-571G: the laptop shuts down, turns off its power LED, and then starts again after a few seconds. It occurs more often when working on battery.

The problem seems to arise from incorrect work of pm-utils. But if you write on into /sys/bus/*/devices/*/power/control , the kernel takes control over power management at the specified devices — and somehow this makes the hardware to shut down correctly.

So I have written a script:

#!/bin/bash case "$1" in stop) for i in /sys/bus/*/devices/*/power/control ; do echo on > $i ; done ;; esac exit 0 

and to make it being executed every time before shutdown I’ve placed it under name K32power-control-on into /etc/rc0.d directory (don’t forget to make the script executable, sudo chmod +x K32power-control-on). After that the laptop shuts down ok.

I think that there are only a few buses/devices which need to have ‘on’ value written to their power/control, so the list of devices in the script can be restricted, but I just didn’t investigate further.

Источник

Выключение и перезагрузка Linux. Shutdown и Reboot

Выключение и перезагрузка Linux

Команда shutdown предназначена для выключения и перезагрузки компьютера, используя командую строку Linux. shutdown также позволяет перезагрузить или выключить компьютер в заданное время или через заданный интервал времени.

Синтаксис команды shutdown

shutdown [опции] [время] [сообщение]

[опции] — указывает действие, которое необходимо выполнить.
[время] — время или интервал для выполнения действия.
[сообщение] — сообщение, рассылаемое залогиненным пользователям.

Перезагрузить систему

Для перезагрузки системы используется ключ -r . Чтобы немедленно запустить перезапуск системы используется команда:

Для перезагрузки Linux также можно использовать команду reboot. Она является аналогом команды shutdown -r . Для перезагрузки Linux из командной строки, с использованием команды reboot, необходимо выполнить:

Выключить компьютер

Чтобы корректно завершить систему и выключить компьютер используется команда:

Также можно использовать команду reboot с ключом -p :

Перезагрузка или выключение Linux по времени

Для команды shutdown можно указать точное время или интервал времени, через который необходимо перезагрузить или выключить систему. Рассмотрим примеры.

Выключить систему через 15 минут:

Выключить систему в 13 часов 10 минут:

Перезагрузить систему через 10 минут:

Отправка сообщения перед перезагрузкой или выключением

Если система используется несколькими пользователями, то бывает полезно предупредить их перед выполнением перезагрузки или выключением системы. Для этого в конце команды shutdown пишется соответствующее сообщение:

sudo shutdown 15:30 "Save your data! System will be shutdown at 15:30."

Отмена запланированной перезагрузки или выключения

Если вы выполнили команду shutdown и установили соответствующее время для ее выполнения, то чтобы отменить данное действие используется ключ -c :

Читайте также:  See details file linux

Дополнительную информацию по командам shutdown и reboot можно получить, выполнив

К перезагрузке или выключению компьютера из командной сроки Linux иногда прибегают, когда «система» или какой-нибудь процесс или группа процессов серьезно повисла. Смотрите также как завершать процессы, используя команду kill.

Источник

Linux Shutdown Command – 8 Examples with All Options

In some cases, you must shut down or reboot your computer to apply updates, install a new application, migrations, or perform other operations. Linux provides the shutdown command to securely stop all the running processes on your server and to notify all the logged-in users about the shutdown operation.

In this tutorial, we will learn how to use the Linux shutdown command-line utility with practical examples.

Linux Shutdown Command

The shutdown command is used to securely shut down the system. Use this command in Linux for system shutdown either immediately or at a specific time. Shutdown can also be used to reboot your computer system.

When you run the Linux shutdown command-line tool, then all running applications are closed, active system processes are saved, and all currently logged-in users are notified about the shutdown operation. This command also prevents new users from logging in after the shutdown process starts.

Syntax

The basic syntax of this command is as follows:

shutdown [option] [time] [message]
  • option denotes the operation that you want to perform, such as power-off (default option), halt, or reboot.
  • time denotes when to execute the command. You can use this parameter to schedule a shutdown or reboot.
  • message denotes a comment or message that you want to broadcast to all the logged-in users.

Useful Shutdown Commands

Shutdown provides several options and variations that you can use to perform different options. The following table lists some of the most useful shutdown commands:

Commands Description
shutdown Shuts down the computer in one minute.
shutdown -h Halts and turns off the system.
shutdown -r Reboots the system in one minute.
shutdown -h Halts and turns off the system at a specified time.
shutdown now Shuts down your computer immediately.
shutdown -r Reboots the system at a specified time.
shutdown -r now Reboots the system immediately.
shutdown -P Brings down the system and then powers it off.
shutdown -c Cancels a scheduled shutdown.

How to Use Linux Shutdown Command

The following examples show you some of the most common usages of Linux shutdown command:

1. Shutdown After 1 Minute

This is the default behavior of the shutdown command. Use shutdown without any options to shut down the system after one minute:

linux shutdown default command

2. Shutdown Now

To do an immediate shutdown, use the Linux shutdown command with now option.

Instead of using the time to now, you can use +0 time option to down the system immediately.

On a systemd based Linux Distributions the shutdown now equivalent command is systemctl poweroff. In those systems, shutdown command is a symbolic link systemctl.

3. Shutdown at a Specified Time

Use the time argument with the shutdown command to turn off your computer at a specified time. The time argument can be used in two formats- specified time of the day in HH:MM format or +m where you can specify the number of minutes from the current time when the shutdown process will start.

To shut down the system at 10 AM, specify the time after the shutdown command:

shutdown specific time linux

To shut down your computer after five minutes from the current time, specify the five minutes in +5 format:

shutdown after a specific time Linux

4. Shutdown Message

System administrators can notify users with a warning message about the system shut down.

To shutdown the system in 30 minutes with a broadcast message, use the following command:

sudo shutdown +30 "System is going under maintenance in 30 minutes"

shutdown message Linux

5. Cancel a Scheduled shutdown

There may be a situation where you must cancel a scheduled shutdown. For example, suppose there is a planned release and you need to hold off the shutdown. In that case, you can cancel it using the -c option with the shutdown command and can also specify a custom wall message:

sudo shutdown -c "Ops needs the scheduled shutdown"

This command does not show any output on the screen.

Unfortunately in systemd system the systemctl command doesn’t have a schedule or cancel the shutdown. Another option is to add cron to /run/systemd/shutdown/scheduled script.

6. Shutdown command to reboot

By default, the shutdown -r command reboots your system after one minute. To shutdown immediately and automatically reboot your system use the following command:

7. Shutdown command to Schedule a Reboot

To schedule a reboot, use the time parameter with the following command as you do with the system shutdown:

sudo shutdown -r +10 “Rebooting for maintenance”

Using shutdown command to schedule a Linux system reboot

Shutdown Help

The shutdown command provides a help page that you can refer to know more about the shutdown command options:

Linux shutdown help command

Linux Shutdown Command Options

The following table some of the useful options that you can use with the shutdown command:

Options Description
-r Brings down your system and requests for a system reboot.
-h Sends a request to either halt or power off the system after bringing the system down.
-H Sends a request to halt the system after bringing the system down.
-P Sends a request to power off the system after bringing the system down.
-c Cancels any scheduled shutdown. You can not specify a time with this option, but you can broadcast a custom message for the system users.
-k Sends a warning message to the users and disables all system logins. It does not bring the system down.

Conclusion

In this tutorial, we learned how to use the shutdown command to power down or reboot your Linux system. Shutdown provides various options that you can use to either shut down your system immediately or schedule a shutdown. This command can also be used to reboot your system. You can try these command options and examples in a test environment, but you should use them carefully in a production environment.

If this resource helped you, let us know your care by a Thanks Tweet. Tweet a thanks

Источник

Оцените статью
Adblock
detector