Skip to content

systemctl reload-or-try-restart does not fail silently as per documentation #688

@coling

Description

@coling

The man page states:

   reload-or-try-restart PATTERN...
       Reload one or more units if they support it. If not, restart them instead.
       This does nothing if the units are not running. Note that, for compatibility
       with SysV init scripts, force-reload is equivalent to this command.

However:

[root@jimmy ~]# systemctl is-active httpd
inactive
[root@jimmy ~]# systemctl reload-or-try-restart httpd
Job for httpd.service invalid.
[root@jimmy ~]# echo $?
1

cf.

[root@jimmy ~]# systemctl try-restart httpd
[root@jimmy ~]# echo $?
0

So it's not behaving as described. This is with systemd 222

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Programming errors, that need preferential fixingpid1

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions