util/pretty-svstat

psvstat.1 in master
Repositories | Summary | Log | Files | README.md | LICENSE

psvstat.1 (2805B) download


 1.TH psvstat 1 "June 2024" "1.0" "psvstat Manual"
 2.SH NAME
 3psvstat \- a utility to print the status of runit services
 4.SH SYNOPSIS
 5.B psvstat
 6.I service_path ...
 7.SH DESCRIPTION
 8.B psvstat
 9is a command-line utility for checking and printing the status of \fBrunit\fP services. It reads the service status from the \fBsupervise/status\fP file of each specified \fBrunit\fP service and displays relevant information.
10.SH OPTIONS
11.TP
12.I service_path
13The path to the \fBrunit\fP service directory. The program expects the status file to be located at \fIservice_path/supervise/status\fP.
14.SH OUTPUT
15The program prints the status of each specified service in a formatted manner. The output contains the following columns:
16.TP
17.B Type
18Indicates if the service is a user service (\fBuser\fP) or a system service (\fBsys\fP).
19.TP
20.B Name
21The name of the service.
22.TP
23.B Desired State
24Indicates if the service's desired state matches its current state.
25.RS
26.TP
27\fB=\fP
28The service's desired state matches its current state.
29.TP
30\fBv\fP
31The service is up but should be down.
32.TP
33\fB^\fP
34The service is down but should be up.
35.RE
36.TP
37.B Current State
38The current state of the service.
39.RS
40.TP
41\fBpaus\fP
42The service is paused.
43.TP
44\fBdown\fP
45The service is down.
46.TP
47\fBrun\fP
48The service is running.
49.TP
50\fBfin\fP
51The service has finished.
52.TP
53\fB???\fP
54Unknown state.
55.RE
56.TP
57.B Time Since Last Change
58The time elapsed since the last status change.
59.TP
60.B PID
61The process ID of the service if it is running.
62.TP
63.B Command
64The command name of the running process if available.
65.PP
66.SH EXAMPLES
67.B psvstat /etc/service/service1 /etc/service/service2
68.PP
69In this example:
70.TP
71\fBservice1\fP is a system service (\fBsys\fP), its desired state matches its current state (\fB=\fP), it is currently running (\fBrun\fP), the status changed 2 hours ago, its PID is 1234, and the command name is \fBmyservice\fP.
72.TP
73\fBservice2\fP is a system service (\fBsys\fP), its desired state does not match its current state (\fBv\fP), it should be down but is up, the status changed 5 minutes ago, it is not running (\fB---\fP), and no command name is available (\fB---\fP).
74.SH ERROR HANDLING
75The program handles several error conditions and prints appropriate messages to \fBstderr\fP:
76.TP
77.B <service_path>: unable to open supervise/status
78Printed if the program is unable to open the \fBsupervise/status\fP file.
79.TP
80.B <service_path>: unable to read status
81Printed if the program is unable to read the \fBsupervise/status\fP file.
82.SH ENVIRONMENT
83.TP
84.B HOME
85Used to determine if a service is a user service.
86.SH EXIT STATUS
87The program does not return any specific exit status codes but prints error messages for issues encountered during execution.
88.SH SEE ALSO
89.BR runsv (8),
90.BR sv (8)
91.SH AUTHOR
92Written by Friedel Schon.