Skip to main content
Topic: Init scripts backup & customization (Read 547 times) previous topic - next topic
0 Members and 5 Guests are viewing this topic.

Init scripts backup & customization

Hi all!
Although i encountered this problem several times long ago, this time made me report this as issue. This is not a dinit-specific, but as long as i encountered it with dinit, i'll leave it here.
So, this is a list of issues i want to address:
0) All init scripts and their configs should be backed up at pacman level. After all, Artix is about freedom of choice and there is a high chance for a user to edit init scripts to fit their needs.
1) dhcpcd script runs dhcpcd on all interfaces - if i have several interfaces, not all of them work as clients, some are used as dhcp servers. As a result of this dhcpcd behavior these server interfaces get client ip and may even break default route.
2) dhcpd script also tries to run on all interfaces and may fail to do so resulting into dhcp daemon not running at all. Additionally, manual ip address setting is required prior to running dhcpd.
3) slapd script is broken by 2>&1 line. Additionally, it uses /etc/openldap/slapd.conf as default config which uses outdated config format. I manually set -F key to use config directory format
4) gitea fails to start unless i pass its service USER, PATH and HOME environment variables
I'm sure this is not a full list of possible problems to address. The former is an absolutely must-have since it allows users to safely customize their systems without expecting it to break because pacman overwrote some init scripts.
ARMtix

Re: Init scripts backup & customization

Reply #1
0) All init scripts and their configs should be backed up at pacman level. After all, Artix is about freedom of choice and there is a high chance for a user to edit init scripts to fit their needs.

The main problem would be twofold: 1. dependencies on dinit stage 1 (or core services), since it can and will change (and is not yet stabilised), I'm closely monitoring dinit issue #245 right now and if/when it is standardised, I'm planning for Artix to use the standard set instead, since all of Artix dinitscripts depend on the core services' naming scheme - and 2. the default flags of the programs managed by dinit can change. Users wishing to customise the dinitscripts are encouraged to copy it as service-personal instead, but they're on their own.

1) dhcpcd script runs dhcpcd on all interfaces - if i have several interfaces, not all of them work as clients, some are used as dhcp servers. As a result of this dhcpcd behavior these server interfaces get client ip and may even break default route.
2) dhcpd script also tries to run on all interfaces and may fail to do so resulting into dhcp daemon not running at all. Additionally, manual ip address setting is required prior to running dhcpd.
I might have something in mind on these but it won't work as it stands, but I'll have to open an issue in the dinit github. (EDIT: See https://github.com/davmac314/dinit/issues/258)

3) slapd script is broken by 2>&1 line. Additionally, it uses /etc/openldap/slapd.conf as default config which uses outdated config format. I manually set -F key to use config directory format
Can you test openldap-dinit-20231104? It's on [system-gremlins].

4) gitea fails to start unless i pass its service USER, PATH and HOME environment variables
I've been meaning to use load-options for gitea service, but can't find any testers for the update. I'll try to update this service.

The former is an absolutely must-have since it allows users to safely customize their systems without expecting it to break because pacman overwrote some init scripts.
Unfortunately I'll have to disagree, see above.
now only the dinit guy in artix

Re: Init scripts backup & customization

Reply #2
Users wishing to customise the dinitscripts are encouraged to copy it as service-personal instead, but they're on their own.
Sounds questionable, it may lead to actually rewriting a lot of services because if i want to change on of them but others depends on it, and then more services depend on them.

Can you test openldap-dinit-20231104? It's on [system-gremlins].
Didn't work, i suspect there is some substitution issue.
ARMtix

Re: Init scripts backup & customization

Reply #3
I don't know the details of the dinit implementation, but for s6 I opted to make conf files part of the pacman backup but not the actual scripts. The main reason being that some services absolutely require certain arguments to work so I wanted to make sure that the actual package file is always correct and not influenced by any stray pacman backup files or such.

For arguments users may want to change, they edit the conf which is backed up so it doesn't change on update. In the past there were some issues which overwriting services and such, but with s6-rc + artix implementation changes, I think I've smoothed most of them out and haven't really heard any complaints of that nature in a long time.

Re: Init scripts backup & customization

Reply #4
I don't know the details of the dinit implementation, but for s6 I opted to make conf files part of the pacman backup but not the actual scripts. The main reason being that some services absolutely require certain arguments to work so I wanted to make sure that the actual package file is always correct and not influenced by any stray pacman backup files or such.

That's also how it works in dinit (and also standard, so it should work that way in runit and openrc). The config files are backed up by pacman, but the actual scripts aren't backed up. Unfortunately in some cases just using $OPTS in config file for optional additional configuration might not be possible due to https://github.com/davmac314/dinit/issues/258
now only the dinit guy in artix