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: 1
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: 3135
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: 2499
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: 1324
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: 53
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: 2499
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: 53
Joined: 2018-05-05 22:30


Return to General Questions

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable