The officially official Devuan Forum!

You are not logged in.

#1 2024-12-21 21:19:02

francesco
Member
Registered: 2024-12-21
Posts: 5  

Which runlevel for umountfs and umountroot (via sysv-rc-conf)?

Hello everybody, i'll get straigth to the point: i need umountfs and umountroot unmounting the filesystem at shutdown and reboot, so i've setted them both on 0 and 6, but it doesn't work, since at every boot the system recovers the journal. Please can someone help me? Many thanks!

Offline

#2 2024-12-21 21:50:16

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 667  

Re: Which runlevel for umountfs and umountroot (via sysv-rc-conf)?

Hi, Not sure if this will help, but on my open-rc system both of those files have no start and stop is 0 and 6

/etc/init.d/umountroot

#! /bin/sh
### BEGIN INIT INFO
# Provides:          umountroot
# Required-Start:
# Required-Stop:
# Should-Stop:       halt reboot kexec
# Default-Start:
# Default-Stop:      0 6
# Short-Description: Mount the root and /usr filesystems read-only.
### END INIT INFO

---snip---

added /etc/init.d/umountnfs.sh

#! /bin/sh
### BEGIN INIT INFO
# Provides:          umountnfs
# Required-Start:
# Required-Stop:     umountfs
# Should-Stop:       $network $portmap nfs-common
# Default-Start:
# Default-Stop:      0 6
# Short-Description: Unmount all network filesystems except the root fs.
# Description:       Also unmounts all virtual filesystems (proc,
#                    devpts, usbfs, sysfs) that are not mounted at the
#                    top level.
### END INIT INFO

I added the header for the files because they have different deps... (should stop)

Last edited by GlennW (2024-12-21 21:53:12)


pic from 1993, new guitar day.

Offline

#3 2024-12-22 11:39:56

francesco
Member
Registered: 2024-12-21
Posts: 5  

Re: Which runlevel for umountfs and umountroot (via sysv-rc-conf)?

Hello again, i've setted 0 and 6 on "Default-Stop" but i still doesn't unmount the filesystems:
                               
#! /bin/sh
### BEGIN INIT INFO
# Provides:          umountfs
# Required-Start:
# Required-Stop:     umountroot
# Default-Start:        0 6
# Default-Stop:
# Short-Description: Turn off swap and unmount all local file systems.
# Description:
### END INIT INFO

#! /bin/sh
### BEGIN INIT INFO
# Provides:          umountroot
# Required-Start:
# Required-Stop:
# Should-Stop:       halt reboot kexec
# Default-Start:      0 6
# Default-Stop:
# Short-Description: Mount the root and /usr filesystems read-only.
### END INIT INFO

#! /bin/sh
### BEGIN INIT INFO
# Provides:          umountnfs
# Required-Start:
# Required-Stop:     umountfs
# Should-Stop:       $network $portmap nfs-common
# Default-Start:      0 6
# Default-Stop:
# Short-Description: Unmount all network filesystems except the root fs.
# Description:       Also unmounts all virtual filesystems (proc,
#                    devpts, usbfs, sysfs) that are not mounted at the
#                    top level.
### END INIT INFO

Offline

#4 2024-12-22 11:40:30

francesco
Member
Registered: 2024-12-21
Posts: 5  

Re: Which runlevel for umountfs and umountroot (via sysv-rc-conf)?

Sorry, i meant "Default-Start".

Offline

#5 2024-12-23 21:51:22

francesco
Member
Registered: 2024-12-21
Posts: 5  

Re: Which runlevel for umountfs and umountroot (via sysv-rc-conf)?

Sorry again, i've just messed up the whole matter. To put it simply: umountfs and umountroot don't unmount filesystems at shutdown/reboot (therefore resulting in a filesystem recovering at each boot - so if i want to avoid recovering i have to switch to runlevel 1 and unmount filesystems read-only before shutdown/reboot every time [all done via sysrq] -): i've setted these services in runlevels 2,3,4,5 without success (no unmounting at all); then i've tried runlevels 0,6 and still nothing. I've also tries runlevel S and again all runlevels (both services setted on 1,2,3,4,5,0,6 and S). Still nothing.

Offline

#6 2024-12-23 22:20:41

fsmithred
Administrator
Registered: 2016-11-25
Posts: 2,564  

Re: Which runlevel for umountfs and umountroot (via sysv-rc-conf)?

For reference, here's what mine look like (using sysvinit). I think they look the same as what GlennW posted, except I put the files in alphabetical order.
Note that it uses Default-Stop, not Default-Start.

#! /bin/sh
### BEGIN INIT INFO
# Provides:          umountfs
# Required-Start:
# Required-Stop:     umountroot
# Default-Start:
# Default-Stop:      0 6
# Short-Description: Turn off swap and unmount all local file systems.
# Description:
### END INIT INFO
#! /bin/sh
### BEGIN INIT INFO
# Provides:          umountroot
# Required-Start:
# Required-Stop:
# Should-Stop:       halt reboot kexec
# Default-Start:
# Default-Stop:      0 6
# Short-Description: Mount the root and /usr filesystems read-only.
### END INIT INFO

Offline

#7 2025-02-22 13:18:26

francesco
Member
Registered: 2024-12-21
Posts: 5  

Re: Which runlevel for umountfs and umountroot (via sysv-rc-conf)?

Hello again, i edited umountfs script (same as for umountnfs.sh and umountroot):

#! /bin/sh
### BEGIN INIT INFO
# Provides:          umountfs
# Required-Start:
# Required-Stop:     umountroot
# Default-Start:     2 3 4 5
# Default-Stop:      S s 1 0 6
# Short-Description: Turn off swap and unmount all local file systems.
# Description:
### END INIT INFO

And still nothing (filesystems won't unmount); so i installed runit, runit-helper, runit-run and runit-services in order to have runit integrated in sysv (maybe it's useless in this case, but i'll give it a try). So i read the instructions on smarden.org (https://smarden.org/runit/useinit#sysv), which say to add runsvdir-start; so i edited /etc/inittab:

#runit-sysv maintscript -- BEGIN
SV:123456:respawn:/sbin/runsvdir-start
#runit-sysv maintscript -- END

But: i couldn't find runsvdir-start in /sbin, nor in /usr/bin, /bin and /usr/sbin... Has the file been removed from runit's package?

Offline

#8 2025-02-22 14:55:55

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,340  

Re: Which runlevel for umountfs and umountroot (via sysv-rc-conf)?

Note that the scripts don't do anything at start, so your "# Default-Start:  2 3 4 5" are without effects.

Also, umountroot doesn't actually unmount the root filesystem, but it remounts the filesytem root as read-only, and that should be enough to usually avoid fsck on boot-up.

And, I'm sure you wouldn't want unmounting to be done upon "S s 1", and you should restore the normal "# Default-Stop: 0 6".

It appears you are using runit rather than sysvinit? If that's the case I wonder if you have set up it's start/stop configuration to execute those scripts? I believe it's done differently from the sysvinit setup although many sysvinit scripts may be used with runit.

Offline

Board footer