[systemd-devel] systemctl is-enabled...

Andrey Borzenkov arvidjaar at mail.ru
Tue Mar 8 10:23:44 PST 2011


On Mon, Mar 7, 2011 at 4:00 AM, Lennart Poettering
<lennart at poettering.net> wrote:
> What about this solution consisting of these 4 rules together:
>
> 1. A service residing in /lib with no [Install] section will
>   unconditionally be considered enabled.
> 2. A service which has at least one symlink to it in /etc is considered
>   enabled.
> 3. Symlinks in /lib are irrelevant
> 4. We'd not recursively traverse tree
>
> That way dbus would always appear enabled due to rule #1.
>

What to do with aliases?

[root at localhost ~]# systemctl -p Names -p Id --no-pager show dm.service
Id=prefdm.service
Names=display-manager.service prefdm.service dm.service
[root at localhost ~]# systemctl is-enabled dm.service
dm.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig dm
[root at localhost ~]# echo $?
1

Well ...

dm.service is obviously enabled; even if it is enabled under different alias

BTW /etc/init.d/dm actually is enabled ... just in different run level.

In any case, whatever systemctl does, it probably needs be consistent

[root at localhost ~]# systemctl is-enabled display-manager.service
Refusing to operate on symlinks, please pass unit names or absolute
paths to unit files.

One is Names and another one is link.


More information about the systemd-devel mailing list