Public bug reported: 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. ** Affects: systemd (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1627612 Title: systemctl restart xxx* does not restart inactive services To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1627612/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs