~ubuntu-branches/ubuntu/oneiric/procserv/oneiric

« back to all changes in this revision

Viewing changes to procServ.1

  • Committer: Bazaar Package Importer
  • Author(s): Ralph Lange
  • Date: 2010-01-04 16:19:35 UTC
  • Revision ID: james.westby@ubuntu.com-20100104161935-uaosvjyry3zc5l5l
Tags: upstream-2.5.0
ImportĀ upstreamĀ versionĀ 2.5.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.\"     Title: procserv
 
2
.\"    Author: 
 
3
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
 
4
.\"      Date: 12/02/2009
 
5
.\"    Manual: procServ Manual
 
6
.\"    Source: procServ 2.5.0
 
7
.\"
 
8
.TH "PROCSERV" "1" "12/02/2009" "procServ 2\&.5\&.0" "procServ Manual"
 
9
.\" disable hyphenation
 
10
.nh
 
11
.\" disable justification (adjust text to left margin only)
 
12
.ad l
 
13
.SH "NAME"
 
14
procServ \- Process Server with Telnet Console and Log Access
 
15
.SH "SYNOPSIS"
 
16
\fBprocServ\fR [\fIOPTIONS\fR] \fIport\fR \fIcommand\fR \fIargs\&...\fR
 
17
.sp
 
18
.SH "DESCRIPTION"
 
19
procServ(1) creates a run time environment for a command (e\&.g\&. a soft IOC)\&. It forks a server run as a daemon into the background, which creates a child process running \fIcommand\fR with all remaining \fIargs\fR from the command line\&. The server provides console access (stdin/stdout) to the child process by offering a telnet connection at the specified port\&. For security reasons, access is restricted to connections from localhost (127\&.0\&.0\&.1), so that logging into a valid account on the host machine is required\&.
 
20
.sp
 
21
procServ can be configured to write a console log of all in\- and output of the child process into a file using the \fB\-L\fR (\fB\-\-logfile\fR) option\&. To facilitate running under a central console access management (like conserver), the \fB\-l\fR (\fB\-\-logport\fR) option creates an additional telnet port, which is by default public (i\&.e\&. not restricted to localhost), and provides read\-only log access to the child\'s console\&. The \fB\-r\fR (\fB\-\-restrict\fR) option restricts the log port to localhost, similar to the access port\&.
 
22
.sp
 
23
Both access and log ports allow multiple connections, which are handled transparently: all input from access connections is forwarded to the child process, all output from the child is forwarded to all access and log connections (and written to the log file)\&. All diagnostic messages from the server process start with "@@@ " to be clearly distinguished from child process messages\&. A name specified by the \fB\-n\fR (\fB\-\-name\fR) option will replace the command string in many messages for increased readability\&.
 
24
.sp
 
25
The server will by default automatically respawn a child process when it dies\&. To avoid spinning, a minimum time between child process restarts is honoured (default: 15 seconds, can be changed using the \fB\-\-holdoff\fR option)\&. This behaviour can be toggled online using the toggle command ^T, the default may be changed using the \fB\-\-noautorestart\fR option\&. You can restart a running child manually by sending a signal to the child process using the kill command ^X\&. With the child process being shut down, the server accepts two commands: ^R to restart the child and ^Q to quit the server\&. The \fB\-w\fR (\fB\-\-wait\fR) option starts the server in this shut down mode, waiting for the telnet connection to issue a manual start command to create the child\&.
 
26
.sp
 
27
To block input characters that are potentially dangerous to the child (e\&.g\&. ^D and ^C on soft IOCs), the \fB\-i\fR (\fB\-\-ignore\fR) option can be used to specify characters that are silently ignored when coming from a console access port\&.
 
28
.sp
 
29
To facilitate being started and stopped as a standard system service, the \fB\-p\fR (\fB\-\-pidfile\fR) option tells the server to create a standard PID file containing the PID of the server process\&.
 
30
.sp
 
31
The \fB\-d\fR (\fB\-\-debug\fR) option runs the server in debug mode: the daemon process stays in the foreground, printing all regular log content plus additional debug messages to stdout\&.
 
32
.sp
 
33
.SH "OPTIONS"
 
34
.PP
 
35
\fB\-\-allow\fR
 
36
.RS 4
 
37
Allow control connections from anywhere\&. (Default: restrict control access to localhost\&.) Creates a serious security hole, as telnet clients from anywhere can connect to the child\'s stdin/stdout and execute arbitrary commands on the host, if the child permits\&. Needs to be enabled at compile\-time (see Makefile)\&. Please do not enable and use this option unless you exactly know why and what you are doing\&.
 
38
.RE
 
39
.PP
 
40
\fB\-\-autorestartcmd\fR=\fIchar\fR
 
41
.RS 4
 
42
Toggle auto restart flag when
 
43
\fIchar\fR
 
44
is sent on an access connection\&. Use
 
45
^
 
46
to specify a control character,
 
47
""
 
48
to disable\&. Default is
 
49
^T\&.
 
50
.RE
 
51
.PP
 
52
\fB\-\-coresize\fR=\fIsize\fR
 
53
.RS 4
 
54
Set the maximum
 
55
\fIsize\fR
 
56
of core file\&. See getrlimit(2) documentation for details\&. Setting
 
57
\fIsize\fR
 
58
to 0 will keep child from creating core files\&.
 
59
.RE
 
60
.PP
 
61
\fB\-c, \-\-chdir\fR=\fIdir\fR
 
62
.RS 4
 
63
Change directory to
 
64
\fIdir\fR
 
65
before starting child\&. This is done each time the child is started to make sure symbolic links are resolved on child restart\&.
 
66
.RE
 
67
.PP
 
68
\fB\-d, \-\-debug\fR
 
69
.RS 4
 
70
Enter debug mode\&. Debug mode will keep the server process in the foreground and enables diagnostic messages that will be sent to the controlling terminal\&.
 
71
.RE
 
72
.PP
 
73
\fB\-h, \-\-help\fR
 
74
.RS 4
 
75
Print help message\&.
 
76
.RE
 
77
.PP
 
78
\fB\-\-holdoff\fR=\fIn\fR
 
79
.RS 4
 
80
Wait at least
 
81
\fIn\fR
 
82
seconds between child restart attempts\&. Default is 15 seconds\&.
 
83
.RE
 
84
.PP
 
85
\fB\-i, \-\-ignore\fR=\fIchars\fR
 
86
.RS 4
 
87
Ignore all characters in
 
88
\fIchars\fR
 
89
on access connections\&. This can be used to shield the child process from input characters that are potentially dangerous, e\&.g\&.
 
90
^D
 
91
and
 
92
^C
 
93
characters that would shut down a soft IOC\&. Use
 
94
^
 
95
to specify control characters,
 
96
^^
 
97
to specify a single
 
98
^
 
99
character\&.
 
100
.RE
 
101
.PP
 
102
\fB\-k, \-\-killcmd\fR=\fIchar\fR
 
103
.RS 4
 
104
Kill the child process (child will be restarted automatically by default) when
 
105
\fIchar\fR
 
106
is sent on an access connection\&. Use
 
107
^
 
108
to specify a control character,
 
109
""
 
110
for no kill command\&. Default is
 
111
^X\&.
 
112
.RE
 
113
.PP
 
114
\fB\-\-killsig\fR=\fIsignal\fR
 
115
.RS 4
 
116
Kill the child using
 
117
\fIsignal\fR
 
118
when receiving the kill command\&. Default is 9 (SIGKILL)\&.
 
119
.RE
 
120
.PP
 
121
\fB\-l, \-\-logport\fR=\fIport\fR
 
122
.RS 4
 
123
Provide read\-only access to the child\'s console on
 
124
\fIport\fR\&. By default all hosts can connect to
 
125
\fIport\fR, use the
 
126
\fB\-r\fR
 
127
(\fB\-\-restrict\fR) option to restrict access to localhost\&.
 
128
.RE
 
129
.PP
 
130
\fB\-L, \-\-logfile\fR=\fIfile\fR
 
131
.RS 4
 
132
Write a console log of all in\- and output to
 
133
\fIfile\fR\&.
 
134
.RE
 
135
.PP
 
136
\fB\-n, \-\-name\fR=\fItitle\fR
 
137
.RS 4
 
138
In all server messages, use
 
139
\fItitle\fR
 
140
instead of the full command line to increase readability\&.
 
141
.RE
 
142
.PP
 
143
\fB\-\-noautorestart\fR
 
144
.RS 4
 
145
Do not automatically restart child process on exit\&.
 
146
.RE
 
147
.PP
 
148
\fB\-p, \-\-pidfile\fR=\fIfile\fR
 
149
.RS 4
 
150
Write the PID of the server process into
 
151
\fIfile\fR
 
152
to facilitate integration into regular system service administration mechanisms\&.
 
153
.RE
 
154
.PP
 
155
\fB\-\-timefmt\fR=\fIfmt\fR
 
156
.RS 4
 
157
Set the format string used to print time stamps to
 
158
\fIfmt\fR\&. Default is "%c"\&. (See strftime(3) documentation for details\&.)
 
159
.RE
 
160
.PP
 
161
\fB\-q, \-\-quiet\fR
 
162
.RS 4
 
163
Do not write informational output (server)\&. Avoids cluttering the screen when run as part of a system script\&.
 
164
.RE
 
165
.PP
 
166
\fB\-\-restrict\fR
 
167
.RS 4
 
168
Restrict log connections to localhost\&.
 
169
.RE
 
170
.PP
 
171
\fB\-V, \-\-version\fR
 
172
.RS 4
 
173
Print program version\&.
 
174
.RE
 
175
.PP
 
176
\fB\-w, \-\-wait\fR
 
177
.RS 4
 
178
Do not start the child\&. Instead, wait for a telnet connection and a manual start command\&.
 
179
.RE
 
180
.SH "USAGE"
 
181
To start a soft IOC using procServ, change the directory into the IOC\'s boot directory\&. A typical command line would be
 
182
.sp
 
183
.sp
 
184
.RS 4
 
185
.nf
 
186
    procServ \-n "My SoftIOC" \-i ^D^C 20000 \&./st\&.cmd
 
187
.fi
 
188
.RE
 
189
To connect to the IOC, log into the soft IOC\'s host and connect to port 20000 using
 
190
.sp
 
191
.sp
 
192
.RS 4
 
193
.nf
 
194
    telnet localhost 20000
 
195
.fi
 
196
.RE
 
197
To connect from a remote machine, ssh to a user account on procservhost and connect to port 20000 using
 
198
.sp
 
199
.sp
 
200
.RS 4
 
201
.nf
 
202
    ssh \-t user@procservhost telnet localhost 20000
 
203
.fi
 
204
.RE
 
205
You will be connected to the soft IOCs console and receive an informative welcome message\&. All output from the procServ server will start with "@@@ " to allow telling it apart from messages that your IOC sends\&.
 
206
.sp
 
207
.sp
 
208
.RS 4
 
209
.nf
 
210
    > telnet localhost 20000
 
211
    Trying 127\&.0\&.0\&.1\&.\&.\&.
 
212
    Connected to localhost\&.
 
213
    Escape character is \'^]\'\&.
 
214
    @@@ Welcome to the procServ process server (procServ Version 2\&.1\&.0)
 
215
    @@@ Use ^X to kill the child, auto restart is ON, use ^T to toggle auto restart
 
216
    @@@ procServ server PID: 21413
 
217
    @@@ Startup directory: /projects/ctl/lange/epics/ioc/test314/iocBoot/iocexample
 
218
    @@@ Child "My SoftIOC" started as: \&./st\&.cmd
 
219
    @@@ Child "My SoftIOC" PID: 21414
 
220
    @@@ procServ server started at: Fri Apr 25 16:43:00 2008
 
221
    @@@ Child "My SoftIOC" started at: Fri Apr 25 16:43:00 2008
 
222
    @@@ 0 user(s) and 0 logger(s) connected (plus you)
 
223
.fi
 
224
.RE
 
225
Type the kill command character ^X to reboot the soft IOC and get server messages about this action\&.
 
226
.sp
 
227
Type the telnet escape character ^] to get back to a telnet prompt and quit to exit telnet (and ssh when you were connecting remotely)\&.
 
228
.sp
 
229
While procServ was originally intended to be an environment to run soft IOCs, any process might be started as child\&. It provides an environment for any program that requires access to its console and should be run in the background as a daemon\&. By writing a file log directly or through a console access and logging facility (such as conserver), the log of such a program\'s output can be used to correlate its messages to other events\&. E\&.g\&., in an EPICS environment, running casw (the beacon anomaly watcher) can provide useful log output to analyse and track down network issues (name resolution broadcast storms)\&.
 
230
.sp
 
231
.SH "ENVIRONMENT VARIABLES"
 
232
.PP
 
233
\fBPROCSERV_PID\fR
 
234
.RS 4
 
235
This sets the file name to write the PID of the server process into\&. (See
 
236
\fB\-p\fR
 
237
option\&.)
 
238
.RE
 
239
.PP
 
240
\fBPROCSERV_DEBUG\fR
 
241
.RS 4
 
242
If set, procServ starts in debug mode\&. (See
 
243
\fB\-d\fR
 
244
option\&.)
 
245
.RE
 
246
.SH "KNOWN PROBLEMS"
 
247
None so far\&.
 
248
.sp
 
249
.SH "REPORTING BUGS"
 
250
Report bugs on the procServ Trac at http://sourceforge\&.net/apps/trac/procserv/ or to the authors\&.
 
251
.sp
 
252
.SH "AUTHORS"
 
253
Written by David H\&. Thompson <thompsondh@ornl\&.gov> and Ralph Lange <Ralph\&.Lange@bessy\&.de>\&.
 
254
.sp
 
255
.SH "RESOURCES"
 
256
SourceForge project: http://sourceforge\&.net/projects/procserv/
 
257
.sp
 
258
.SH "COPYING"
 
259
All copyrights reserved\&. Free use of this software is granted under the terms of the GNU General Public License (GPLv3)\&.
 
260
.sp
 
261
.SH "NOTES"
 
262
.IP " 1." 4
 
263
thompsondh@ornl.gov
 
264
.RS 4
 
265
\%mailto:thompsondh@ornl.gov
 
266
.RE
 
267
.IP " 2." 4
 
268
Ralph.Lange@bessy.de
 
269
.RS 4
 
270
\%mailto:Ralph.Lange@bessy.de
 
271
.RE