1PROCSERV(1)                     procServ Manual                    PROCSERV(1)
2
3
4

NAME

6       procServ - Process Server with Telnet Console and Log Access
7

SYNOPSIS

9       procServ [OPTIONS] port command args...
10
11

DESCRIPTION

13       procServ(1) creates a run time environment for a command (e.g. a soft
14       IOC). It forks a server run as a daemon into the background, which
15       creates a child process running command with all remaining args from
16       the command line. The server provides console access (stdin/stdout) to
17       the child process by offering a telnet connection at the specified
18       port. For security reasons, access is restricted to connections from
19       localhost (127.0.0.1), so that logging into a valid account on the host
20       machine is required.
21
22       procServ can be configured to write a console log of all in- and output
23       of the child process into a file using the -L (--logfile) option. To
24       facilitate running under a central console access management (like
25       conserver), the -l (--logport) option creates an additional telnet
26       port, which is by default public (i.e. not restricted to localhost),
27       and provides read-only log access to the child´s console. The -r
28       (--restrict) option restricts the log port to localhost, similar to the
29       access port.
30
31       Both access and log ports allow multiple connections, which are handled
32       transparently: all input from access connections is forwarded to the
33       child process, all output from the child is forwarded to all access and
34       log connections (and written to the log file). All diagnostic messages
35       from the server process start with "@@@ " to be clearly distinguished
36       from child process messages. A name specified by the -n (--name) option
37       will replace the command string in many messages for increased
38       readability.
39
40       The server will by default automatically respawn a child process when
41       it dies. To avoid spinning, a minimum time between child process
42       restarts is honoured (default: 15 seconds, can be changed using the
43       --holdoff option). This behaviour can be toggled online using the
44       toggle command ^T, the default may be changed using the --noautorestart
45       option. You can restart a running child manually by sending a signal to
46       the child process using the kill command ^X. With the child process
47       being shut down, the server accepts two commands: ^R to restart the
48       child and ^Q to quit the server. The -w (--wait) option starts the
49       server in this shut down mode, waiting for the telnet connection to
50       issue a manual start command to create the child.
51
52       To block input characters that are potentially dangerous to the child
53       (e.g. ^D and ^C on soft IOCs), the -i (--ignore) option can be used to
54       specify characters that are silently ignored when coming from a console
55       access port.
56
57       To facilitate being started and stopped as a standard system service,
58       the -p (--pidfile) option tells the server to create a standard PID
59       file containing the PID of the server process.
60
61       The -d (--debug) option runs the server in debug mode: the daemon
62       process stays in the foreground, printing all regular log content plus
63       additional debug messages to stdout.
64
65

OPTIONS

67       --allow
68           Allow control connections from anywhere. (Default: restrict control
69           access to localhost.) Creates a serious security hole, as telnet
70           clients from anywhere can connect to the child´s stdin/stdout and
71           execute arbitrary commands on the host, if the child permits. Needs
72           to be enabled at compile-time (see Makefile). Please do not enable
73           and use this option unless you exactly know why and what you are
74           doing.
75
76       --autorestartcmd=char
77           Toggle auto restart flag when char is sent on an access connection.
78           Use ^ to specify a control character, "" to disable. Default is ^T.
79
80       --coresize=size
81           Set the maximum size of core file. See getrlimit(2) documentation
82           for details. Setting size to 0 will keep child from creating core
83           files.
84
85       -c, --chdir=dir
86           Change directory to dir before starting child. This is done each
87           time the child is started to make sure symbolic links are resolved
88           on child restart.
89
90       -d, --debug
91           Enter debug mode. Debug mode will keep the server process in the
92           foreground and enables diagnostic messages that will be sent to the
93           controlling terminal.
94
95       -h, --help
96           Print help message.
97
98       --holdoff=n
99           Wait at least n seconds between child restart attempts. Default is
100           15 seconds.
101
102       -i, --ignore=chars
103           Ignore all characters in chars on access connections. This can be
104           used to shield the child process from input characters that are
105           potentially dangerous, e.g.  ^D and ^C characters that would shut
106           down a soft IOC. Use ^ to specify control characters, ^^ to specify
107           a single ^ character.
108
109       -k, --killcmd=char
110           Kill the child process (child will be restarted automatically by
111           default) when char is sent on an access connection. Use ^ to
112           specify a control character, "" for no kill command. Default is ^X.
113
114       --killsig=signal
115           Kill the child using signal when receiving the kill command.
116           Default is 9 (SIGKILL).
117
118       -l, --logport=port
119           Provide read-only access to the child´s console on port. By default
120           all hosts can connect to port, use the -r (--restrict) option to
121           restrict access to localhost.
122
123       -L, --logfile=file
124           Write a console log of all in- and output to file.
125
126       -n, --name=title
127           In all server messages, use title instead of the full command line
128           to increase readability.
129
130       --noautorestart
131           Do not automatically restart child process on exit.
132
133       -p, --pidfile=file
134           Write the PID of the server process into file to facilitate
135           integration into regular system service administration mechanisms.
136
137       --timefmt=fmt
138           Set the format string used to print time stamps to fmt. Default is
139           "%c". (See strftime(3) documentation for details.)
140
141       -q, --quiet
142           Do not write informational output (server). Avoids cluttering the
143           screen when run as part of a system script.
144
145       --restrict
146           Restrict log connections to localhost.
147
148       -V, --version
149           Print program version.
150
151       -w, --wait
152           Do not start the child. Instead, wait for a telnet connection and a
153           manual start command.
154

USAGE

156       To start a soft IOC using procServ, change the directory into the IOC´s
157       boot directory. A typical command line would be
158
159
160               procServ -n "My SoftIOC" -i ^D^C 20000 ./st.cmd
161       To connect to the IOC, log into the soft IOC´s host and connect to port
162       20000 using
163
164
165               telnet localhost 20000
166       To connect from a remote machine, ssh to a user account on procservhost
167       and connect to port 20000 using
168
169
170               ssh -t user@procservhost telnet localhost 20000
171       You will be connected to the soft IOCs console and receive an
172       informative welcome message. All output from the procServ server will
173       start with "@@@ " to allow telling it apart from messages that your IOC
174       sends.
175
176
177               > telnet localhost 20000
178               Trying 127.0.0.1...
179               Connected to localhost.
180               Escape character is ´^]´.
181               @@@ Welcome to the procServ process server (procServ Version 2.1.0)
182               @@@ Use ^X to kill the child, auto restart is ON, use ^T to toggle auto restart
183               @@@ procServ server PID: 21413
184               @@@ Startup directory: /projects/ctl/lange/epics/ioc/test314/iocBoot/iocexample
185               @@@ Child "My SoftIOC" started as: ./st.cmd
186               @@@ Child "My SoftIOC" PID: 21414
187               @@@ procServ server started at: Fri Apr 25 16:43:00 2008
188               @@@ Child "My SoftIOC" started at: Fri Apr 25 16:43:00 2008
189               @@@ 0 user(s) and 0 logger(s) connected (plus you)
190       Type the kill command character ^X to reboot the soft IOC and get
191       server messages about this action.
192
193       Type the telnet escape character ^] to get back to a telnet prompt and
194       quit to exit telnet (and ssh when you were connecting remotely).
195
196       While procServ was originally intended to be an environment to run soft
197       IOCs, any process might be started as child. It provides an environment
198       for any program that requires access to its console and should be run
199       in the background as a daemon. By writing a file log directly or
200       through a console access and logging facility (such as conserver), the
201       log of such a program´s output can be used to correlate its messages to
202       other events. E.g., in an EPICS environment, running casw (the beacon
203       anomaly watcher) can provide useful log output to analyse and track
204       down network issues (name resolution broadcast storms).
205
206

ENVIRONMENT VARIABLES

208       PROCSERV_PID
209           This sets the file name to write the PID of the server process
210           into. (See -p option.)
211
212       PROCSERV_DEBUG
213           If set, procServ starts in debug mode. (See -d option.)
214

KNOWN PROBLEMS

216       None so far.
217
218

REPORTING BUGS

220       Report bugs on the procServ Trac at
221       http://sourceforge.net/apps/trac/procserv/ or to the authors.
222
223

AUTHORS

225       Written by David H. Thompson <thompsondh@ornl.gov> and Ralph Lange
226       <Ralph.Lange@bessy.de>.
227
228

RESOURCES

230       SourceForge project: http://sourceforge.net/projects/procserv/
231
232

COPYING

234       All copyrights reserved. Free use of this software is granted under the
235       terms of the GNU General Public License (GPLv3).
236
237

NOTES

239        1. thompsondh@ornl.gov
240           mailto:thompsondh@ornl.gov
241
242        2. Ralph.Lange@bessy.de
243           mailto:Ralph.Lange@bessy.de
244
245
246
247procServ 2.5.0a2                  03/23/2010                       PROCSERV(1)
Impressum