Pubs offline daemon

Checking the Configuration of Daemons

On each of the servers that are processing projects for PUBS, there is a daemon that keeps all of the project scheduled and launching each project execution. The details of the daemons can be found in the PUBS documentation here. The specific configuration of the daemons is documented on the production status page. But the most effective way to know the current status of daemons on the interactive servers is to log in as uboonepro and run the list_daemon command. The truncated output of the command is shown below:

<> source /uboone/app/users/uboonepro/pubs_devel/config/
<> list_daemon
[ DEBUG   ] pub_logger (L: 81 ) >> {_add_logger} OPENED LOGGER pubdb_conn
[ DEBUG   ] pub_logger (L: 81 ) >> {_add_logger} OPENED LOGGER list_daemon
[ INFO    ] pubdb_conn (L: 110) >> {_connect} Connected to DB: (,5437,microboone_prod,uboone_admin,XXX) @ 2017-02-28 16:02:50
[ INFO    ] pubdb_conn (L: 115) >> {_connect} Setting ROLE = uboone_admin
[ DEBUG   ] pubdb_api (L: 103) >> {execute}  SELECT Server, MaxProjCtr, LifeTime, LogRange, RunSyncPeriod, UpdatePeriod, CleanUpPeriod, EMail, Enabled FROM ListDaemon();

Server       :
Proj. Ctr    : 10
LifeTime     : 604800 [s]
Log Period   : 259200 [s]
RunSync Time : 120 [s]
Update Time  : 60 [s]
CleanUp Time : 300 [s]
Email        :
Enabled      : True

Adding or Changing a daemon configuration

This tells you the current configuration, but this is not the same as the format of the configuration file used for creating/changing the configuration of a daemon. The configuration file is kept in /uboone/app/users/uboonepro/pubs_devel/daemon.cfg and is formatted like this:

MAX_CTR       15
LIFETIME      604800
SYNC_TIME     120
ENABLE        True

You can also get the properly formatted config file by running the command with <uid> and <date> filled in:

cfg_dump_daemon current_daemon_<uid>_<date>.cfg

The configuration parameters are listed here:

SERVER name of the server that the daemon is running on and registered in the PUBS DB
MAX_CTR maximum number of projects launched at the same time
LIFETIME time in seconds that the daemon can run before self-halted (604800 = 7 days)
CLEANUP_TIME when the daemon is told to stop, no more projects are launched, and it waits this amount of seconds for all projects to complete. If projects have not completed, they are killed and the daemon stops
LOG_LIFETIME how long the logs are kept running before rotating (259200 = 3 days)
SYNC_TIME how often the daemon syncs with the database for current status
UPDATE_TIME how often the daemon pings projects to update status
CONTACT email addresses to send failures and notifications to
ENABLE whether or not the daemon is turned on or off for processing

Once you've updated the daemon configuration file (or created a new configuration file) and can process the new configuration using the command:

register_daemon current_daemon_<uid>_<date>.cfg

And then you've got a brand new bouncing baby daemon!