A stop job is running for mount on shutdown

If none of the more specific forums is the right place to ask

A stop job is running for mount on shutdown

Postby asmox » 2018-07-01 07:50

Hello,

I'm facing issues everytime I do these two things:
  1. Mount external filestytem:
    Code: Select all
    $ sudo mount -c cifs -o username=pi //192.168.1.50/Grubas /mnt/Grubas

    As you probably noticed, the drive is attached to Raspberry Pi, which serves as home server.
  2. Shut down the computer - then I see kind of information:
    Code: Select all
    A stop job is running for /mnt/Grubas [x / 1 min 32 s ]
And it starts to count until time mentioned above lasts. I tried to look for some answers, the one quite close to my topic is there:
https://bugs.debian.org/cgi-bin/bugrepo ... bug=798314

But as long as I understand, it's for drive automatically mounted on system start. In my case, it doesn't happen. I would try to do this solution as well, but I'm not as advanced Debian user as these guys, so that's why I ask for help. I caught that it concentrates on changing fstab file, but on the other hand I have no entry about my mount there.
asmox
 
Posts: 4
Joined: 2018-07-01 07:35

Re: A stop job is running for mount on shutdown

Postby bw123 » 2018-07-01 13:33

It's not that hard to edit your /etc/fstab file. The man page says it is the sysadmin responsibility, I agree with this. Make a backup first, and test it with mount -a before you reboot.

If this makes you uneasy, then just umount the network mount manually before rebooting?
User avatar
bw123
 
Posts: 3287
Joined: 2011-05-09 06:02
Location: TN_USA

Re: A stop job is running for mount on shutdown

Postby debiman » 2018-07-01 15:52

it stands to reason that id systemd takes care of mounting it via fstab, it will also take care of unmounting it.

additionally, i have to say: if the raspi runs linux, and your machine runs linux, why in $DEITY's name are you using cifs = samba = "Windows interoperability suite of programs"?
fwiw, i use NFS v3 and have not seen this problem.
User avatar
debiman
 
Posts: 2818
Joined: 2013-03-12 07:18

Re: A stop job is running for mount on shutdown

Postby pendrachken » 2018-07-05 22:13

Same problem has been happening since SysV init days. The network is being shut down before the umount is called on all file systems. This makes it so you CANNOT un-mount the network drive, and the shutdown un-mounting script has to wait for what it thinks is a slow network ( really it's NO network ) before giving up.

If it is mounted in the same directory every time you could make a small unit / script so that whatever init system you have dismounts the network drive BEFORE the network gets shut down. It's faily straight forward, I'm sure it won't take too long to do once you look up how to add a unit file to the shutdown sequence.
fortune -o
Your love life will be... interesting.
:twisted: How did it know?

The U.S. uses the metric system too, we have tenths, hundredths and thousandths of inches :-P
pendrachken
 
Posts: 1325
Joined: 2007-03-04 21:10
Location: U.S.A. - WI.

Re: A stop job is running for mount on shutdown

Postby kevinthefixer » 2018-07-08 01:32

I took three steps to address this problem, not sure which one fixed it. Not that it was really a problem, it always shut down eventually, I could just walk away. But I wanted to cure it while upgrading to a larger SSD, and it got annoying when rebooting, so:

First, after giving my "normal" user staff permissions
Code: Select all
#adduser kevin staff
I put my automount script in /usr/local/sbin/. Not really sure if it helped, but it works, I call it from XFCE's "Session and Startup" dialog. Make sure the script ends with "exit 0", if it stays running even in the background it can cause the problem described.

Second, I installed libpam-systemd. I read somewhere (sorry forgot to document where, but probably somewhere in the Debian Wiki) that it may help systemd kill user processes.

Third, in /etc/systemd/logind.conf, I changed the line KillUserProcesses=no to =yes and uncommented it.

Like I say, not sure what specific one did the job, or if it takes all 3. But it was a week ago, maybe 15 or 20 poweroff cycles, and it hasn't missed a lick. (I don't usually power on/off this much, but I'm recovering from cataract surgery and have not much else I'm allowed to do but mess with computers). Perhaps someone would like to actually test each one, and the combinations? I'm just tickled pink it works right. I must say, running Stretch, I have yet to come across a problem that just can't be fixed. May take a lot of research, may be work, but it works. And certainly I need a lot more study on systemd; I'm a total noob (so who isn't?)
kevinthefixer
 
Posts: 73
Joined: 2018-05-05 22:30

Re: A stop job is running for mount on shutdown

Postby debiman » 2018-07-08 22:22

thank you for the hints.
it might make my own machine's shutdown reliably faster; testing.
User avatar
debiman
 
Posts: 2818
Joined: 2013-03-12 07:18

Re: A stop job is running for mount on shutdown

Postby kevinthefixer » 2018-07-08 22:55

From what I've Googled, it seems to be related only to Samba, but hard info is few and far between. It also makes sense that it could be related to any CIFS if the root cause cited is correct, that Network Manager can't umount the share because it's busy, and it's busy because mount is still using it! Anyway please keep us posted, I'm curious myself.
kevinthefixer
 
Posts: 73
Joined: 2018-05-05 22:30

Re: A stop job is running for mount on shutdown

Postby asmox » 2018-08-03 19:42

I have just tried the solution from bugreport: https://bugs.debian.org/cgi-bin/bugrepo ... =798314#72:
Code: Select all
192.168.1.10:/home/mythtv /home/mythtv   nfs   x-
systemd.requires=network.target,x-systemd.automount,x-systemd.device-
timeout=10,timeo=14,x-systemd.idle-timeout=1min 0 0


It didn't help. Is it possible that reason is because I was using CIFS instead of NFS? I need this share for both Linux and Windows operating systems, so that's why I chose Samba CIFS.

In my case, first of all I was getting the error from timeo=14, that it's unknown command. So I deleted this instruction. After that, not only I still had "a stop job running", but after reboot KDE loading screen freezed for few minutes and it was unable to
Code: Select all
ls /mnt

because system got stucked when I tried to.

I tried solution from @kevinthefixer, but I don't know how automount script should look like, so I tried only the last step with KillUserProcesses=yes, with still no results. Can you please post the script?
asmox
 
Posts: 4
Joined: 2018-07-01 07:35

Re: A stop job is running for mount on shutdown

Postby kevinthefixer » 2018-08-04 01:35

Not a problem, it's about as simple as it gets. Maybe because I am:
Code: Select all
#!/bin/bash
#mount the Samba share on SolarMSI according to /etc/fstab
mount /mnt/smb
exit 0

While I'm at it, here's what the line in /etc/fstab looks like:
Code: Select all
//192.168.10.101/sambashare /mnt/smb                      cifs    username=remote-user,password=,user,noauto   0    0

As you can see, it's a completely open system, which might not be appropriate for most. I live in the middle of nowhere, there is nobody within wifi range. Even if there were, Internet piracy is not generally considered a problem in the Arizona desert except in the few large cities. YMMV, probably will.
kevinthefixer
 
Posts: 73
Joined: 2018-05-05 22:30

Re: A stop job is running for mount on shutdown

Postby asmox » 2018-08-05 10:06

After that I totally broke my login ability. It started from kind of lags and freezes: right after log in it was like Kate was trying to start for several seconds, then gave up. And when I tried to click anything (like KDE Start button), everything totally froze...

I added the script through KDE startup scripts. So, for that moment, I couldn't remove the script because I wasn't able to use graphic environment.

I tried to delete the file script through text environment. I found the file in both /usr/local/sbin/ and /home/asmox/.kde/Autostart. After that I'm not even able to log in to KDE Plasma. Restoring the files didn't make any change.

Can you please help me to diagnose this issue and rewind those changes?
asmox
 
Posts: 4
Joined: 2018-07-01 07:35

Re: A stop job is running for mount on shutdown

Postby kevinthefixer » 2018-08-05 17:13

Sorry, no, I really can't, I know nothing about how KDE works. Maybe there's a KDE guru around?
kevinthefixer
 
Posts: 73
Joined: 2018-05-05 22:30

Re: A stop job is running for mount on shutdown

Postby asmox » 2018-08-05 21:17

Okay, I finally took control under my account. I had to delete .drmc file from my home directory, as written at this topic: HELP! Can't pass the login screen. But still cannot get rid of "A Stop Job". I would consider just manually unmounting this share
asmox
 
Posts: 4
Joined: 2018-07-01 07:35


Return to General Questions

Who is online

Users browsing this forum: No registered users and 7 guests

fashionable