Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Broken OpenRC while trying to break OpenRC
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
Leonardo.b
Apprentice
Apprentice


Joined: 10 Oct 2020
Posts: 294

PostPosted: Thu Feb 11, 2021 11:34 pm    Post subject: Broken OpenRC while trying to break OpenRC Reply with quote

"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.

Code:
mount -o remount /

... 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
View user's profile Send private message
psycho
Guru
Guru


Joined: 22 Jun 2007
Posts: 534
Location: New Zealand

PostPosted: Sat Feb 13, 2021 9:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54174
Location: 56N 3W

PostPosted: Sat Feb 13, 2021 9:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
Leonardo.b
Apprentice
Apprentice


Joined: 10 Oct 2020
Posts: 294

PostPosted: Sat Feb 13, 2021 11:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
psycho
Guru
Guru


Joined: 22 Jun 2007
Posts: 534
Location: New Zealand

PostPosted: Sun Feb 14, 2021 1:09 am    Post subject: Reply with quote

Ye gods...somehow I never noticed that only e.g.
Code:
mount /mnt/b1
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 :roll:
Back to top
View user's profile Send private message
figueroa
Advocate
Advocate


Joined: 14 Aug 2005
Posts: 2942
Location: Edge of marsh USA

PostPosted: Sun Feb 14, 2021 5:17 am    Post subject: Reply with quote

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
View user's profile Send private message
Leonardo.b
Apprentice
Apprentice


Joined: 10 Oct 2020
Posts: 294

PostPosted: Sun Feb 14, 2021 3:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum