This is a static helper class that collects some common methods to interact with
the OpenXPKI system.
Parameters common to all methods:
- CONFIG
- filesystem path to the config git repository
- SILENT
- set to 1 to surpress any output
All methods are static and return 0 on success, 1 on configuration
errors and 2 on system errors.
All Parameters to methods are optional, if no parameters are given
the OpenXPKI::Config Layer is intanciated and queried for the needed
values.
Start the server.
Parameters:
- PID Pid to check for a running server
- FOREGROUND (0|1) Weather to start the daemon in foreground (implies
restart)
- RESTART (0|1) Weather to restart a running server
- DEBUG_LEVEL hashref: module => level
- DEBUG_BITMASK hashref: module => bitmask
- DEBUG_NOCENSOR (0|1) turn of censoring of debug messages
- KEEP_TEMP (0|1) Weather to not delete temp files
- !!THIS MIGHT BE A SECURITY RISK !! as files might contain private
keys or other confidential data!
Stop the server
Parameters:
- PID or PIDFILE
Check if the server is running
Parameters:
- SLEEP
- Wait sleep seconds before testing
Reload some parts of the config (sends a HUP to the server pid)
Parameters:
- PID or PIDFILE
Get a list of all process belonging to this instance
Returns a hash with keys:
- server
- Holding the pid of the main server process.
- watchdog
- List of running watchdog process. Usually this is only a single pid but
can also have more than one. If empty, the watchdog was either disabled or
terminated due to too many internal errors.
- worker
- List of pids of running session workers (connected to the socket). This
might also be empty if no process is running.
- workflow
- List of pids of all workers currently handling workflows (contains
watchdog and user initiated requests).
Get a list of all running workers with pid, time and info