Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Proper way to "overload" parts of a service provided by s6-scripts (Read 612 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

[SOLVED] Proper way to "overload" parts of a service provided by s6-scripts

I have some zfs services that I use to import and unlock my zfs pools, however when the s6-scripts pkg gets updated it overwrites the mount-filesystems dependencies, is there a proper way this is supposed to be handled? Otherwise I'd lean towards making a pacman hook.

Re: Proper way to "overload" parts of a service provided by s6-scripts

Reply #1
If you need to explicitly modify the mount-filesystems dependencies file, yeah there's not really a good way to do this. Currently, lvm-s6 and cryptsetup-s6 do this via a pacman install script. It's basically a hack but it works.

However, the good news is that the upcoming version of s6-rc will fix this. Instead of using a dependencies file, the new format is to have a dependencies.d directory (Bundle contents also will use contents.d instead of a contents file). Within that directory, you just make empty files with the names of the services you want to depend on. This makes life way better for all of us. Pacman only owns the empty files/directories and users can freely add new dependencies if they want without me as maintainer having to use the backup feature and/or overwriting it on every upgrade.

It's currently implemented in the git master branch of s6-rc. I'm just waiting for skalibs and s6-rc to get a version bump (hopefully soonish), but I plan to switch to the new format ASAP since it lets me fix/improve a lot of backend stuff.

Re: Proper way to "overload" parts of a service provided by s6-scripts

Reply #2
Sorry for the delay on this. This change would have caused a breakage if one was updating from the old stable iso (July 2021) because that had a bug (fixed many months ago of course) in one of the scripts. Since we now have a new iso release, making this change is safe and long overdue. I've now reworked s6-scripts as well as all of our *-s6 scripts in the repos to use the new s6-rc format. Currently these are all sitting in our staging repos and should make their way to stable soon.

Instead, mount-filesystems will be in the /etc/s6/adminsv directory (to indicate that it's OK to make changes) and will look like this:
mount-filesystems
 ├── type
 ├── up
 └── dependencies.d
         ├── modules
         ├── mount-tmpfs
         └── udevadm

In mount-filesystems/dependencies.d, those are all just empty files. The only thing that matters is their name. So in your case, all you need to do is touch the zfs services you want to be dependencies and that's it. You'll never have to worry about s6-scripts overwriting your dependencies again.

As an aside, the default bundle will work like this as well. I'll move towards encouraging users to use this method (touching empty files) to add services to the default bundle instead of using s6-rc-bundle. The latter will always be around for as long as upstream provides the tool, but touching files is more reliable (and recommended).

Re: Proper way to "overload" parts of a service provided by s6-scripts

Reply #3
Got delayed yet again. :P The above changes have landed in stable now so I will make this as solved.