table of contents
other versions
- wheezy 2.1.13-2
SCRIPTMGR(1) | SCRIPTMGR(1) |
NAME¶
scriptmgr - utility for controlling other skytools scripts.SYNOPSIS¶
scriptmgr.py [switches] config.ini <command> [-a | job_name ... ]
DESCRIPTION¶
scriptmgr is used to manage several scripts together. It discovers potential jobs based on config file glob expression. From config file it gets both job_name and service type (that is the main section name eg [cube_dispatcher]). For each service type there is subsection in the config how to handle it. Unknown services are ignored.COMMANDS¶
status¶
scriptmgr config.ini status
start¶
scriptmgr config.ini start -a scriptmgr config.ini start job_name1 job_name2 ...
stop¶
scriptmgr config.ini stop -a scriptmgr config.ini stop job_name1 job_name2 ...
restart¶
scriptmgr config.ini restart -a scriptmgr config.ini restart job_name1 job_name2 ...
reload¶
scriptmgr config.ini reload -a scriptmgr config.ini reload job_name1 job_name2 ...
CONFIG¶
Common configuration parameters¶
job_nameName for particulat job the script does.
Script will log under this name to logdb/logserver. The name is also used as
default for PgQ consumer name. It should be unique.
pidfile
Location for pid file. If not given, script is
disallowed to daemonize.
logfile
Location for log file.
loop_delay
If continuisly running process, how long to
sleep after each work loop, in seconds. Default: 1.
connection_lifetime
Close and reconnect older database
connections.
log_count
Number of log files to keep. Default: 3
log_size
Max size for one log file. File is rotated if
max size is reached. Default: 10485760 (10M)
use_skylog
If set, search for [./skylog.ini,
~/.skylog.ini, /etc/skylog.ini]. If found then the file is used as config file
for Pythons logging module. It allows setting up fully customizable logging
setup.
scriptmgr parameters¶
config_listList of glob patters for finding config files.
Example:
config_list = ~/dbscripts/conf/*.ini, ~/random/conf/*.ini
Service section parameters¶
cwdWorking directory for script.
args
Arguments to give to script, in addition to
-d.
script
Path to script. Unless script is in PATH, full
path should be given.
disabled
If this service should be ignored.
Example config file¶
[scriptmgr] job_name = scriptmgr_livesrv logfile = ~/log/%(job_name)s.log pidfile = ~/pid/%(job_name)s.pid
config_list = ~/scripts/conf/*.ini
# defaults for all service sections [DEFAULT] cwd = ~/scripts
[table_dispatcher] script = table_dispatcher.py args = -v
[cube_dispatcher] script = python2.4 cube_dispatcher.py disabled = 1
[pgqadm] script = ~/scripts/pgqadm.py args = ticker
COMMAND LINE SWITCHES¶
Following switches are common to all skytools.DBScript-based Python programs. -h, --helpshow help message and exit
-q, --quiet
make program silent
-v, --verbose
make program more verbose
-d, --daemon
make program go background
reload config (send SIGHUP)
-s, --stop
stop program safely (send SIGINT)
-k, --kill
kill program immidiately (send SIGTERM)
Operate on all non-disabled scripts.
03/13/2012 |