diff options
-rw-r--r-- | doc/pies.texi | 77 | ||||
-rw-r--r-- | src/progman.c | 49 |
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 @{ | |||
2182 | @} | 2182 | @} |
2183 | @end smallexample | 2183 | @end smallexample |
2184 | 2184 | ||
2185 | The following is almost equivalent configuration in @command{inetd} | ||
2186 | format: | ||
2187 | |||
2188 | @smallexample | ||
2189 | ftp stream tcp nowait root /usr/sbin/ftpd ftpd -l -C | ||
2190 | pop3 stream tcp nowait root /usr/sbin/pop3d pop3d --inetd | ||
2191 | @end smallexample | ||
2192 | |||
2193 | This configuration is ``almost'' equivalent, because the | ||
2194 | @command{inetd} has no way of specifying ACLs and setting the umask. | ||
2195 | |||
2185 | @node Command Line Usage | 2196 | @node Command Line Usage |
2186 | @chapter Command Line Usage | 2197 | @chapter Command Line Usage |
2187 | 2198 | ||
@@ -2195,43 +2206,57 @@ listed there is alive and responding. If another instance is running, | |||
2195 | 2206 | ||
2196 | @anchor{pies-status} | 2207 | @anchor{pies-status} |
2197 | After startup, you can verify the status of the running process | 2208 | After startup, you can verify the status of the running process |
2198 | using @option{--status} command line option: | 2209 | using the @option{--status} command line option: |
2199 | 2210 | ||
2200 | @smallexample | 2211 | @smallexample |
2201 | @group | 2212 | @group |
2202 | $ pies --status | 2213 | $ pies --status |
2203 | redirector smtps/stderr 4697 | 2214 | smtps/stderr R 4697 |
2204 | redirector pmult/stderr 4677 | 2215 | pmult/stderr R 4677 |
2205 | redirector pmult/stdout 4676 | 2216 | pmult/stdout R 4676 |
2206 | component pmult 4678 /usr/local/sbin/pmult | 2217 | pmult CR 4678 /usr/local/sbin/pmult |
2207 | component smar 4680 smar -f /etc/meta1/meta1.conf -d 100 | 2218 | smar CR 4680 smar -f /etc/meta1/meta1.conf -d 100 |
2208 | component qmgr 4691 qmgr -f /etc/meta1/meta1.conf | 2219 | qmgr CR 4691 qmgr -f /etc/meta1/meta1.conf |
2209 | component smtpc 4696 smtpc -f /etc/meta1/meta1.conf | 2220 | smtpc CR 4696 smtpc -f /etc/meta1/meta1.conf |
2210 | component smtps 4698 smtps -d100 -f /etc/meta1/meta1.conf | 2221 | smtps PR 4698 smtps -d100 -f /etc/meta1/meta1.conf |
2211 | @end group | 2222 | @end group |
2212 | @end smallexample | 2223 | @end smallexample |
2213 | 2224 | ||
2214 | In its output, lines beginning with @samp{component} refer to | 2225 | Each output line contains at least two columns. The first column |
2215 | running components. For running components, the following information | 2226 | lists the tag of the component. The second one contains @dfn{flags}, |
2216 | is displayed: | 2227 | describing the type and status of the component. The first flag |
2228 | describes the type: | ||
2229 | |||
2230 | @multitable @columnfractions 0.2 0.7 | ||
2231 | @headitem Flag @tab Meaning | ||
2232 | @item C @tab Init-style component | ||
2233 | @item A @tab Accept-style component | ||
2234 | @item I @tab Inetd-style component | ||
2235 | @item P @tab Pass-style component | ||
2236 | @item R @tab Output redirector | ||
2237 | @item E @tab Command being executed | ||
2238 | @end multitable | ||
2217 | 2239 | ||
2218 | @enumerate 1 | 2240 | The second flag is meaningful only for components, i.e. if the first |
2219 | @item Component tag (@pxref{Component Statement}). | 2241 | flag is one of @samp{CAIP}. Its values are: |
2220 | @item PID of the running instance of the component. | ||
2221 | @item Command line of the component, as set by the @code{command} | ||
2222 | statement (@pxref{Component Statement, command}). | ||
2223 | @end enumerate | ||
2224 | 2242 | ||
2225 | If the component is not running, the reason is indicated in the PID | 2243 | @multitable @columnfractions 0.2 0.7 |
2226 | column, between the square brackets, e.g.: | 2244 | @headitem Flag @tab Meaning |
2245 | @item R @tab Running component | ||
2246 | @item D @tab Disabled component | ||
2247 | @item L @tab Inetd listener | ||
2248 | @item s @tab Component is sleeping | ||
2249 | @item S @tab Component is stopping | ||
2250 | @end multitable | ||
2227 | 2251 | ||
2228 | @smallexample | 2252 | The next column lists the PID (for running components) or socket address |
2229 | component pmult [disabled; scheduled for Mon 01 Dec 2008 20:27:02] | 2253 | (for internet listeners), or the string @samp{N/A} if neither of the |
2230 | /usr/local/sbin/pmult | 2254 | above applies. |
2231 | @end smallexample | ||
2232 | 2255 | ||
2233 | @noindent | 2256 | If the component is sleeping, the time of its scheduled wake-up is |
2234 | (the example above is split in two lines for readability). | 2257 | listed in the next column. |
2258 | |||
2259 | The rest of line contains the component command line. | ||
2235 | 2260 | ||
2236 | @anchor{pies-restart} | 2261 | @anchor{pies-restart} |
2237 | @xopindex{restart-component, described} | 2262 | @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) | |||
2247 | switch (prog->type) | 2247 | switch (prog->type) |
2248 | { | 2248 | { |
2249 | case TYPE_COMPONENT: | 2249 | case TYPE_COMPONENT: |
2250 | fbuf[fidx++] = 'C'; | 2250 | switch (prog->v.p.comp->mode) |
2251 | if (prog->v.p.comp->mode == pies_comp_inetd | ||
2252 | && prog->v.p.listener) | ||
2253 | fbuf[fidx++] = 'i'; | ||
2254 | |||
2255 | if (prog->pid) | ||
2256 | { | 2251 | { |
2257 | if (prog->v.p.status == status_stopping) | 2252 | case pies_comp_exec: |
2258 | fbuf[fidx++] = 'S'; | 2253 | fbuf[fidx++] = 'C'; |
2259 | else | 2254 | break; |
2260 | fbuf[fidx++] = 'R'; | 2255 | |
2256 | case pies_comp_accept: | ||
2257 | fbuf[fidx++] = 'A'; | ||
2258 | break; | ||
2259 | |||
2260 | case pies_comp_inetd: | ||
2261 | fbuf[fidx++] = 'I'; | ||
2262 | break; | ||
2263 | |||
2264 | case pies_comp_pass_fd: | ||
2265 | fbuf[fidx++] = 'P'; | ||
2261 | } | 2266 | } |
2262 | else if (prog->v.p.status == status_sleeping) | 2267 | |
2268 | switch (prog->v.p.status) | ||
2263 | { | 2269 | { |
2270 | case status_enabled: | ||
2271 | fbuf[fidx++] = (prog->pid != 0) ? 'R' : ' '; | ||
2272 | break; | ||
2273 | |||
2274 | case status_disabled: | ||
2275 | fbuf[fidx++] = 'D'; | ||
2276 | break; | ||
2277 | |||
2278 | case status_listener: | ||
2279 | fbuf[fidx++] = 'L'; | ||
2280 | break; | ||
2281 | |||
2282 | case status_sleeping: | ||
2264 | fbuf[fidx++] = 's'; | 2283 | fbuf[fidx++] = 's'; |
2284 | break; | ||
2285 | |||
2286 | case status_stopping: | ||
2287 | fbuf[fidx++] = 'S'; | ||
2265 | } | 2288 | } |
2266 | else if (prog->v.p.status == status_disabled) | ||
2267 | fbuf[fidx++] = 'D'; | ||
2268 | else if (prog->v.p.status == status_listener) | ||
2269 | fbuf[fidx++] = 'I'; | ||
2270 | break; | 2289 | break; |
2271 | 2290 | ||
2272 | case TYPE_REDIRECTOR: | 2291 | case TYPE_REDIRECTOR: |