Artix Linux Forum

Init systems => dinit => Topic started by: dd8c553c757a9f188a8e04741 on 26 October 2024, 12:08:39

Title: service root-ro command failed with exit code 1
Post by: dd8c553c757a9f188a8e04741 on 26 October 2024, 12:08:39
Code: [Select]
Service root-ro command failed with exit code 1
Service random-seed stop command failed with exit code 20
All services have stopped with no shutdown issued; boot failure?
When I choose "restart boot sequence" it boots with no errors. Using custom kernel with EFIstub.
Title: Re: service root-ro command failed with exit code 1
Post by: kiblaster on 26 October 2024, 19:02:29
You can copy /lib/dinit.d/root-ro in /etc/dinit.d and add logfile:
Code: [Select]
type    = scripted
command = /bin/mount -o remount,ro,rshared /
restart = false
logfile = /var/log/dinit/root-ro.log
Or directly in /lib.
So that you get the complete error.
Title: Re: service root-ro command failed with exit code 1
Post by: dd8c553c757a9f188a8e04741 on 26 October 2024, 20:40:02
You can copy /lib/dinit.d/root-ro in /etc/dinit.d and add logfile:
Code: [Select]
type    = scripted
command = /bin/mount -o remount,ro,rshared /
restart = false
logfile = /var/log/dinit/root-ro.log
Or directly in /lib.
So that you get the complete error.
Now it shows
Code: [Select]
root-ro: execution failed - opening log file: Read-only file system
Title: Re: service root-ro command failed with exit code 1
Post by: davmac on 27 October 2024, 11:57:59
You can copy /lib/dinit.d/root-ro in /etc/dinit.d and add logfile:

That typically doesn't work for very early services where the filesystem is still read-only, because the logfile can't be opened for writing in that case.

Options are:

Code: [Select]
log-type = buffer

OR

Code: [Select]
options = starts-on-console

In the first case you need to use
Code: [Select]
dinitctl catlog root-ro
to see the log (so it requires that you do manage to boot successfully, which I gather is the case). The 2nd one will hopefully show the error on the console (and hopefully it won't scroll off before you can read it).

These options are documented in the manual so check that for more information.
Title: Re: service root-ro command failed with exit code 1
Post by: dd8c553c757a9f188a8e04741 on 27 October 2024, 13:21:55
It outputs
Code: [Select]
mount: /: can't find UUID=62d1f155-...
I double checked UUID and it matches with the one from blkid. So I've put '/dev/sda2' instead of UUID in /etc/fstab and now it boots with no errors. But is there any way to check why it can't find UUID and PARTUUID of the disk? I am testing this on the qemu vm so maybe it's a vm thing.
Thank you.
Title: Re: service root-ro command failed with exit code 1
Post by: davmac on 28 October 2024, 23:04:44
I double checked UUID and it matches with the one from blkid. So I've put '/dev/sda2' instead of UUID in /etc/fstab and now it boots with no errors. But is there any way to check why it can't find UUID and PARTUUID of the disk? I am testing this on the qemu vm so maybe it's a vm thing.
Thank you.

You'd have to look into what the mount utility is actually doing to figure that out. I don't think I can help any further, sorry. Good that you have a workaround solution anyway.

(My guess is that it's some kind of race where the UUID/PARTUUID isn't available yet. Maybe the kernel is still reading the partition table at that point. You could try wrapping the mount command in a script and insert a small delay before "mount" via "sleep", but that's not a very satisfactory solution either.)