A stop job is running for Session c1 of user root (25s 1min 30s)问题

write in front

Today, I clicked the restart button on the front end and suddenly found that the serial port printing information of the development board was stuck. There was one long time and two short time, roughly A stop job is running for Session c1 of user root (25s 1min 30s ), here it is estimated that when shutting down and restarting, the front-end user process did not exit and was waiting to exit, so it is stuck here. The maximum default time is 90s, so you need to wait 90s before killing this process.

As shown below
Please add image description


After searching, there are only two solutions. One is to shorten the default 90s time, such as 1s, 5s, etc., and force the process to be killed in a short time. The other is to install a watchdog and set it to start automatically.

short time

  1. Modify /etc/systemd/system.conf
sudo vim /etc/systemd/system.conf
  1. Change the time

First find these two lines in the 90s

#DefaultTimeoutStartSec=90s
#DefaultTimeoutStopSec=90s

Then uncomment and change to 5s

DefaultTimeoutStartSec=5s
DefaultTimeoutStopSec=5s
  1. Execution takes effect
sudo systemctl daemon-reload

As shown below

Please add image description

watchdog

  1. Use watchdog

sudo apt install watchdog
sudo systemctl enable watchdog.service
sudo systemctl start watchdog.service

おすすめ

転載: blog.csdn.net/qq_44333320/article/details/134704863
C1