Right. As the manpage states, inactive units are not considered: "Units
which are not active and are not in a failed state usually are not
loaded, and will not be matched by any pattern."
This isn't a behaviour that we can or want to change downstream, so
closing. Thanks!
** Changed in: systemd (Ubuntu)
Status: New => Won't Fix
--
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1627612
Title:
systemctl restart xxx* does not restart inactive services
Status in systemd package in Ubuntu:
Won't Fix
Bug description:
Man pages of systemctl indicates that the start, restart, status takes
in [PATTERN], which accepts wildcard.
However, for an inactive service, it does not work UNLESS --all is
provided, which does not make sense for a command like restart. If one
wants to restart only if service is active, there is the try-restart
command.
To replicate
1. Stop a service. `systemctl stop sysstat.service`
2. Restart with wildcard. `systemctl restart sysstat*`
3. Check service status. It should still be inactive.
4. Restart with --all wildcard. `systemctl restart --all sysstat*`
5. Check again, service should have been started.
More logs below
root@notifications-m:~# systemctl status sysstat.service
● sysstat.service - LSB: Start/stop sysstat's sadc
Loaded: loaded (/etc/init.d/sysstat; bad; vendor preset: enabled)
Active: active (exited) since Mon 2016-09-26 16:22:02 AEST; 48min ago
Docs: man:systemd-sysv-generator(8)
Process: 3607 ExecStop=/etc/init.d/sysstat stop (code=exited,
status=0/SUCCESS)
Process: 3809 ExecStart=/etc/init.d/sysstat start (code=exited,
status=0/SUCCESS)
Tasks: 0
Memory: 0B
CPU: 0
Sep 26 16:22:02 notifications-m systemd[1]: Starting LSB: Start/stop
sysstat's sadc...
Sep 26 16:22:02 notifications-m systemd[1]: Started LSB: Start/stop sysstat's
sadc.
root@notifications-m:~# systemctl stop sysstat.service
root@notifications-m:~# systemctl status sysstat.service
● sysstat.service - LSB: Start/stop sysstat's sadc
Loaded: loaded (/etc/init.d/sysstat; bad; vendor preset: enabled)
Active: inactive (dead) since Mon 2016-09-26 17:10:16 AEST; 1s ago
Docs: man:systemd-sysv-generator(8)
Process: 8228 ExecStop=/etc/init.d/sysstat stop (code=exited,
status=0/SUCCESS)
Process: 3809 ExecStart=/etc/init.d/sysstat start (code=exited,
status=0/SUCCESS)
Sep 26 16:22:02 notifications-m systemd[1]: Starting LSB: Start/stop
sysstat's sadc...
Sep 26 16:22:02 notifications-m systemd[1]: Started LSB: Start/stop sysstat's
sadc.
Sep 26 17:10:16 notifications-m systemd[1]: Stopping LSB: Start/stop
sysstat's sadc...
Sep 26 17:10:16 notifications-m systemd[1]: Stopped LSB: Start/stop sysstat's
sadc.
(reverse-i-search)`restar': systemctl ^Cstart --all
ceilometer-agent-notification*
root@notifications-m:~# systemctl restart sysstat*
root@notifications-m:~# systemctl status sysstat.service
● sysstat.service - LSB: Start/stop sysstat's sadc
Loaded: loaded (/etc/init.d/sysstat; bad; vendor preset: enabled)
Active: inactive (dead) since Mon 2016-09-26 17:10:16 AEST; 16s ago
Docs: man:systemd-sysv-generator(8)
Process: 8228 ExecStop=/etc/init.d/sysstat stop (code=exited,
status=0/SUCCESS)
Process: 3809 ExecStart=/etc/init.d/sysstat start (code=exited,
status=0/SUCCESS)
Sep 26 16:22:02 notifications-m systemd[1]: Starting LSB: Start/stop
sysstat's sadc...
Sep 26 16:22:02 notifications-m systemd[1]: Started LSB: Start/stop sysstat's
sadc.
Sep 26 17:10:16 notifications-m systemd[1]: Stopping LSB: Start/stop
sysstat's sadc...
Sep 26 17:10:16 notifications-m systemd[1]: Stopped LSB: Start/stop sysstat's
sadc.
root@notifications-m:~# systemctl restart --all sysstat*
root@notifications-m:~# systemctl status sysstat.service
● sysstat.service - LSB: Start/stop sysstat's sadc
Loaded: loaded (/etc/init.d/sysstat; bad; vendor preset: enabled)
Active: active (exited) since Mon 2016-09-26 17:10:39 AEST; 1s ago
Docs: man:systemd-sysv-generator(8)
Process: 8228 ExecStop=/etc/init.d/sysstat stop (code=exited,
status=0/SUCCESS)
Process: 8250 ExecStart=/etc/init.d/sysstat start (code=exited,
status=0/SUCCESS)
Sep 26 17:10:39 notifications-m systemd[1]: Starting LSB: Start/stop
sysstat's sadc...
Sep 26 17:10:39 notifications-m systemd[1]: Started LSB: Start/stop sysstat's
sadc.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1627612/+subscriptions
--
Mailing list: https://launchpad.net/~touch-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~touch-packages
More help : https://help.launchpad.net/ListHelp