I expect templated units enabled with "systemctl enable" to be queryable with "systemctl is-enabled": # systemctl --version systemd 189 arch +PAM -LIBWRAP -AUDIT -SELINUX -IMA -SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ # uname -a Linux sodium 3.0.42-1-lts #1 SMP Mon Aug 27 19:44:47 CEST 2012 x86_64 GNU/Linux # cat /etc/issue Arch Linux \r (\l) # cat /usr/lib/systemd/system/uwsgi@.service [Unit] Description=uWSGI service for %i After=syslog.target [Service] ExecStart=/usr/bin/uwsgi --ini /etc/uwsgi/%i.ini ExecReload=/bin/kill -HUP $MAINPID KillSignal=SIGINT Restart=always Type=simple [Install] WantedBy=multi-user.target # systemctl enable uwsgi@mediaqueries.service ln -s '/usr/lib/systemd/system/uwsgi@.service' '/etc/systemd/system/multi-user.target.wants/uwsgi@mediaqueries.service' # systemctl status uwsgi@mediaqueries.service uwsgi@mediaqueries.service - uWSGI service for mediaqueries Loaded: loaded (/usr/lib/systemd/system/uwsgi@.service; enabled) Active: active (running) since Mon, 03 Sep 2012 12:29:37 +0200; 3 weeks and 1 days ago Main PID: 21577 (uwsgi) CGroup: name=systemd:/system/uwsgi@.service/mediaqueries ├ 21577 mediaqueries: uWSGI master └ 21578 mediaqueries: uWSGI worker 1 # systemctl is-enabled uwsgi@mediaqueries.service Failed to issue method call: No such file or directory # systemctl is-enabled uwsgi@.service enabled
http://lists.freedesktop.org/archives/systemd-devel/2013-May/011061.html
Applied in http://cgit.freedesktop.org/systemd/systemd/commit/?id=67820a0cbdc.
Instances that are not enabled trigger a "Failed to get unit file state" (No such file or directory), but it seems better to output 'disabled' if their template unite file exists.
I agree that if templates unit file exist "is-enabled" should output "disabled" instead of "Failed to get unit file state". ``` max@max-server % systemctl is-enabled systemd-nspawn@.service disabled max@max-server % systemctl is-enabled systemd-nspawn@test.service Failed to get unit file state for systemd-nspawn@test.service: No such file or directory ``` `systemctl is-enabled systemd-nspawn@test.service` should output "disabled"
All of this got fixed these days afaics, including the issues in the last comment. Closing hence. If any issue remains please open a new bug on github systemd.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.