PROCSERV(1)
π PROCSERV(1) π
okay bestie, we're in the procServ Manual, and this is literally a process server with telnet console and log access. no cap. π
πΈ NAME πΈ
procServ β Process Server with Telnet Console and Log Access.
β¨ SYNOPSIS β¨
procServ [OPTIONS] -P endpoint... command args...
procServ [OPTIONS] endpoint command args...
π DESCRIPTION π
okay so procServ(1) literally creates a whole run time environment for a command (think: a soft IOC). It forks a server run as a daemon into the background, and that server creates a child process running command with all the remaining args from the command line. The server provides control access (stdin/stdout) to the child process console by offering a telnet connection at the specified endpoint(s). main character energy fr. β¨
An endpoint can either be a TCP server socket (specified by the port number) or a UNIX domain socket (where available). See ENDPOINT SPECIFICATION below for details. For security reasons, control access is restricted to connections from localhost (127.0.0.1), so that a prior login in to the host machine is required. (See --allow option.)
The first variant allows multiple endpoint declarations and treats all non-option arguments as the command line for the child process. The second variant (provided for backward compatibility) declares one endpoint with its specification taken from the first non-option argument.
procServ can be configured to write a console log of all in- and output of the child process into a file using the -L (--logfile) option. Sending the signal SIGHUP to the server will make it reopen the log file.
To facilitate running under a central console access management (like conserver), the -l (--logport) option creates an additional endpoint, which is by default public (i.e. TCP access is not restricted to connections from localhost), and provides read-only (log) access to the childβs console. The -r (--restrict) option restricts both control and log access to connections from localhost.
Both control and log endpoints allow multiple connections, which are handled transparently: all input from control connections is forwarded to the child process, all output from the child is forwarded to all control and log connections (and written to the log file). All diagnostic messages from the procServ server process start with @@@ to be clearly distinguishable from child process messages. A name specified by the -n (--name) option will replace the command string in many messages for increased readability.
The server will by default automatically respawn the child process when it dies. To avoid spinning, a minimum time between child process restarts is honored (default: 15 seconds, can be changed using the --holdoff option). This behavior can be toggled online using the toggle command ^T, the default may be changed using the --noautorestart 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 or ^X to restart the child, and ^Q to quit the server. The -w (--wait) option starts the server in this shut down mode, waiting for a control connection to issue a manual start command to spawn the child.
To facilitate running under system daemon management (systemd/supervisord), the -o (--oneshot) option will exit the procServ server after the child exits. In that mode, the system daemon must handle restarts (if required), and all clients will have to reconnect.
Any connection (control or log) can be disconnected using the clientβs disconnect sequence. Control connections can also be disconnected by sending the logout command character that can be specified using the -x (--logoutcmd) option.
To block input characters that are potentially dangerous to the child (e.g. ^D and ^C on soft IOCs), the -i (--ignore) option can be used to specify characters that are silently ignored when coming from a control connection.
To facilitate being started and stopped as a standard system service, the -p (--pidfile) option tells the server to create a PID file containing the PID of the server process. The -I (--info-file) option writes a file listing the server PID and a list of all endpoints.
The -d (--debug) 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.
π¦ ENDPOINT SPECIFICATION π¦
Both control and log endpoints may be bound to either TCP or UNIX sockets (where supported). Allowed endpoint specifications are:
<port>β Bind to either0.0.0.0:<port>(any) or127.0.0.1:<port>(localhost) depending on the type of endpoint and the setting of-r(--restrict) and--allowoptions.<ifaceaddr>:<port>β Bind to the specified interface address and<port>. The interface IP address<ifaceaddr>must be given in numeric form. Uses127.0.0.1(localhost) for security reasons unless the--allowoption is also used.unix:</path/to/socket>β Bind to a named unix domain socket that will be created at the specified absolute or relative path. The server process must have permission to create files in the enclosing directory. The socket file will be owned by the uid and primary gid of theprocServserver process with permissions0666(equivalent to a TCP socket bound to localhost).unix:<user>:<group>:<perm>:</path/to/socket>β Bind to a named unix domain socket that will be created at the specified absolute or relative path. The server process must have permission to create files in the enclosing directory. The socket file will be owned by the specified<user>and<group>with<perm>permissions. Any of<user>,<group>, and/or<perm>may be omitted. E.g.-P unix::grp:0660:/run/procServ/foo/controlwill create the named socket with0660permissions and allow thegrpgroup connect to it. This requires thatprocServbe run as root or a member ofgrp.unix:@</path/to/socket>β Bind to an abstract unix domain socket (Linux specific). Abstract sockets do not exist on the filesystem, and have no permissions checks. They are functionally similar to a TCP socket bound to localhost, but identified with a name string instead of a port number.
π OPTIONS π
--allowβ Allow TCP control connections from anywhere. (Default: restrict control access to connections from localhost.) Creates a serious security hole, as telnet clients from anywhere can connect to the childβsstdin/stdoutand might execute arbitrary commands on the host if the child permits. Needs to be enabled at compile-time (seeMakefile). Please do not enable and use this option unless you exactly know why and what you are doing. π¨--autorestartcmd=charβ Toggle auto restart flag whencharis sent on a control connection. Use^to specify a control character,""to disable. Default is^T.--coresize=sizeβ Set the maximum size of core file. Seegetrlimit(2)documentation for details. Settingsizeto0will keep child from creating core files.-c,--chdir=dirβ Change directory todirbefore starting the child. This is done each time the child is started to make sure symbolic links are properly resolved on child restart.-d,--debugβ 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.-e,--exec=fileβ Runfileas executable for child. Default iscommand.-f,--foregroundβ Keep the server process in the foreground and connected to the controlling terminal.-h,--helpβ Print help message.--holdoff=nβ Wait at leastnseconds between child restart attempts. (Default is 15 seconds.)-i,--ignore=charsβ Ignore all characters incharson control connections. This can be used to shield the child process from input characters that are potentially dangerous, e.g.^Dand^Ccharacters that would shut down a soft IOC. Use^to specify control characters,^^to specify a single^character.-I,--info-file <file>β Write instance information to this file.-k,--killcmd=charβ Kill the child process (child will be restarted automatically by default) whencharis sent on a control connection. Use^to specify a control character,""for no kill command. Default is^X.--killsig=signalβ Kill the child usingsignalwhen receiving the kill command. Default is9(SIGKILL).-l,--logport=endpointβ Provide read-only log access to the childβs console onendpoint. See ENDPOINT SPECIFICATION above. By default, TCP log endpoints allow connections from anywhere. Use the-r(--restrict) option to restrict TCP access to local connections.-L,--logfile=fileβ Write a console log of all in and output tofile.-selectsstdout.--logstamp[=fmt]β Prefix lines in logs with a time stamp, setting the time stamp format string tofmt. Default is"[<timefmt>] ". (See--timefmtoption.)-n,--name=titleβ In all server messages, usetitleinstead of the full command line to increase readability.--noautorestartβ Do not automatically restart child process on exit.-o,--oneshotβ Once the child process exits, also exit the server.-P,--port=endpointβ Provide control access to the childβs console onendpoint. See ENDPOINT SPECIFICATION above. By default, TCP control endpoints are restricted to local connections. Use the--allowoption to allow TCP access from anywhere.-p,--pidfile=fileβ Write the PID of the server process intofile.--timefmt=fmtβ Set the format string used to print time stamps tofmt. Default is"%c". (Seestrftime(3)documentation for details.)-q,--quietβ Do not write informational output (server). Avoids cluttering the screen when run as part of a system script.--restrictβ Restrict TCP access (control and log) to connections from localhost.-V,--versionβ Print program version.-w,--waitβ Do not start the child immediately. Instead, wait for a control connection and a manual start command.-x,--logoutcmd=charβ Log out (close client connection) whencharis sent on an control connection. Use^to specify a control character. Default is empty.
π USAGE π
To start a soft IOC using procServ, change the directory into the IOCβs boot directory. A typical command line would be
procServ -n "My SoftIOC" -i ^D^C 20000 ./st.cmd
To connect to the IOC, log into the soft IOCβs host and connect to port 20000 using
telnet localhost 20000
To connect from a remote machine, ssh to a user account on procservhost and connect to port 20000 using
ssh -t user@procservhost telnet localhost 20000
Youβll land on the soft IOCβs console and get a genuinely informative welcome message. Every line from the procServ server starts with @@@, so you can tell server messages apart from the stuff your IOC sends. Literally such a slay little prefix. π
> telnet localhost 20000
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
@@@ Welcome to the procServ process server (procServ Version 2.1.0)
@@@ Use ^X to kill the child, auto restart is ON, use ^T to toggle auto restart
@@@ procServ server PID: 21413
@@@ Startup directory: /projects/ctl/lange/epics/ioc/test314/iocBoot/iocexample
@@@ Child "My SoftIOC" started as: ./st.cmd
@@@ Child "My SoftIOC" PID: 21414
@@@ procServ server started at: Fri Apr 25 16:43:00 2008
@@@ Child "My SoftIOC" started at: Fri Apr 25 16:43:00 2008
@@@ 0 user(s) and 0 logger(s) connected (plus you)
Type the kill command character ^X to reboot the soft IOC and get server messages about this action. Iconic little reboot move, ngl. π₯
Type the telnet escape character ^] to get back to a telnet prompt, then quit to exit telnet (and ssh when you were connecting remotely). Bye bestie, no cap. π«Ά
Though procServ was originally intended to be an environment to run soft IOCs, an arbitrary process might be started as child. It provides an environment for any program that requires access to its console, while running in the background as a daemon, and keeping a log by writing a file or through a console access and logging facility (such as conserver). Itβs giving βtiny console babysitter with main character energy.β β¨
π± ENVIRONMENT VARIABLES π±
π PROCSERV_PID
Sets the file name to write the PID of the server process into. (See -p option.)
π PROCSERV_DEBUG
If set, procServ starts in debug mode. (See -d option.)
π¨ KNOWN PROBLEMS π¨
None so far.
Thatβs it. Thatβs the whole list. The problem section is literally empty and living its best life. πβ¨
π REPORTING BUGS π
Please report bugs using the issue tracker at https://github.com/ralphlange/procServ/issues.
π AUTHORS π
Originally written by David H. Thompson (ORNL). Current author: Ralph Lange <ralph.lange@gmx.de>.
π RESOURCES π
GitHub project: https://github.com/ralphlange/procServ
π COPYING π
All copyrights reserved. Free use of this software is granted under the terms of the GNU General Public License (GPLv3).
And thatβs the vibe check, bestie: this page is procServ 2.8.0, dated 06/28/2019, and itβs serving PROCSERV(1) energy. Periodt. ππ
π¦ where this page comes from
- epel 10: procServ 2.8.0-1.el10_3 Β· GPL-3.0-only
- epel 9: procServ 2.8.0-1.el9 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms