GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
OpenXPKI::Server::Watchdog(3) User Contributed Perl Documentation OpenXPKI::Server::Watchdog(3)

The watchdog thread

The watchdog is forked away on startup and takes care of paused workflows. The system has a default configuration but you can override it via the system configuration.

The namespace is system.watchdog. The properties are:

Retry this often to fork away the initial watchdog process before failing finally. default: 5
There are situations (database locks, no free resources) where a watchdog can not fork away a new worker. After max_exception_threshhold errors occured, we kill the watchdog. This is a fatal error that must be handled! default: 10
The number of seconds to sleep after the watchdog ran into an exception. default: 60
The number of seconds to sleep after the watchdog ran into an exception. default: 15
Try to restarted stale workflows this often before failing them. default: 3
Allow multiple watchdogs in parallel. This controls the number of control process, setting this to more than one is usually not necessary (and also not wise).

default: 1

Maximum number of workers that the watchdog can run in parallel. No new workflows are woke up if this limit is reached and the watchdog will sleep for interval_sleep_overload seconds.

default: 50

Seconds to wait after server start before the watchdog starts scanning. default: 10;
Seconds between two scan runs if no result was found on last run. default: 5
Seconds between two scan runs if a result was found on last run. default: 1
Seconds between two purges of expired sessions from backend. default: 0 (do not purge expired sessions)
Seconds between two attempts to purge expired / superseded CRLs default: 0 (do not purge CRLs)
Seconds between two attempts to archive workflows whose "archive_at" date was exceeded. default: 0 (do not archive workflows)
User ID to run the forked child process as. Default: 0

This attribute cannot be set via config / constructor.

Group ID to run the forked child process as. Default: 0

This attribute cannot be set via config / constructor.

Bool value: set to 1 to prevent installation of special "SIGCHLD" handler and keep the current handler instead. The special "SIGCHLD" handler allows for execution of system() and the like in the parent process after starting the watchdog. But it will prevent reaping zombie processes that are forked via other modules (e.g. Net::Server). Setting this to 1 should only be neccessary in the process where "run" in Net::Server is called. default: 0

This attribute cannot be set via config / constructor.

Signal handler for SIGHUP registered with the forked worker process.

Triggered by the master process when a reload happens.

Signal handler for SIGTERM registered with the forked worker process.

Trigger by the master process to terminate the worker.

Static method to instantiate and start the watchdog or make it reload it's config.

Static method that looks for watchdog instances and sends them a SIGHUP signal.

This will NOT kill the watchdog but tell it to gracefully stop.

Forks away a worker child, returns the pid of the worker

Watchdog main loop (child process).

Runs until the package scope variable $TERMINATE is set to 1.

Purge expired sessions from backend if enough time elapsed.

Purge expired CRLs

Removes records from the CRL table if next_update is in the past

Do a select on the database to check for waiting or stale workflows, if found, the workflow is marked and reinstantiated, the id of the workflow is returned. Returns undef, if nothing is found.

__flag_for_wakeup( wf_id )

Flag the workflow with the given ID as "being woken up" via database.

To prevent a workflow from being reloaded by two watchdog instances, this method first writes a random marker to create "row lock" and tries to reload the row using this marker. If either one fails, returnes undef.

Restore the session environment and execute the action, runs in eval block and returns the error message in case of error.

Archive workflows whose "archive_at" date was exceeded.

__flag_for_archiving( wf_id )

Flag the workflow with the given ID as "being archived" via database to prevent a workflow from being archived by two watchdog instances.

Flagging is done by updating DB field "workflow_archive_at" with an intermediate value of 0. It is updated to "null" once archiving is finished, so a permanent value of 0 indicates a severe error.

Returns 1 upon success or "undef" if workflow is/was archived by another process.

2025-07-15 perl v5.40.2

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.