Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

"A stop job is running"

If none of the specific sub-forums seem right for your thread, ask here.
Message
Author
Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: "A stop job is running"

#31 Post by Dai_trying »

I had to look through my bash history to understand why I posted this, and it was due to a number of tests not working properly and I posted one of the earlier lines!... anyway, your corrected version would do the trick (thank you for pointing it out) and my original post should have been

Code: Select all

if [ $(cat /etc/fstab | grep swap | awk '{print $1}') == $(sudo blkid | grep swap | awk '{print $2}' | tr -d '"') ]; then echo "All is good";else echo "Swap UUID is different to fstab";fi
It does beg the question of how it could have given the message "Swap UUID is different to fstab" to @peer? strange that....

User avatar
sunrat
Administrator
Administrator
Posts: 6457
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 472 times

Re: "A stop job is running"

#32 Post by sunrat »

Dai_trying wrote:It does beg the question of how it could have given the message "Swap UUID is different to fstab" to @peer? strange that....
Indeed. Two identical commands should never give different output.
I guessed it was some kind of copy/pasta glitch you posted first. ;) And I had to check what tr command was, that could come in very handy!
PS. you don't need to use cat to grep a file. Sometimes known as cat abuse. Took me ages to wean myself from that habit. Probably save 0.1 secs to grep a 1GB file so more academic than important although it makes the command shorter:
https://en.wikipedia.org/wiki/Cat_(Unix ... use_of_cat
http://www.catwelfare.org/report-cat-abuse JK :D

Anyway, we strayed a bit from the actual topic. Two commands that can help identify problems like this are:

Code: Select all

systemd-analyze blame
journalctl -b -p 3
Check man journalctl for other options that may suit better.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

User avatar
ticojohn
Posts: 1284
Joined: 2009-08-29 18:10
Location: Costa Rica
Has thanked: 21 times
Been thanked: 44 times

Re: "A stop job is running"

#33 Post by ticojohn »

I too occasionally get a "stop job is running" message at shutdown (maybe one out of ten times). This is on Debian Jessie (up to date) and XFCE desktop. I have two drives. Jessie is installed on a SSD and Stretch on a HDD. This is /etc/fstab for the SSD

Code: Select all

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=d217e984-5a4e-4019-9335-8dca4956514b /               ext4    noatime,errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=fd34d9a9-e492-4f05-827b-a32dca238490 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
And this is /etc/fstab for the HDD

Code: Select all

# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sdb1 during installation
UUID=8fe14111-fb44-461b-b458-626c5737d8c2 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sdb5 during installation
UUID=f87f0147-03ee-4960-9d2a-2d76b0828b67 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
This is the result when running the following script I see it showing two(2) swap partitions, one for the SSD and one for the HDD.

Code: Select all

root@JohnBoy:/home/john# blkid | grep swap| awk '{print $2}'|sed s/'"'//g
UUID=f87f0147-03ee-4960-9d2a-2d76b0828b67
UUID=fd34d9a9-e492-4f05-827b-a32dca238490
The HDD is not mounted so why am I seeing the swap partition for that drive. I am assuming that this could be part of the problem. How do I fix this?

By the way, to get the bash script referenced in this post to run, I had to modify the variables with double quotes as shown here

Code: Select all

if [ "$(cat /etc/fstab | grep swap | awk '{print $1}')" == "$(sudo blkid | grep swap | awk '{print $2}' | tr -d '"')" ]; then echo "All is good";else echo "Swap UUID is different to fstab";fi
Otherwise I get an error message about too many arguments. And when I run that script I get the following

Code: Select all

root@JohnBoy:/home/john# if [ "$(cat /etc/fstab | grep swap | awk '{print $1}')" == "$(sudo blkid | grep swap | awk '{print $2}' | tr -d '"')" ]; then echo "All is good";else echo "Swap UUID is different to fstab";fi
Swap UUID is different to fstab
I am not irrational, I'm just quantum probabilistic.

User avatar
ticojohn
Posts: 1284
Joined: 2009-08-29 18:10
Location: Costa Rica
Has thanked: 21 times
Been thanked: 44 times

Re: "A stop job is running"

#34 Post by ticojohn »

Okay, I can answer one of my questions. BLKID is going to show the partitions even of unmounted devices. DOH! But as to why the script says the SWAP UUID is different than /etc/fstab I don't understand.

Do I need to remove one of the swap partitions? Rather not do that in case I have a failure of one or the other drive. And more importantly, is having two swap partitions causing any kind of problem? Not sure why it would but it's the question.

HMMM! Maybe the reason the script gives the result it does is because the swap partition for the HDD is listed first in the blkid response.
I am not irrational, I'm just quantum probabilistic.

Dai_trying
Posts: 1100
Joined: 2016-01-07 12:25
Has thanked: 5 times
Been thanked: 16 times

Re: "A stop job is running"

#35 Post by Dai_trying »

The script reports it as being wrong because there are two swap partitions, it was only something I quickly put up to check if they matched and has no checking for "non-standard" setups, and by non-standard I just mean it would expect to only see one swap space, but I doubt that would be causing the delay unless the swap space (listed in fstab) has been re-formatted.

As for why you are receiving the delay, that would really depend on the exact reason the stop job is running, it would help if you could post that here.

EDIT:
I also recall reading somewhere (maybe on this forum) that swap does not have to be entered into fstab, I'm not sure what debian version this started but the system will probably mount both swap spaces during boot-up, but you can easily check swap size with free from the command line.

User avatar
ticojohn
Posts: 1284
Joined: 2009-08-29 18:10
Location: Costa Rica
Has thanked: 21 times
Been thanked: 44 times

Re: "A stop job is running"

#36 Post by ticojohn »

After doing a bit more research I think I am pretty certain that the issue with "stop job is running" is not in any way related to the swap file issue (at least in my case).

What I found was that during shutdown Systemd is trying to disconnect items from dbus while at the same time stopping dbus. Sorry if I am not using correct terminology, but hopefully ya'll get my point. The following is an excerpt from journalctl output.

Code: Select all

Sep 22 10:45:46 JohnBoy systemd[1]: Stopping D-Bus System Message Bus...
Sep 22 10:45:46 JohnBoy systemd[1]: Stopping Deferred execution scheduler...
Sep 22 10:45:46 JohnBoy systemd[1]: Stopping Make remote CUPS printers available locally...
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped target Timers.
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped Daily Cleanup of Temporary Directories.
Sep 22 10:45:46 JohnBoy systemd[2299]: Starting Exit the Session...
Sep 22 10:45:46 JohnBoy systemd[2299]: Stopped target Default.
Sep 22 10:45:46 JohnBoy systemd[2299]: Stopped target Basic System.
Sep 22 10:45:46 JohnBoy systemd[2299]: Stopped target Paths.
Sep 22 10:45:46 JohnBoy systemd[2299]: Stopped target Sockets.
Sep 22 10:45:46 JohnBoy systemd[2299]: Stopped target Timers.
Sep 22 10:45:46 JohnBoy systemd[1]: Starting Store Sound Card State...
Sep 22 10:45:46 JohnBoy systemd[1]: Stopping Regular background program processing daemon...
Sep 22 10:45:46 JohnBoy systemd[1]: Stopping Daemon for power management...
Sep 22 10:45:46 JohnBoy systemd[2299]: Received SIGRTMIN+24 from PID 4295 (kill).
Sep 22 10:45:46 JohnBoy systemd[1]: Unmounted /run/user/1000/gvfs.
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped Regular background program processing daemon.
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped Accounts Service.
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped Deferred execution scheduler.
Sep 22 10:45:46 JohnBoy systemd[2194]: Stopped target Default.
Sep 22 10:45:46 JohnBoy systemd[2194]: Stopped target Basic System.
Sep 22 10:45:46 JohnBoy systemd[2194]: Stopped target Timers.
Sep 22 10:45:46 JohnBoy systemd[2194]: Stopped target Paths.
Sep 22 10:45:46 JohnBoy systemd[2194]: Stopped target Sockets.
Sep 22 10:45:46 JohnBoy systemd[2194]: Reached target Shutdown.
Sep 22 10:45:46 JohnBoy systemd[2194]: Starting Exit the Session...
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped Getty on tty1.
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped Avahi mDNS/DNS-SD Stack.
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped Modem Manager.
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped Network Manager.
Sep 22 10:45:46 JohnBoy systemd[2194]: Received SIGRTMIN+24 from PID 4301 (kill).
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped System Logging Service.
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped Authenticate and Authorize Users to Run Privileged Tasks.
Sep 22 10:45:46 JohnBoy systemd-logind[1842]: Failed to abandon session scope: Connection reset by peer
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped Session c1 of user lightdm.
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped User Manager for UID 1000.
Sep 22 10:45:46 JohnBoy systemd[1]: lightdm.service: Main process exited, code=exited, status=1/FAILURE
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped Make remote CUPS printers available locally.
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped Disk Manager.
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped Daemon for power management.
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped Bluetooth service.
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped D-Bus System Message Bus.
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped Network UPS Tools - power device monitor and shutdown controller.
Sep 22 10:45:46 JohnBoy systemd[1]: Started Store Sound Card State.
Sep 22 10:45:46 JohnBoy systemd[1]: Stopped User Manager for UID 118.
Sep 22 10:45:46 JohnBoy systemd[1]: Failed to propagate agent release message: Transport endpoint is not connected
Sep 22 10:45:46 JohnBoy systemd[1]: Failed to propagate agent release message: Transport endpoint is not connected
Sep 22 10:45:46 JohnBoy systemd[1]: Failed to propagate agent release message: Transport endpoint is not connected
Sep 22 10:45:46 JohnBoy systemd[1]: Failed to propagate agent release message: Transport endpoint is not connected
Sep 22 10:45:46 JohnBoy systemd[1]: Failed to propagate agent release message: Transport endpoint is not connected
Sep 22 10:45:46 JohnBoy systemd[1]: Failed to propagate agent release message: Transport endpoint is not connected
Sep 22 10:45:46 JohnBoy systemd[1]: Failed to propagate agent release message: Transport endpoint is not connected
Sep 22 10:45:46 JohnBoy systemd[1]: Failed to propagate agent release message: Transport endpoint is not connected
Sep 22 10:45:46 JohnBoy systemd[1]: Failed to propagate agent release message: Transport endpoint is not connected
Sep 22 10:45:46 JohnBoy systemd[1]: Failed to propagate agent release message: Transport endpoint is not connected
Sep 22 10:45:46 JohnBoy systemd[1]: Failed to propagate agent release message: Transport endpoint is not connected
Sep 22 10:45:46 JohnBoy systemd[1]: Failed to propagate agent release message: Transport endpoint is not connected
Sep 22 10:45:46 JohnBoy systemd[1]: Failed to propagate agent release message: Transport endpoint is not connected
Appears to cause a race condition. I think this issue is known by the systemd developers.

At least that is what I think is going on.
I am not irrational, I'm just quantum probabilistic.

User avatar
ticojohn
Posts: 1284
Joined: 2009-08-29 18:10
Location: Costa Rica
Has thanked: 21 times
Been thanked: 44 times

Re: "A stop job is running"

#37 Post by ticojohn »

Interestingly, I switched from using gdm3 to lightdm and no longer have this problem.
I am not irrational, I'm just quantum probabilistic.

User avatar
Job
Posts: 813
Joined: 2006-12-30 20:20
Location: no clue
Contact:

Re: "A stop job is running"

#38 Post by Job »

Something tells me that anyone who uses a box with systemd is bound to have this issue. I use slim and I have that problem. It did not really bother me until last night when I had to go to bed and systemd was owning my box and my time.

After so many years I will have to dab with coding issues? I am too old.
#aptitude install life
--------------------------------------------------------------------------------------------------------------
Debian 12 - FreeBSD

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: "A stop job is running"

#39 Post by Head_on_a_Stick »

Job wrote:I use slim
That project is dead upstream and does not support systemd login sessions, try a different display manager. GDM is probably the best, or no DM at all.

EDIT: pressing <ctrl>+<alt>+<delete> seven times in two seconds will force a reboot.
deadbang

User avatar
Job
Posts: 813
Joined: 2006-12-30 20:20
Location: no clue
Contact:

Re: "A stop job is running"

#40 Post by Job »

Head_on_a_Stick wrote:
Job wrote:I use slim
That project is dead upstream and does not support systemd login sessions, try a different display manager. GDM is probably the best, or no DM at all.

EDIT: pressing <ctrl>+<alt>+<delete> seven times in two seconds will force a reboot.
I noted all you wrote but should a package/software forces a user to adapt to its behavior. I know the people who make these decisions know more than me.
#aptitude install life
--------------------------------------------------------------------------------------------------------------
Debian 12 - FreeBSD

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: "A stop job is running"

#41 Post by Head_on_a_Stick »

Job wrote:should a package/software forces a user to adapt to its behavior.
*shrugs* It is what it is.

Sometimes software becomes obsolete, this has happened to SLiM.

If you don't like systemd then don't use it, there are plenty of alternatives, even in the GNU/Linux ecosystem.

For example, Alpine Linux will never support systemd because glibc is a hard dependency and they use musl.
deadbang

User avatar
Job
Posts: 813
Joined: 2006-12-30 20:20
Location: no clue
Contact:

Re: "A stop job is running"

#42 Post by Job »

forward thinking :arrow:
#aptitude install life
--------------------------------------------------------------------------------------------------------------
Debian 12 - FreeBSD

User avatar
bw123
Posts: 4015
Joined: 2011-05-09 06:02
Has thanked: 1 time
Been thanked: 28 times

Re: "A stop job is running"

#43 Post by bw123 »

Head_on_a_Stick wrote: ...
EDIT: pressing <ctrl>+<alt>+<delete> seven times in two seconds will force a reboot.
That absolutely does not always work. The fact is, I've found that occasionally under systemd it is just impossible to shutdown cleanly (with or without a dm). The problem will never get fixed if people pretend it doesn't exist.
resigned by AI ChatGPT

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: "A stop job is running"

#44 Post by Head_on_a_Stick »

bw123 wrote:
Head_on_a_Stick wrote: ...
EDIT: pressing <ctrl>+<alt>+<delete> seven times in two seconds will force a reboot.
That absolutely does not always work.
Well, it works sometimes :)

I can reproduce this problem on my system by having a terminal session (xterm+mksh) open when I try a reboot and my solution has been to use a copy-on-write filesystem (btrfs) and hold down the power button for 4 seconds — that always works.

And I've just found a new solution that removes the problem entirely (for me, anyway):

Code: Select all

# ln -s /dev/null /etc/sysctl.d/50-coredump.conf
https://github.com/systemd/systemd/issu ... -203534354

Does that work for you?
bw123 wrote:The problem will never get fixed if people pretend it doesn't exist.
Who's pretending?
deadbang

Post Reply