aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-12-10 14:45:33 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-12-10 14:45:33 +0200
commit8f42fc862f0580cb5ecafac3e16582a1a817cf54 (patch)
treeb17f8ef02468741a10abe1fd493daeb999c5758a
parent8fbc93d51cc9ac7a302a6e909df49f8e2ecf2063 (diff)
downloadpies-8f42fc862f0580cb5ecafac3e16582a1a817cf54.tar.gz
pies-8f42fc862f0580cb5ecafac3e16582a1a817cf54.tar.bz2
Improve status output.
* doc/pies.texi: Document new status output format. * src/progman.c (progman_dump_stats): Redesign flags column.
-rw-r--r--doc/pies.texi77
-rw-r--r--src/progman.c49
2 files changed, 85 insertions, 41 deletions
diff --git a/doc/pies.texi b/doc/pies.texi
index 7008ce6..b51be37 100644
--- a/doc/pies.texi
+++ b/doc/pies.texi
@@ -2182,6 +2182,17 @@ component pop3d @{
@}
@end smallexample
+The following is almost equivalent configuration in @command{inetd}
+format:
+
+@smallexample
+ftp stream tcp nowait root /usr/sbin/ftpd ftpd -l -C
+pop3 stream tcp nowait root /usr/sbin/pop3d pop3d --inetd
+@end smallexample
+
+This configuration is ``almost'' equivalent, because the
+@command{inetd} has no way of specifying ACLs and setting the umask.
+
@node Command Line Usage
@chapter Command Line Usage
@@ -2195,43 +2206,57 @@ listed there is alive and responding. If another instance is running,
@anchor{pies-status}
After startup, you can verify the status of the running process
-using @option{--status} command line option:
+using the @option{--status} command line option:
@smallexample
@group
$ pies --status
-redirector smtps/stderr 4697
-redirector pmult/stderr 4677
-redirector pmult/stdout 4676
-component pmult 4678 /usr/local/sbin/pmult
-component smar 4680 smar -f /etc/meta1/meta1.conf -d 100
-component qmgr 4691 qmgr -f /etc/meta1/meta1.conf
-component smtpc 4696 smtpc -f /etc/meta1/meta1.conf
-component smtps 4698 smtps -d100 -f /etc/meta1/meta1.conf
+smtps/stderr R 4697
+pmult/stderr R 4677
+pmult/stdout R 4676
+pmult CR 4678 /usr/local/sbin/pmult
+smar CR 4680 smar -f /etc/meta1/meta1.conf -d 100
+qmgr CR 4691 qmgr -f /etc/meta1/meta1.conf
+smtpc CR 4696 smtpc -f /etc/meta1/meta1.conf
+smtps PR 4698 smtps -d100 -f /etc/meta1/meta1.conf
@end group
@end smallexample
- In its output, lines beginning with @samp{component} refer to
-running components. For running components, the following information
-is displayed:
+ Each output line contains at least two columns. The first column
+lists the tag of the component. The second one contains @dfn{flags},
+describing the type and status of the component. The first flag
+describes the type:
+
+@multitable @columnfractions 0.2 0.7
+@headitem Flag @tab Meaning
+@item C @tab Init-style component
+@item A @tab Accept-style component
+@item I @tab Inetd-style component
+@item P @tab Pass-style component
+@item R @tab Output redirector
+@item E @tab Command being executed
+@end multitable
-@enumerate 1
-@item Component tag (@pxref{Component Statement}).
-@item PID of the running instance of the component.
-@item Command line of the component, as set by the @code{command}
-statement (@pxref{Component Statement, command}).
-@end enumerate
+ The second flag is meaningful only for components, i.e. if the first
+flag is one of @samp{CAIP}. Its values are:
-If the component is not running, the reason is indicated in the PID
-column, between the square brackets, e.g.:
+@multitable @columnfractions 0.2 0.7
+@headitem Flag @tab Meaning
+@item R @tab Running component
+@item D @tab Disabled component
+@item L @tab Inetd listener
+@item s @tab Component is sleeping
+@item S @tab Component is stopping
+@end multitable
-@smallexample
-component pmult [disabled; scheduled for Mon 01 Dec 2008 20:27:02]
- /usr/local/sbin/pmult
-@end smallexample
+ The next column lists the PID (for running components) or socket address
+(for internet listeners), or the string @samp{N/A} if neither of the
+above applies.
-@noindent
-(the example above is split in two lines for readability).
+ If the component is sleeping, the time of its scheduled wake-up is
+listed in the next column.
+
+ The rest of line contains the component command line.
@anchor{pies-restart}
@xopindex{restart-component, described}
diff --git a/src/progman.c b/src/progman.c
index b035d21..e73a611 100644
--- a/src/progman.c
+++ b/src/progman.c
@@ -2247,26 +2247,45 @@ progman_dump_stats (const char *filename)
switch (prog->type)
{
case TYPE_COMPONENT:
- fbuf[fidx++] = 'C';
- if (prog->v.p.comp->mode == pies_comp_inetd
- && prog->v.p.listener)
- fbuf[fidx++] = 'i';
-
- if (prog->pid)
+ switch (prog->v.p.comp->mode)
{
- if (prog->v.p.status == status_stopping)
- fbuf[fidx++] = 'S';
- else
- fbuf[fidx++] = 'R';
+ case pies_comp_exec:
+ fbuf[fidx++] = 'C';
+ break;
+
+ case pies_comp_accept:
+ fbuf[fidx++] = 'A';
+ break;
+
+ case pies_comp_inetd:
+ fbuf[fidx++] = 'I';
+ break;
+
+ case pies_comp_pass_fd:
+ fbuf[fidx++] = 'P';
}
- else if (prog->v.p.status == status_sleeping)
+
+ switch (prog->v.p.status)
{
+ case status_enabled:
+ fbuf[fidx++] = (prog->pid != 0) ? 'R' : ' ';
+ break;
+
+ case status_disabled:
+ fbuf[fidx++] = 'D';
+ break;
+
+ case status_listener:
+ fbuf[fidx++] = 'L';
+ break;
+
+ case status_sleeping:
fbuf[fidx++] = 's';
+ break;
+
+ case status_stopping:
+ fbuf[fidx++] = 'S';
}
- else if (prog->v.p.status == status_disabled)
- fbuf[fidx++] = 'D';
- else if (prog->v.p.status == status_listener)
- fbuf[fidx++] = 'I';
break;
case TYPE_REDIRECTOR:

Return to:

Send suggestions and report system problems to the System administrator.