5. cpid¶
This is the server daemon for the Compound Pi application. Starting the
application with no arguments starts the server in the foreground. The server
can be configured through command line arguments or a configuration file (which
defaults to /etc/cpid.ini, /usr/local/etc/cpid.ini, or
~/.cpid.ini).
5.1. Synopsis¶
cpid [-h] [--version] [-c CONFIG] [-q] [-v] [-l FILE] [-P] [-b ADDRESS]
[-p PORT] [-d] [-u UID] [-g GID] [--pidfile FILE]
5.2. Description¶
-
-h,--help¶ show this help message and exit
-
--version¶ show program’s version number and exit
-
-cCONFIG,--configCONFIG¶ specify a configuration file to load
-
-q,--quiet¶ produce less console output
-
-v,--verbose¶ produce more console output
-
-lFILE,--log-fileFILE¶ log messages to the specified file
-
-P,--pdb¶ run under PDB (debug mode)
-
-bADDRESS,--bindADDRESS¶ specifies the address to listen on for packets (default: 0.0.0.0)
-
-pPORT,--portPORT¶ specifies the UDP port for the server to listen on (default: 5647)
-
-d,--daemon¶ if specified, start as a background daemon
-
-uUID,--userUID¶ specifies the user that the daemon should run as. Defaults to the effective user (typically root)
-
-gGID,--groupGID¶ specifies the group that the daemon should run as. Defaults to the effective group (typically root)
-
--pidfileFILE¶ specifies the location of the pid lock file
5.3. Usage¶
The Compound Pi server is typically started at boot time by the init service. The Raspbian package includes an init script for this purpose. Users on other platforms will need to write their own init script.
When the server starts successfully it will initialize the camera and hold it open. This will prevent other applications from using the camera but also makes it easy to see that the server has started as the camera’s LED will be lit (this is useful as Compound Pi servers are typically headless).