Unclean Unmounts

The home office computer is a pseudo server as well as a desktop. Seldom do I boot that system into runlevel 1.

I was tinkering one day. I booted directly into runlevel 1. I did not elevate to runlevel 3 and instead rebooted. I noticed that some of the mount points failed to unmount.

The following mount points did not unmount when booting directly to init 1:

  • /
  • /home
  • /home/public

All local mount points are unmounted in /etc/rc.d/rc.6.

Down the rabbit hole I ventured.

When I booted to runlevel 3, dropped to init 1, and rebooted, those mount points unmounted just fine. When I booted directly to runlevel 1 and rebooted, those mount points failed to unmount.

Everything unmounted fine when I booted directly to runlevel 1 and manually unmounted /home/public. I did not see anything in /home/public that would keep files open, but possibly I was overlooking something.

Some hours later I finally found the bug. In the original rc.6 script is a sleep 5 command after sending all processes the SIGTERM signal. I had changed the time to 1 second because I wanted reboots and shutdowns to move a bit faster.

For some reason the office computer did not like that shorter waiting period. I reverted to the original 5 seconds and eventually whittled the time to 2 seconds. Every time I tried 1 second the mount points failed to unmount.

I made that change a long time ago. Unless something else broke recently to contribute to this bug, that means from runlevel 1 the office system had not been cleanly unmounting those mount points for the same long time. Not that I would notice because I seldom booted directly to runlevel 1 on that computer.

I don’t know why booting to runlevel 3 and dropping to init 1 did not invoke the bug whereas booting directly to runlevel 1 did. That difference likely is why I would not notice the bug.

I could add an if-then test for runlevel 1 before using the two second delay, but for now I now I live with a two second delay.

Posted: Category: Usability Tagged: Slackware

Next: The Holy Grail of Technical Writing

Previous: A Keystone Kops Day