[systemd-devel] [PATCH 1/2] systemctl: Don't skip native units when enabling/disabling SysV init.d scripts
Martin Pitt
martin.pitt at ubuntu.com
Wed May 27 06:26:03 PDT 2015
Lennart Poettering [2015-05-27 15:18 +0200]:
> If we do this, then I'd like to go all the way right-away: strip
> chkconfig support if we add support for the new hook.
OK.
> > + if (!isempty(arg_root) && !streq(arg_root, "/")) {
> > + log_error("Can not %s SysV init script when a root directory other than / is specified", verb);
> > + continue;
> > + }
>
> Hmm, this makes me feel a bit uneasy about the LSB support... If
> neither "is-enabled" nor "--root=" can covered by the LSB tool, I
> wonder if we should use it at all...
You give it the full path, so we could also just invoke it with
path_join(arg_root, p).
As for is-enabled, since that doesn't exist anywhere we could try and
call /usr/lib/lsb/initd_enabled.
> Also, as it appears the LSB tool only takes a single script per
> invocation, which is also incompatible with how we need it...
I didn't see that being used anywhere in the systemd source, did I
miss anything? If so, you can always call stuff in a loop instead, no?
> Maybe introducing a new tool for this that covers all options is the
> better idea. Let's call it /usr/lib/systemd/systemd-sysv-install or
> so, taking the --root= switch as before, plus "enable", "disable",
> "is-enabled" plus one or more LSB init script names is the better
> option... Distros implementing LSB can then direct this tool to the
> LSB tools if they wish, and Fedora can translate this to chkconfig,
> without losing any functionality...
I kinda like adhering to LSB, at least where it makes sense; obviously
we don't have a specification for is-enabled, so we have to make up
one (/usr/lib/lsb/initd_enabled), but for enable/disable it seems
quite fine?
But if you still say you want /usr/lib/systemd/systemd-sysv-install
I'll implement it that way. I care more about getting some abstraction
than getting an LSB compatible one :-)
Thanks,
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
More information about the systemd-devel
mailing list