:: Re: [DNG] runit: unclean shutdown?
Top Page
Delete this message
Reply to this message
Author: Steve Litt
Date:  
To: dng
Subject: Re: [DNG] runit: unclean shutdown?
Henry Jensen via Dng said on Mon, 13 Mar 2023 17:03:39 +0100

>Hi STeve
>
>Am Sun, Mar 12, 2023 at 10:47:39PM -0400 schrieb Steve Litt:
>
>
>> To start, I'll post my 3 shellscript, and perhaps you'll see
>> something mine has that yours doesn't.
>
>
>Curious, my /etc/runit/3 looks completely different. The last line is
>
>/etc/init.d/rc 0
>
>which should execute all K* scripts in /etc/rc0.d/, including the
>unmount stuff. But obiviously this fails somehow.
>
>However, I added now some excerpts from you script before the last
>line:
>
> halt -w # for wtmp
> udevadm control --exit
> pkill --inverse -s0,1 -TERM
> sleep 1
> pkill --inverse -s0,1 -KILL
> swapoff -a
> umount -r -a -t nosysfs,noproc,nodevtmpfs,notmpfs
> mount -o remount,ro /
>
>It seems that this does the trick, no complains from the root partion
>at boot now. Thank you.


I think you should add that stuff *after* killing all the daemons so
those daemons can write any final stuff to disk as they exit. Just for
fun, you might want to put that stuff in /etc/init.d/rc for
runlevel 0, after the K scripts all run. Also, some of my stuff might
duplicate the stuff you already have in your rc file for runlevel 0.

Last but not least, you might want to add a sync command after
remounting it readionly, and like Didier said, unless you're actually
keeping track of access times, you might want to have noatime in the
remount (and perhaps your /etc/fstab).

If I were going to add a bunch of stuff to my rc file, I'd put the
stuff in a shellscript and simply call the shellscript from the rc
file. This way, when the distro replaces your rc file, you need only to
add a single line.

SteveT

Steve Litt
Autumn 2022 featured book: Thriving in Tough Times
http://www.troubleshooters.com/bookstore/thrive.htm