Guixsd
列出 (Shep)herd 的所有可用服務
在 Guix 系統上,PID 1 稱為 Shepherd,並使用命令進行控制
herd
。我經常發現自己想要對以 開頭的命令進行製表符補全herd
,例如:$ sudo herd restart some<tab>
但是缺少這些,我什至無法找到一種方法來列出 (the) Shepherd 已知的所有服務。幫助列印輸出如下:
└$ 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
並且似乎只提到了應該對服務採取的行動。資訊和手冊頁都很簡潔,只是列出了可用的操作。
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’.
status
事實證明,該動作有一個未記錄的用法。至少在從未明確提及方面沒有記錄。如果沒有參數herd status
將列出它已知的所有服務,例如:$ sudo herd status Started: + avahi-daemon + console-font-tty1 + console-font-tty2 ...