Bug#759001: [systemd-devel] sysv-generator: doesn't handle /etc/insserv/overrides or /etc/chkconfig.d

Michael Biebl biebl at debian.org
Tue Feb 17 11:31:58 GMT 2015


Hi Christian,


Am 17.02.2015 um 01:08 schrieb Christian Seiler:

> Only minor issue is that SourcePath= is a single-valued entry in
> systemd, so I can't just add the override if it exists, and
> FragmentPath= is only ever dynamically filled by systemd when parsing,
> so I can't set that either. It's mostly cosmetic, but systemctl status
> for example won't show that the file was overwritten.
> 
> (Alternatively, one could ONLY use /etc/insserv/overrides/$NAME as
> SourcePath=, of course, I don't have a strong opinion on either one of
> these solutions.)

Hm, right. It would be nice to show that information in "systemctl
status". Doesn't look like we could use DropInPaths= either.

We could log this information, but this is frowned upon from a
generator. (That said, the default-display-manager generator does use
logging, and we didn't have any bug reports caused by that, so far)

Somehow I think we should make clear though, that this is a transitional
measure and parsing of insserv overrides is not going to be supported
forever.

>> We are pretty late into the freeze though, so this would
>> require an ack from our release managers.
> 
> Do you want me to ask for pre-approval?

Yes, that would be appreciated.
Please ask them, if such a patch would be accepted
given the current limitations of unsetting orderings/dependencies via
drop-ins.

> @@ -776,7 +779,7 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) {
>                  while ((de = readdir(d))) {
>                          SysvStub *service;
>                          struct stat st;
> -                        _cleanup_free_ char *fpath = NULL, *name = NULL;
> +                        _cleanup_free_ char *fpath = NULL, *name = NULL, *override_fpath = NULL;
>                          int r;
>  
>                          if (ignore_file(de->d_name))
> @@ -792,6 +795,15 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) {
>                          if (!(st.st_mode & S_IXUSR))
>                                  continue;
>  
> +                        override_fpath = strjoin(SYSV_OVERRIDE_PATH, de->d_name, NULL);
> +                        if (!override_fpath)
> +                                return log_oom();
> +
> +                        if (stat(override_fpath, &st) < 0) {
> +                                free(override_fpath);
> +                                override_fpath = NULL;
> +                        }


> -                        name = fpath = NULL;
> +                        name = fpath = override_fpath = NULL;

With _cleanup_free_, I think explicitly freeing override_fpath is not
necessary.

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20150217/f8747069/attachment-0002.sig>


More information about the Pkg-systemd-maintainers mailing list