1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
|
.\" Title: scriptmgr
.\" Author:
.\" Generator: DocBook XSL Stylesheets v1.73.2 <http://docbook.sf.net/>
.\" Date: 09/22/2008
.\" Manual:
.\" Source:
.\"
.TH "SCRIPTMGR" "1" "09/22/2008" "" ""
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.SH "NAME"
scriptmgr - utility for controlling other skytools scripts.
.SH "SYNOPSIS"
.sp
.RS 4
.nf
scriptmgr\.py [switches] config\.ini <command> [\-a | job_name \.\.\. ]
.fi
.RE
.SH "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\.
.sp
.SH "COMMANDS"
.SS "status"
.sp
.RS 4
.nf
scriptmgr config\.ini status
.fi
.RE
.sp
Show status for all known jobs\.
.sp
.SS "start"
.sp
.RS 4
.nf
scriptmgr config\.ini start \-a
scriptmgr config\.ini start job_name1 job_name2 \.\.\.
.fi
.RE
.sp
launch script(s) that are not running\.
.sp
.SS "stop"
.sp
.RS 4
.nf
scriptmgr config\.ini stop \-a
scriptmgr config\.ini stop job_name1 job_name2 \.\.\.
.fi
.RE
.sp
stop script(s) that are running\.
.sp
.SS "restart"
.sp
.RS 4
.nf
scriptmgr config\.ini restart \-a
scriptmgr config\.ini restart job_name1 job_name2 \.\.\.
.fi
.RE
.sp
restart scripts\.
.sp
.SS "reload"
.sp
.RS 4
.nf
scriptmgr config\.ini reload \-a
scriptmgr config\.ini reload job_name1 job_name2 \.\.\.
.fi
.RE
.sp
Send SIGHUP to scripts that are running\.
.sp
.SH "CONFIG"
.SS "Common configuration parameters"
.PP
job_name
.RS 4
Name 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\.
.RE
.PP
pidfile
.RS 4
Location for pid file\. If not given, script is disallowed to daemonize\.
.RE
.PP
logfile
.RS 4
Location for log file\.
.RE
.PP
loop_delay
.RS 4
If continuisly running process, how long to sleep after each work loop, in seconds\. Default: 1\.
.RE
.PP
connection_lifetime
.RS 4
Close and reconnect older database connections\.
.RE
.PP
use_skylog
.RS 4
foo\.
.RE
.SS "scriptmgr parameters"
.PP
config_list
.RS 4
List of glob patters for finding config files\. Example:
.sp
.RS 4
.nf
config_list = ~/dbscripts/conf/*\.ini, ~/random/conf/*\.ini
.fi
.RE
.RE
.SS "Service section parameters"
.PP
cwd
.RS 4
Working directory for script\.
.RE
.PP
args
.RS 4
Arguments to give to script, in addition to
\-d\.
.RE
.PP
script
.RS 4
Path to script\. Unless script is in PATH, full path should be given\.
.RE
.PP
disabled
.RS 4
If this service should be ignored\.
.RE
.SS "Example config file"
.sp
.RS 4
.nf
[scriptmgr]
job_name = scriptmgr_livesrv
logfile = ~/log/%(job_name)s\.log
pidfile = ~/pid/%(job_name)s\.pid
.fi
.RE
.sp
.RS 4
.nf
config_list = ~/scripts/conf/*\.ini
.fi
.RE
.sp
.RS 4
.nf
# defaults for all service sections
[DEFAULT]
cwd = ~/scripts
.fi
.RE
.sp
.RS 4
.nf
[table_dispatcher]
script = table_dispatcher\.py
args = \-v
.fi
.RE
.sp
.RS 4
.nf
[cube_dispatcher]
script = python2\.4 cube_dispatcher\.py
disabled = 1
.fi
.RE
.sp
.RS 4
.nf
[pgqadm]
script = ~/scripts/pgqadm\.py
args = ticker
.fi
.RE
.SH "COMMAND LINE SWITCHES"
Following switches are common to all skytools\.DBScript\-based Python programs\.
.PP
\-h, \-\-help
.RS 4
show help message and exit
.RE
.PP
\-q, \-\-quiet
.RS 4
make program silent
.RE
.PP
\-v, \-\-verbose
.RS 4
make program more verbose
.RE
.PP
\-d, \-\-daemon
.RS 4
make program go background
.RE
.sp
Following switches are used to control already running process\. The pidfile is read from config then signal is sent to process id specified there\.
.PP
\-r, \-\-reload
.RS 4
reload config (send SIGHUP)
.RE
.PP
\-s, \-\-stop
.RS 4
stop program safely (send SIGINT)
.RE
.PP
\-k, \-\-kill
.RS 4
kill program immidiately (send SIGTERM)
.RE
.sp
Options specific to scriptmgr:
.PP
\-a, \-\-all
.RS 4
Operate on all non\-disabled scripts\.
.RE
|