Mount SMB windows share in /tmp and can't shutdown properly.
Mount SMB windows share in /tmp and can't shutdown properly.
I found an odd bug the other day.
If I mount a SMB windows share in /tmp (for example /tmp/movies), then do a shutdown, it hangs on the 'saving SFS file...' line.
I can Ctrl-C out of the script, so it's not really hung, just doing something very time consuming. I left my PC in that state for 24 hours and it never completed.
Once I removed the SMB share everything went back to normal. Is there some special handling of the files in /tmp?
--Jeff
If I mount a SMB windows share in /tmp (for example /tmp/movies), then do a shutdown, it hangs on the 'saving SFS file...' line.
I can Ctrl-C out of the script, so it's not really hung, just doing something very time consuming. I left my PC in that state for 24 hours and it never completed.
Once I removed the SMB share everything went back to normal. Is there some special handling of the files in /tmp?
--Jeff
Re: Mount SMB windows share in /tmp and can't shutdown properly.
It's been my experience that Samba shares don't auto-dismount cleanly like hard drive or flash drive partitions during shutdown. You must remember to manually unmount them with whatever Samba share tool you are using.
IIRC, someone recently modified the Puppy shutdown routine to handle this.
OTOH, I can't see any advantage to putting a Samba share mount point in /tmp. It's not like the mount point is taking up any significant space that must be recovered at shutdown.
IIRC, someone recently modified the Puppy shutdown routine to handle this.
OTOH, I can't see any advantage to putting a Samba share mount point in /tmp. It's not like the mount point is taking up any significant space that must be recovered at shutdown.
There is a bug that I haven't reported yet that is most likely the problem.
The same thing happens with an NFS mount as well.
Open up etc/rc.d/rc.shutdown and look for the following block of code (approx. lines 1032 to 1058)
Now change the line:
To:
(your only changing the 1 to a 3)
The problem here is that in the original script STRAYPARTD contains the first column of text for the device (via the 'mount' command), which is the device point. i.e.
This works for block devices but not for NFS mounts (and I am assuming samba mounts as well) because the first column represents the location of the share on the server. i.e.
When you change the 1 to a 3, the script will use the mount point instead of the device. i.e.
And actually unmount the share.
I am in the process of cleaning up that block of code and submitting a proper bug report.
The same thing happens with an NFS mount as well.
Open up etc/rc.d/rc.shutdown and look for the following block of code (approx. lines 1032 to 1058)
Code: Select all
MNTDPARTS="`mount`"
#echo
echo "Unmounting stray filesystems:"
STRAYPARTL="`echo "$MNTDPARTS" |grep -v "/dev/pts" |grep -v "/proc" |grep -v "/sys" |grep -v "tmpfs" |grep -v "rootfs" |grep -v 'on / ' | grep -v "/dev/root" | grep -v "usbfs" | grep -v "unionfs" | grep -v "/initrd"`"
STRAYPARTD="`echo $STRAYPARTL | cut -f 1 -d " " | tr "\n" " "`"
for ONESTRAY in $STRAYPARTD
do
echo "Unmounting $ONESTRAY..."
#091117 weird bug, no processes but when run this, x restarts...
xFUSER="`fuser -m $ONESTRAY 2>/dev/null`" #091117 do this first, seems to fix it.
#[ "$xFUSER" != "" ] && fuser -k -m $ONESTRAY
#100107 if ntfs partition mntd, then process 'ntfs-3g' will be running in it, try to kill it, X restarts...
if [ "$xFUSER" != "" ];then
PSALL="`ps`"
for ONEPROCESS in $xFUSER
do
onPATTERN='^'"$ONEPROCESS"' '
[ "`echo "$PSALL" | grep "$onPATTERN" | grep ' ntfs\-3g '`" != "" ] && continue
kill $ONEPROCESS
done
fi
killzombies #v3.99
sync
umount -r $ONESTRAY
done
Code: Select all
STRAYPARTD="`echo $STRAYPARTL | cut -f 1 -d " " | tr "\n" " "`"
Code: Select all
STRAYPARTD="`echo $STRAYPARTL | cut -f 3 -d " " | tr "\n" " "`"
The problem here is that in the original script STRAYPARTD contains the first column of text for the device (via the 'mount' command), which is the device point. i.e.
Code: Select all
/dev/sda1 on / type ext2 (rw,noatime,errors=remount-ro)
STRAYPARTD=/dev/sda
Code: Select all
192.168.1.250:/home/user on /home/user/nfs type nfs (rw,rsize=8192,wsize=8192,timeo=14,intr,nolock,addr=192.168.1.250)
STRAYPARTD=192.168.1.250:/home/user
Code: Select all
STRAYPARTD=/home/user/nfs
I am in the process of cleaning up that block of code and submitting a proper bug report.
If you have a samba share mounted at shutdown, does your system hang when saving to the pupsave?rcrsn51 wrote:I tried your patch in Quirky with an unmounted Samba share and it didn't make any difference to the shutdown speed. There was still an additional pause of about 10 seconds as compared to when the share was properly unmounted.
My problem was the same as the OP's except I was using NFS rather than samba.
The bug in rc.shutdown for NFS would also apply to a samba mount. Whether the busybox 'umount' command can unmount the samba share properly I'm not sure. I'm unfamiliar with using samba on puppy.
If your system does not hang then there is no reason to modify the shutdown script.
Sorry. I didn't explain that very well. If I leave a Samba share mounted at shutdown, there is a hang-up of about 10 seconds. But Puppy will still shut down. Applying your patch didn't change this.
If I unmount the Samba share using the regular busybox umount command, Puppy shuts down normally.
I am mounting the share at some conventional place in the file system, as opposed to JJohnson's use of /tmp. However, using /tmp definitely causes a complete hangup.
If I unmount the Samba share using the regular busybox umount command, Puppy shuts down normally.
I am mounting the share at some conventional place in the file system, as opposed to JJohnson's use of /tmp. However, using /tmp definitely causes a complete hangup.
2lss wrote:How are you mounting the samba share?
Code: Select all
mount.cifs
I see what you mean.
Using Puppy 4.3, I get both a delay and a system hang.
The delay (approx 20 seconds) occurs at the "Puppy is now shutting down" message.
The hang occurs at the "Saving to pupsave...." message, similar to my NFS problem.
I can control+c at this point, unmount the samba share, and poweroff without problem.
I will play around with the shutdown script and see what is causing the problem.
Using Puppy 4.3, I get both a delay and a system hang.
The delay (approx 20 seconds) occurs at the "Puppy is now shutting down" message.
The hang occurs at the "Saving to pupsave...." message, similar to my NFS problem.
I can control+c at this point, unmount the samba share, and poweroff without problem.
I will play around with the shutdown script and see what is causing the problem.