Next: , Previous: , Up: herd and shepherd   [Contents][Index]

3.2 Invoking herd

The herd command is a generic client program to control a running instance of shepherd (see Invoking shepherd). It has the following synopsis:

herd [option…] action [service [arg…]]

It causes the action of the service to be invoked. When service is omitted and action is status or detailed-status, the root service is used2 (see The root and unknown services, for more information on the root service.)

For each action, you should pass the appropriate args. Actions that are available for every service are start, stop, restart, status, enable, disable, and doc.

If you pass a file name as an arg, it will be passed as-is to the Shepherd, thus if it is not an absolute name, it is local to the current working directory of shepherd, not to herd.

The herd command understands the following option:

-s file

Send commands to the socket special file file. If this option is not specified, localstatedir/run/shepherd/socket is taken.

The herd command returns zero on success, and a non-zero exit code on failure. In particular, it returns a non-zero exit code when action or service does not exist and when the given action failed.



This shorthand does not work for other actions such as stop, because inadvertently typing herd stop would stop all the services, which could be pretty annoying.