[artix-general] Are dinit service files protected from overwriting on upgrades?

Javier je-vv at e.email
Fri May 23 08:53:28 CEST 2025


Hello !

I'm using "chrony" calling "chronyd" with "-r -s" options as shown on the chrony wiki [1] so that the RTC can be corrected on boot after deviations given the time the PD being turned off.  But there's no easy way to do this on dinit like the systemd unit which reads the OPTIONS environment variable from "/etc/sysconfig/chronyd" as suggested by the referred wiki and also part of the systemd unit [2].

So what I did to pass those options to "chronyd" was to add them to the service file itself "/etc/dinit.d/chronyd":

> command         = /usr/bin/chronyd -r -s -n

Notice how this can be lost without warning if on an upgrade the service file gets overwritten.

So that brought me to ask if files under "/etc/dinit.d" in general are protected from being overwritten, getting instead a "pacnew" extension on the new files but keeping the prior one to the upgrade.  That if I got it right gets specified on "backup" array of files to be protected.  But I don't know if there's a more generic way to do so for things on "/etc".  That said the "chrony-dinit" PKGBUILD [3] doesn't include any backup array.

If there's a better way to achieve what I'm looking for without risking losing my changes, please let me know.  Or perhaps the "chrony-dinit" package can be improved to allow such daemon options that's valid as well, :)

Thanks !

-- 
Javier


[1]  https://wiki.archlinux.org/title/Chrony#Example:_intermittently_running_desktops
[2]  https://gitlab.com/chrony/chrony/-/blob/master/examples/chronyd.service#L13
[3]  https://gitea.artixlinux.org/packages/chrony-dinit/src/branch/master/PKGBUILD


More information about the artix-general mailing list