[systemd-devel] Return codes of systemctl (status)

Cecil Westerhof cldwesterhof at gmail.com
Thu Aug 16 16:09:20 UTC 2018


2018-08-16 16:35 GMT+02:00 Ryan Gonzalez <rymg19 at gmail.com>:

> I believe the errors are based on errno: http://www.virtsync.com
> /c-error-codes-include-errno
>
> Return status 3 -> ESRCH -> No such process
>

Thanks I will look into that.


I think it is not completely correct. For example if I do:
    systemctl status dummy

This gives as description:
    Unit dummy.service could not be found.

And the error code that is returned is 4.
I would not say that a non existing service is an interrupted service call.
I would find 22 (invalid argument) more logical. But it all depends how you
interpret things.

On Thu, Aug 16, 2018, 6:27 AM Cecil Westerhof <cldwesterhof at gmail.com>
> wrote:
>
>> The man page of systemctl says:
>>     On success, 0 is returned, a non-zero failure code otherwise.
>>
>> When I do a systemctl status on a service that is not running I get a 3.
>> What other values can be returned and where do I find those?
>>
>
-- 
Cecil Westerhof
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180816/f35314aa/attachment.html>


More information about the systemd-devel mailing list