[SOLVED] Current hangs in shutdown on fuser command
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
On 14.2 there is a command /usr/bin/fuser -k -m $dir & which works fine
On -current the command has changed to /usr/bin/fuser -k -M -m $dir & so -M has been added.
On my machine shutdown now hangs at the fuser command. If I run the command with -M and background it, it never returns without me pressing return to get back to the command prompt. Backgrounding the command without -M works fine.
Vulcan59 you do realize right Slackware current uses Elogind
and that is still being changed and rebuilt as we speak. And always will.
Why because it is tied to systemd as it changes.
Before people go off on this ask your self why we had to go to Elongind.
Many programs need that for loging. So Elogind takes the calls
that are needed by some programs that are built to use systemd.
we know it will be just like Pulseaudio take about 20 years to get it right.
Vulcan59 you do realize right Slackware current uses Elogind
and that is still being changed and rebuilt as we speak. And always will.
Why because it is tied to systemd as it changes.
Before people go off on this ask your self why we had to go to Elongind.
Many programs need that for loging. So Elogind takes the calls
that are needed by some programs that are built to use systemd.
we know it will be just like Pulseaudio take about 20 years to get it right.
It is a moving target.
What does this have to do with OP's hang during a shutdown? It shouldn't matter whether Slackware was using ConsoleKit2 or elogind, a hang during a shutdown is an issue.
@OP, I haven't had any issues with my system, but my NFS shares are being mounted within kodi and not separately in the filesystem. Have you tried adding a -v for verbose mode to see if it dumps anything beneficial to the CLI? What happens if you run the command without backgrounding and including your nfs mount points?
After a bit more investigation, I have found that rc.0 is not hanging on the fuser command as I originally thought. It actually hangs at the wait command further down.
# This is to ensure all processes have completed on SMP machines
wait
I am not on an SMP machine.
The hang only happens if I have an NFS mount at the time of the shutdown. It doesn't matter if is in use or not.
If I remove that wait my machine shuts down successfully with the NFS filesystem mounted.
At the moment I have no idea why this happens. Any ideas?
Distribution: slackware 15.0 64bit, 14.2 64 and 32bit and arm, ubuntu and rasbian
Posts: 495
Rep:
have you tried since the kernel in current got updated to 5.12.15 yesterday. that should have fixed an kernel related nfs issue mentioned elsewhere, which might be related.
Try adding the below to rc.0 right above the wait command. That should show you any backgrounded jobs that have not closed yet, which will let us find out for sure what the command is causing the hang (although, based on your previous message, I imagine it is the fuser command since it hangs if you run it manually).
Code:
for i in $(jobs -p); do
ps -hq $i -o command,user
done
Last edited by bassmadrigal; 07-08-2021 at 11:06 AM.
have you tried since the kernel in current got updated to 5.12.15 yesterday. that should have fixed an kernel related nfs issue mentioned elsewhere, which might be related.
Try adding the below to rc.0 right above the wait command. That should show you any backgrounded jobs that have not closed yet, which will let us find out for sure what the command is causing the hang (although, based on your previous message, I imagine it is the fuser command since it hangs if you run it manually).
Code:
for i in $(jobs -p); do
ps -hq $i -o command,user
done
Do you have NFS shares mounted? The fuser command doesn't show any directories after -m, which should be mount points for any NFS shares.
If you don't have NFS shares, can you add the red line to the for loop and see if that helps shutdown? It should exit the loop if dir is blank before running the fuser command.
Code:
for dir in $(/bin/mount | grep -e 'type nfs ' -e 'type nfs4 ' | sed -e 's|.* on ||g' | cut -d ' ' -f 1) ; do
[ -z "$dir" ] && break
echo "Killing processes holding NFS mount $dir open..."
# Background this to prevent fuser from also blocking shutdown:
/usr/bin/fuser -k -M -m "$dir" &
FUSER_DELAY=5
done
If you do have NFS shares, can you provide the output of the following command?
I'm not sure if you tried this, since your post doesn't specifically state it, but what happens if you run the fuser command with "/mnt/slackware" after the -m, does it still hang?
Code:
fuser -k -M -m /mnt/slackware &
It seems the command being run by the for loop doesn't include /mnt/slackware in it, so I'm curious why that's happening...
What does this have to do with OP's hang during a shutdown? It shouldn't matter whether Slackware was using ConsoleKit2 or elogind, a hang during a shutdown is an issue.
@OP, I haven't had any issues with my system, but my NFS shares are being mounted within kodi and not separately in the filesystem. Have you tried adding a -v for verbose mode to see if it dumps anything beneficial to the CLI? What happens if you run the command without backgrounding and including your nfs mount points?
Did I miss read it bass sorry
I belive we are using that as an init now for slackware current correct me if I miss read.
this seems to be an init issue
Quote:
op I have found a problem in rc.0/rc.6 on -current.
Did I miss read it bass sorry
I belive we are using that as an init now for slackware current correct me if I miss read.
this seems to be an init issue
clean my glasses.
your so kind.
elogind has nothing to do with the startup and shutdown of Slackware. It is used to help manage user logins. Here's an excerpt of their github README:
Quote:
Elogind is the systemd project's "logind", extracted out to be a standalone daemon. It integrates with PAM to know the set of users that are logged in to a system and whether they are logged in graphically, on the console, or remotely. Elogind exposes this information via the standard org.freedesktop.login1 D-Bus interface, as well as through the file system using systemd's standard /run/systemd layout. Elogind also provides "libelogind", which is a subset of the facilities offered by "libsystemd". There is a "libelogind.pc" pkg-config file as well.
I'm not sure if you tried this, since your post doesn't specifically state it, but what happens if you run the fuser command with "/mnt/slackware" after the -m, does it still hang?
Code:
fuser -k -M -m /mnt/slackware &
It seems the command being run by the for loop doesn't include /mnt/slackware in it, so I'm curious why that's happening...
I did as you suggest and it still hangs.
I still have your code just before the wait to show background processes not closed. This is the output.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.