Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
0
answers
32
views
Ubuntu server keeps shutting down after 15 minutes
I have Ubuntu server 24.04 running on a desktop machine. It has a GUI installed (though I don't know if that is relevant). I am running this server as a headless machine at the moment, though until recently it was running with a monitor attached and everything was OK. Now, when I SSH to the machine...
I have Ubuntu server 24.04 running on a desktop machine. It has a GUI installed (though I don't know if that is relevant). I am running this server as a headless machine at the moment, though until recently it was running with a monitor attached and everything was OK. Now, when I SSH to the machine it will shutdown after 15 minutes, even if I am doing something on it, or if I am doing a long download. I have edited
/etc/systemd/logind.conf
as follows:
IdleAction=ignore
HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
Everything else is commented out. This is a Desktop machine so issues of lid closure are not relevant even though I have specified them (copied from another post). I have also run sudo systemctl restart systemd-logind
, followed by a reboot. I can RDP to the GUI using Remmina, and the only power options available are to set Power Mode to 'Balanced' (the default), and I have set 'Screen Blank' to 'Never', though I would have thought this is not relevant.
I am at a loss as to what else I can do. Any suggestions, please. As I said, this all seemed to start when I went headless!
Regards, StuartM
StuartM
(11 rep)
Aug 5, 2025, 05:44 PM
0
votes
2
answers
2276
views
is there a proper way to shut down from single user mode
I've found a lot of inconsistent documentation on single user mode. I don't need to use it often, but I get curious, and I remember not being to use shut down commands in single user mode and pressing the reset button. Is there a better way to leave single user mode after resetting passwords?
I've found a lot of inconsistent documentation on single user mode. I don't need to use it often, but I get curious, and I remember not being to use shut down commands in single user mode and pressing the reset button. Is there a better way to leave single user mode after resetting passwords?
volare
(11 rep)
Mar 27, 2019, 03:37 AM
• Last activity: Jul 21, 2025, 09:08 PM
97
votes
5
answers
174843
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] ExecStart=/home/me/so.pl [Install] ?
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
(1661 rep)
May 23, 2012, 04:39 PM
• Last activity: Jul 2, 2025, 06:44 PM
0
votes
0
answers
58
views
no proper shutdown of spring boot app on a linux tomcat service
I have following envirnonment Spring boot (3.1.1) web app, running on tomcat 10.x as a systemd service, on RHEL9. It uses a ehcache, configured to be persistent across restarts. If I start & stop tomcat manually per `./startup` and `./shutdown`, I can see a ``` DEBUG o.e.c.EhcacheManager - Close suc...
I have following envirnonment Spring boot (3.1.1) web app, running on tomcat 10.x as a systemd service, on RHEL9.
It uses a ehcache, configured to be persistent across restarts.
If I start & stop tomcat manually per
./startup
and ./shutdown
, I can see a
DEBUG o.e.c.EhcacheManager - Close successful.
in my log. That means, the cache is closed properly, and the cache is still valid after restart.
On starting & stopping tomcat per service I miss that log entry, and indeed the caches are not properly closed and renewed after restart.
[Service]
...
ExecStart=/opt/xxx/apache-tomcat/bin/catalina.sh run
ExecStop=/opt/xxx/apache-tomcat/bin/shutdown.sh
These are the same scripts I run manually.
Something I am not understanding is happening in this shutdown phase.
Is the service stop running into a timeout and than forcing a ungracefull tomcat stop?
###### Actions taken:
Log level for EHCachemanger set started/stopped manually and per service
Steffen Spranger
Nov 6, 2024, 08:32 AM
• Last activity: Jun 24, 2025, 03:38 PM
3
votes
2
answers
110
views
How to know which user did reboot or shutdown when multiple desktop sessions are active?
I have a Ubuntu installation where multiple users have desktop sessions at the same time, some over XRDP and another directly on VT7. How can I find out which of these users initiated a shutdown or reboot, e.g by the XRDP mechanism [![XRDP SESSION][1]][1] or by the systray popup menu? [

Paz Leviim
(31 rep)
Nov 5, 2024, 10:51 AM
• Last activity: Jun 24, 2025, 10:14 AM
0
votes
2
answers
2741
views
Deepin Linux stuck on shutdown
Sometime my laptop successfully shutdown but sometimes no, it stuck on Deepin Linux Logo. After edit `quiet splash` to `acpi=force` in `/etc/default/grub` I can figure out my problem is stuck exactly at Stopping Disk. Here is `/etc/default/grub` GRUB_CMDLINE_LINUX_DEFAULT="acpi=force" GRUB_DEFAULT="...
Sometime my laptop successfully shutdown but sometimes no, it stuck on Deepin Linux Logo.
After edit
How I can diagnose what causing this stuck problem, and how I can fix it?
Thanks in advance.
quiet splash
to acpi=force
in /etc/default/grub
I can figure out my problem is stuck exactly at Stopping Disk.
Here is /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="acpi=force"
GRUB_DEFAULT="0"
GRUB_DISTRIBUTOR="/usr/bin/lsb_release -d -s 2>/dev/null || echo Debian
"
GRUB_GFXMODE="1366x768"
GRUB_TIMEOUT="5"
Here is the image

Dark Cyber
(279 rep)
Mar 21, 2017, 01:33 PM
• Last activity: Jun 19, 2025, 11:03 PM
0
votes
1
answers
2086
views
Kali linux 2020.2 have white screen and icons not showing after update
I updated my virtual machine from kali 2020.1 to kali 2020.2 using apt-get upgrade command in the terminal and it completed successfully. Suddenly I got power-cut and I am also not saved the machine state. After I booted up the virtual machine and checked it shows like some sort of stuck white scree...
I updated my virtual machine from kali 2020.1 to kali 2020.2 using apt-get upgrade command in the terminal and it completed successfully. Suddenly I got power-cut and I am also not saved the machine state. After I booted up the virtual machine and checked it shows like some sort of stuck white screen and icons are not showing. If I tried to open any program or terminal, it wont open.
Please check for attached screenshot for reference.

Xivks
(1 rep)
Jun 30, 2020, 12:42 PM
• Last activity: Jun 12, 2025, 06:03 AM
2
votes
2
answers
10098
views
How to deal with "A stop job is running" in Debian 9 for 90s, once every 2 or 3 shutdowns?
When I'm turning my Debian Stretch (9) off, chances are that I see something like: [![screenshot showing "A stop job is running for ...f user Debian-gdm (59s / 1min 30s)"][1]][1] So a have a few questions: 1) It seems like a bug that's not been solved yet (it's been around for a few years). By "bug"...
When I'm turning my Debian Stretch (9) off, chances are that I see something like:
So a have a few questions:
1) It seems like a bug that's not been solved yet (it's been around for a few years). By "bug" I mean Linux should turn off faster than Windows; if it doesn't, there's a bug.
2) Since this bug seems hard to isolate and solve, maybe a "Esc to cancel" would solve a big part of the problem.
3) I have programming experience, but not with Linux Kernel and such. Am I advised to try to include "Esc to cancel" myself? If so, which file should I change? May I compile only this file, or something more?
EDIT
Contents of

/etc/gdm3/daemon.conf
# GDM configuration storage
#
# See /usr/share/gdm/gdm.schemas for a list of available options.
[daemon]
# Uncoment the line below to force the login screen to use Xorg
#WaylandEnable=false
# Enabling automatic login
# AutomaticLoginEnable = true
# AutomaticLogin = user1
# Enabling timed login
# TimedLoginEnable = true
# TimedLogin = user1
# TimedLoginDelay = 10
[security]
[xdmcp]
[chooser]
[debug]
# Uncomment the line below to turn on debugging
# More verbose logs
# Additionally lets the X server dump core if it crashes
#Enable=true
Rodrigo
(1894 rep)
Jan 25, 2019, 03:57 PM
• Last activity: Jun 7, 2025, 11:01 AM
21
votes
7
answers
74131
views
Find last shutdown time
This is the command I am using: last -x|grep shutdown | head -1 but it's giving me the duration with +2 hours: shutdown system down 3.14-1-amd64 Mon Jul 21 08:43 - 22:19 (13:36) the last shutdown time (08:43) is correct, but the startup time (22:19, should be 20:19) is incorrect. Is there a better c...
This is the command I am using:
last -x|grep shutdown | head -1
but it's giving me the duration with +2 hours:
shutdown system down 3.14-1-amd64 Mon Jul 21 08:43 - 22:19 (13:36)
the last shutdown time (08:43) is correct, but the startup time (22:19, should be 20:19) is incorrect.
Is there a better command to check how long ago the PC was shutdown? or is my DST settings or something else causing this?
PS: I am using Debian testing *(Linux rig 3.14-1-amd64 #1 SMP Debian 3.14.12-1 (2014-07-11) x86_64 GNU/Linux)*
şaloma
(541 rep)
Jul 21, 2014, 07:11 PM
• Last activity: Jun 6, 2025, 04:20 AM
9
votes
4
answers
8622
views
How to skip 'Please remove the installation medium then press enter'
I have a time-consuming program running in Lubuntu 18.04 Live. It will take around one day to finish. After the program finishes the computer shuts down. But since I am running Lubuntu Live, the computer asks me to > Please remove the installation medium then press enter after initiating the shutdow...
I have a time-consuming program running in Lubuntu 18.04 Live. It will take around one day to finish. After the program finishes the computer shuts down.
But since I am running Lubuntu Live, the computer asks me to
> Please remove the installation medium then press enter
after initiating the shutdown.
I will be traveling away before the program can finish and will not be back in a few weeks. I don't want the computer to be powered on all that time.
My question is: Is there a timeout after which the computer will eventually shut down, or is there any way to skip this prompt and completely shut down Lubuntu Live?
TheAdam122
(91 rep)
Jul 5, 2019, 05:37 PM
• Last activity: Jun 5, 2025, 06:30 AM
0
votes
0
answers
59
views
Shutdown computer on idle
I've Openbox/Porteus on my laptop and I want to shutdown computer when idle 10 minutes. I edited `/etc/elogind/logind.conf` deleting **#** set *idleaction* to *poweroff* and, *idleactionsec* to 1min (to test). I rebooted computer but shutdown on idle didn't work. How can I shutdown computer when idl...
I've Openbox/Porteus on my laptop and I want to shutdown computer when idle 10 minutes. I edited
/etc/elogind/logind.conf
deleting **#** set *idleaction* to *poweroff* and, *idleactionsec* to 1min (to test). I rebooted computer but shutdown on idle didn't work.
How can I shutdown computer when idle 10 minutes?
Onur Can
(1 rep)
Aug 11, 2024, 12:12 PM
• Last activity: May 30, 2025, 08:39 AM
1
votes
1
answers
2702
views
Linux does not shutdown completely (Failed to unmount /oldroot)
I've been having this problem for a few months where Linux just fails to shutdown. It freezes on the screen where all logs are displayed and stuff, the last line is always: "kvm: exiting hardware virtualization" Somewhere in the middle there is either: "Failed to unmount /oldroot: Device or resource...
I've been having this problem for a few months where Linux just fails to shutdown.
It freezes on the screen where all logs are displayed and stuff, the last line is always:
"kvm: exiting hardware virtualization"
Somewhere in the middle there is either:
"Failed to unmount /oldroot: Device or resource busy"
or something along the lines of:
"Remounting "/" ext4 with ....." (I am unable to remember the rest)
This does not seem to be distribution specific, but its happening on arch based distributions (I have not tried ubuntu or any other distributions)
It also appears to affect only this laptop, as all other systems running Linux in my house work perfectly.
I also see fit to mention that I am a beginner, but I decided that arch was the best way to learn due to its steep learning curve.
Would be happy to provide any logs needed,
Image provided of the shutdown screen.
Thanks

Gaurav Satish
(53 rep)
Mar 11, 2023, 09:41 AM
• Last activity: May 28, 2025, 11:04 AM
4
votes
2
answers
1996
views
ssh connection hangs on server shutdown / restart
When I shut down or restart my server while logged in via SSH, the SSH connection hangs or freezes. The terminal becomes completely unresponsive, and it takes up to one minute for the SSH session to recognize that the connection has been lost. This issue occurs on the new Debian 12 (openssh-server 1...
When I shut down or restart my server while logged in via SSH, the SSH connection hangs or freezes. The terminal becomes completely unresponsive, and it takes up to one minute for the SSH session to recognize that the connection has been lost.
This issue occurs on the new Debian 12 (openssh-server 1:9.2p1-2) but does not happen on the older Debian 10.
On Debian 10, when I restart the server, the SSH connection cleanly logs out immediately, displaying the following message:
Connection to debian10 closed by remote host.
Connection to debian10 closed.
When I connect with verbose options to both servers, and then restart them, I see some differences:
ssh session ends cleanly:
$ ssh -vvv -E /tmp/a debian10
debug3: send packet: type 1
debug1: channel 0: free: client-session, nchannels 1
debug3: channel 0: status: The following connections are open:
#0 client-session (t4 r0 i0/0 o0/0 e[write]/0 fd 6/7/8 sock -1 cc -1)
debug3: fd 1 is not O_NONBLOCK
Transferred: sent 4668, received 7428 bytes, in 34.8 seconds
Bytes per second: sent 134.3, received 213.7
debug1: Exit status -1
ssh session freezes:
$ ssh -vvv -E /tmp/b debian12
debug3: send packet: type 80
debug3: receive packet: type 82
debug3: send packet: type 80
debug3: send packet: type 80
debug3: send packet: type 80
Timeout, server debian12 not responding.
I have found similar questions, but all the answers suggest something to do with systemd. I am not using systemd, I am using sysvinit on both servers.
So, to sum up:
The two servers behave differently using same ssh client, therefore I suspect something is different on the server side (presumably behavior of openssh-server)
UPDATE:
======
Here is my restart sequence (runlevel 6):
/etc/rc6.d/K01cron
/etc/rc6.d/K01ssh
/etc/rc6.d/K01urandom
/etc/rc6.d/K02sendsigs
/etc/rc6.d/K03rsyslog
/etc/rc6.d/K05networking
/etc/rc6.d/K06umountfs
/etc/rc6.d/K07umountroot
/etc/rc6.d/K08reboot
note that
ssh
daemon is terminated before networking
. But that should not have any effect anyway, because shutting down sshd
normally does not affect existing ssh connections.
UPDATE2:
=======
Here is the shutdown sequence, as I see it on the console:
[ ok Sending processes configured via /etc/ini[....] Stopping: cron
[ ok ] Stopping: sshd
[ ok ] Asking all remaining processes to terminate...done.
[ ok ] All processes ended within 1 seconds...done.
[ ok ] Stopping: rsyslogd
[ ok ] Deconfiguring network interfaces...done.
[ ok ] Will now unmount temporary filesystems: /tmp
[ ok ] Will now unmount local filesystems: /var
[ ok ] Mounting root filesystem read-only...done.
[info] Will now halt.
[79896.954129] reboot: Power down
Martin Vegter
(586 rep)
Jun 17, 2023, 05:23 PM
• Last activity: May 27, 2025, 05:08 AM
0
votes
1
answers
172
views
Can't shutdown Linux guest OS with `at` command
Here are three examples of what I did inside the terminal (the third one has sudo): 1. ``` at now + 5 minutes ``` (interactively:) ``` at> shutdown --poweroff now ``` 2. ``` echo "sbin/shutdown -h now" | at 14:50 ``` 3. ``` echo "/sbin/shutdown -h 16:22" | at now ``` In every case, I can verify the...
Here are three examples of what I did inside the terminal
(the third one has sudo):
1.
at now + 5 minutes
(interactively:)
at> shutdown --poweroff now
2. echo "sbin/shutdown -h now" | at 14:50
3. echo "/sbin/shutdown -h 16:22" | at now
In every case,
I can verify the one-time job is scheduled with the atq
command,
but the shutdown --show
command says "No scheduled shutdown".
The system should shutdown at the scheduled time that at
runs
after sleeping.
This is on a CentOS 9 Stream guest virtual machine.
The user is already added to the sudo users group
and can initiate the shutdown with a command like shutdown now
.
So, with the one-time at
job, what’s the difference?
Samir Fink
(3 rep)
Mar 5, 2024, 09:25 PM
• Last activity: May 26, 2025, 09:48 AM
10
votes
6
answers
47190
views
Ubuntu - Shutdown does not power-off (tried other solutions)
I noticed recently that shutting down my Linux (Ubuntu 20.04) desktop does not power it down once everything has come to a halt. It states `Power down` but the led is still glowing and the fan is still moving etc. which it shouldn't! The result is a terminal stating as showin in the picture: [
acpi=force
and apm=power_off
separately, too) and the computer still stays powered-on after shutting down.
One hint might be the output of acpi -V -i
> No support for device type: power_supply
So is this the problem? Is there a way of configuring acpi correctly? Or did I miss something else?
Thanks
Tobias Reich
(291 rep)
Dec 6, 2020, 10:30 AM
• Last activity: Apr 24, 2025, 02:01 PM
-1
votes
2
answers
2374
views
When shutting down Arch Linux, the message display is erratic
I installed KDE Plasma and LightDM on Arch Linux. Then, when shutting down, the message display was disrupted. Apparently, this occurs in Linux distributions that employ Systemd. How can I fix this phenomenon?
I installed KDE Plasma and LightDM on Arch Linux.
Then, when shutting down, the message display was disrupted.
Apparently, this occurs in Linux distributions that employ Systemd.
How can I fix this phenomenon?
user435042
Sep 29, 2020, 09:54 AM
• Last activity: Mar 3, 2025, 06:38 AM
0
votes
0
answers
38
views
System lock when shutdown scheduled on Debian
To reproduce this on a Debian device. Simply run the command `sudo shutdown -h +5` after confirmation proceed with locking the device. In the login window you'll get the message: `system is going down. unprivileged users are not permitted to log in anymore. pam_nologin(8)` Unfortunately it's locked...
To reproduce this on a Debian device. Simply run the command
sudo shutdown -h +5
after confirmation proceed with locking the device.
In the login window you'll get the message:
system is going down. unprivileged users are not permitted to log in anymore. pam_nologin(8)
Unfortunately it's locked me out for good and doesn't shutdown after 5 minutes. The only way I can fix this is by forcing shutdown via holding down the power button.
I'd like to have access in case the device locks and ideally for the shutdown script to run even if the device is locked
Sarkis
(101 rep)
Feb 16, 2025, 01:22 PM
• Last activity: Feb 16, 2025, 01:37 PM
-1
votes
1
answers
103
views
How to shutdown pc if live usb is pulled?
I have installed linux lite to a usb. When unplugging the usb the pc crashes, the logout screen also doesn't work. How to trigger a force shutdown via pulling the usb stick? >Well it's not a proper shutdown im risking corruption of my install if the system was writting to the disk. I've installed li...
I have installed linux lite to a usb. When unplugging the usb the pc crashes, the logout screen also doesn't work.
How to trigger a force shutdown via pulling the usb stick?
>Well it's not a proper shutdown im risking corruption of my install if the system was writting to the disk.
I've installed linux lite to a 64gb usb,
Partioned it as follows:
1gb for /boot, 1gb for swap, and 30gb for
/
, the remaining is in ntfs
and can be accessed via windows.
Thanks in advance.
Enter Nam
(1 rep)
Feb 10, 2025, 07:06 AM
• Last activity: Feb 10, 2025, 07:51 AM
1
votes
1
answers
85
views
prevent moon key on a Sun keyboard from shutting down my gentoo PC
I have a Sun keyboard attached to my gentoo PC. If I accidentally touch the key with the moon symbol on it (happens once or twice a week as I am reaching for my mouse), it triggers an orderly shutdown of my PC. I want to stop it from doing that. My first attempt was to deactivate the `ca` entry in `...
I have a Sun keyboard attached to my gentoo PC. If I accidentally touch the key with the moon symbol on it (happens once or twice a week as I am reaching for my mouse), it triggers an orderly shutdown of my PC.
I want to stop it from doing that.
My first attempt was to deactivate the
ca
entry in /etc/inittab
by changing it to
ca:12345:ctrlaltdel:/bin/true /sbin/shutdown -h now "Fist of Bob"
but the moon key still shuts down the PC.
This PC does not have an /etc/acpi
directory as referenced in https://unix.stackexchange.com/questions/59179/have-sun-keyboard-moon-key-116-not-shut-down-my-computer , nor does it have systemd
.
I have no idea what chain of events is triggered by pressing the moon key, so I have no idea what software I should be reconfiguring to prevent the shutdown.
Mutant Bob
(169 rep)
Aug 18, 2021, 12:03 AM
• Last activity: Jan 23, 2025, 09:54 PM
3
votes
2
answers
4662
views
Turn off monitor and poweroff
I want to power off my monitor at system shutdown. Tried the following: sleep 10; xset dpms force off; poweroff `xset` command turn off the monitor, but then `poweroff` exits from X and turn monitor on again in console mode, I can see various messages as in any usual shutdown, and finally after syst...
I want to power off my monitor at system shutdown.
Tried the following:
sleep 10; xset dpms force off; poweroff
xset
command turn off the monitor, but then poweroff
exits from X and turn monitor on again in console mode, I can see various messages as in any usual shutdown, and finally after system poweroff, my monitor goes in stand-by status, with the usual flashing stand-by led.
But I want the monitor off when system has terminated the shutdown process.
So is there a way to launch a command and obtain:
- poweroff
- monitor completely turned off
Joe
(131 rep)
Jun 3, 2020, 04:37 PM
• Last activity: Dec 31, 2024, 08:46 AM
Showing page 1 of 20 total questions