1

On a Guix System the PID 1 is called Shepherd and is controlled using the command herd. I often find myself wanting to tab-complete commands beginning with herd, like:

$ sudo herd restart some<tab> 

But lacking that, I can't even find a way to list all services known to (the) Shepherd. The help printout reads:

└$ sudo herd --help herd [OPTIONS...] ACTION SERVICE [ARG...] Apply ACTION (start, stop, status, etc.) on \ SERVICE with the ARGs. -s, --socket=FILE send commands to FILE --help display this help and exit --usage display short usage message and exit --version display version information and exit 

and only seems to mention actions that should be taken on services. The info and man pages are both terse, merely listing the available actions.

 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 used(1) (*note 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’. 

1 Answer 1

4

Turns out there is an undocumented usage of the status action. At least undocumented in terms of never being explicitly mentioned. Given no arguments herd status will list all services known to it, like:

$ sudo herd status Started: + avahi-daemon + console-font-tty1 + console-font-tty2 ... 
1
  • It's hard to grasp but the hint was in your question "When SERVICE is omitted and ACTION is ‘status’ or ‘detailed-status’, the ‘root’ service is used(1)". And these actions are listed on the 'root service' documentation page. I agree where would be no such questions in the first place if root actions be listed in --help section in a full manner. Commented Oct 14, 2023 at 18:28

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.