View previous topic :: View next topic |
Author |
Message |
Leonardo.b Guru
Joined: 10 Oct 2020 Posts: 308
|
Posted: Thu Feb 11, 2021 11:34 pm Post subject: Broken OpenRC while trying to break OpenRC |
|
|
"You were warned" someone will say - so I say it first instead.
Saturday I managed to install runit as a fallback for when OpenRC breaks; and so it turned out that I didn't have any reason anymore to not try any sort of silly experiment with OpenRC.
Where 'silly experiments' means to replace all the /etc/init.d/* script with custom ones; to downgrade the version from 0.42 to 0.17; to use s6-init as an alternative to sysvinit (reverted back from this last one).
Of course I have broken everything.
Now I'm back at the point where things almost work - but...
rootfs can't be mounted read-write.
... works, if I do it by hand on the console. dmesg reports the event.
Code: | #!/sbin/openrc-run
start(){
mount -o remount /
mount -o remount <partition>
} |
... works when <partition> has a special filesystems - proc, sys, tmpfs.
The script does nothing for / (ext4), boot (FAT32).
May I ask you: do you know why?
As always in troubles,
Leonardo |
|
Back to top |
|
|
psycho Guru
Joined: 22 Jun 2007 Posts: 542 Location: New Zealand
|
Posted: Sat Feb 13, 2021 9:03 pm Post subject: |
|
|
Maybe Code: | mount -o remount,rw / | ? I feel like I've had to specify that at some point, even though it's the default. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54577 Location: 56N 3W
|
Posted: Sat Feb 13, 2021 9:12 pm Post subject: |
|
|
Leonardo.b,
Your script should force mount to consult /etc/fstab. What do you have there for root and boot? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Leonardo.b Guru
Joined: 10 Oct 2020 Posts: 308
|
Posted: Sat Feb 13, 2021 11:17 pm Post subject: |
|
|
NeddySeagoon,
yet another time you are right.
Code: | #!/sbin/openrc-run
start(){
mount --options-source-force -o remount /
} |
... works correctly, it reads UUIDs from fstab, and it mounts root and friends as expected.
I'm sure there is something else it is not working, but for today this is all; thanks very much.
Leonardo |
|
Back to top |
|
|
psycho Guru
Joined: 22 Jun 2007 Posts: 542 Location: New Zealand
|
Posted: Sun Feb 14, 2021 1:09 am Post subject: |
|
|
Ye gods...somehow I never noticed that only e.g.actually parses fstab at all...I've been assuming that e.g Code: | mount /dev/sdb1 /mnt/b1 | still pulled in any mount options specified there, despite the obviously redundant length of the instruction for a mount described in fstab |
|
Back to top |
|
|
figueroa Advocate
Joined: 14 Aug 2005 Posts: 3005 Location: Edge of marsh USA
|
Posted: Sun Feb 14, 2021 5:17 am Post subject: |
|
|
I'm pretty sure OpenRC doesn't need a fallback for when it doesn't work, but I'm open to learn. What's the use case when this might be useful? _________________ Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi |
|
Back to top |
|
|
Leonardo.b Guru
Joined: 10 Oct 2020 Posts: 308
|
Posted: Sun Feb 14, 2021 3:05 pm Post subject: |
|
|
psycho,
generally the mount command works reading fstab.
In the init script, it doesn't. I don't know why. Why?
figueroa,
a second init may be useful, like keeping an old kernel.
If something breaks (after an upgrade, or bad administration), you can reboot with "init=another-init", and fix OpenRC another day.
I'm just writing back what I read somewhere else.
There are a lot of use case for writing your own init services instead of using the default ones. They can do whatever you like, so the use cases are infinite.
For me personally, I was curious to see how OpenRC works behind the scenes - and that's all.
The command above is just a replacement for other existing services, and there is no benefit I gained from it.
My console, x, and wireless service instead are tweaked.
"wireless" for example loads and unloads the iwlwifi kernel modules on start and stop.
Not so much, but useful.
Leonardo |
|
Back to top |
|
|
|