diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-01-28 22:07:31 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2010-01-28 22:07:31 +0000 |
commit | df4a2a61ce0cde5190def22309e9807cb5a56ab0 (patch) | |
tree | 364eb6562f6bd41eb3fe0ca15e497a2a76a4b57c | |
parent | 5f392fc3cf8e94112ed7b15b2038e51f1b2b3800 (diff) | |
download | gsc-df4a2a61ce0cde5190def22309e9807cb5a56ab0.tar.gz gsc-df4a2a61ce0cde5190def22309e9807cb5a56ab0.tar.bz2 |
Remove jabberd
git-svn-id: file:///svnroot/gsc/trunk@339 d2de0444-eb31-0410-8365-af798a554d48
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | doc/gsc.texi | 449 | ||||
-rw-r--r-- | jabberd/Makefile.am | 22 | ||||
-rw-r--r-- | jabberd/jabberd.h | 62 | ||||
-rw-r--r-- | jabberd/main.c | 910 | ||||
-rw-r--r-- | jabberd/progman.c | 647 | ||||
-rw-r--r-- | mc/trurl.mc | 15 |
9 files changed, 15 insertions, 2102 deletions
@@ -1 +1,7 @@ | |||
1 | 2010-01-29 Sergey Poznyakoff <gray@gnu.org.ua> | ||
2 | |||
3 | * jabberd: Removed. Use GNU pies instead. | ||
4 | * Makefile.am, configure.ac: Update. | ||
5 | * doc/gsc.texi: Update. | ||
6 | |||
1 | 2009-08-03 Sergey Poznyakoff <gray@gnu.org.ua> | 7 | 2009-08-03 Sergey Poznyakoff <gray@gnu.org.ua> |
diff --git a/Makefile.am b/Makefile.am index 6215e1f..fcba8a0 100644 --- a/Makefile.am +++ b/Makefile.am | |||
@@ -36,3 +36,2 @@ SUBDIRS=\ | |||
36 | ppp\ | 36 | ppp\ |
37 | rc.d\ | 37 | rc.d |
38 | jabberd | ||
diff --git a/configure.ac b/configure.ac index 97a928d..d9dabeb 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -118,4 +118,3 @@ mc | |||
118 | ppp | 118 | ppp |
119 | rc.d | 119 | rc.d' |
120 | jabberd' | ||
121 | 120 | ||
diff --git a/doc/gsc.texi b/doc/gsc.texi index 29e5e1b..87e1ce5 100644 --- a/doc/gsc.texi +++ b/doc/gsc.texi | |||
@@ -121,3 +121,2 @@ Root Utilities | |||
121 | * session-cleanup:: Manage PHP Sessions. | 121 | * session-cleanup:: Manage PHP Sessions. |
122 | * jabberd:: Jabberd dispatcher daemon. | ||
123 | 122 | ||
@@ -127,13 +126,2 @@ firewall | |||
127 | 126 | ||
128 | Jabberd | ||
129 | |||
130 | * jabintro:: Jabberd Operation Overview | ||
131 | * jabopts:: Command Line Options. | ||
132 | * jabberd.cfg:: Main Jabberd Configuration File. | ||
133 | |||
134 | Jabberd Configuration File | ||
135 | |||
136 | * cfgstat:: Configuration File Statements | ||
137 | * example:: An Example of the Configuration file | ||
138 | |||
139 | Startup Scripts | 127 | Startup Scripts |
@@ -843,3 +831,2 @@ cases, though not always. Such files should probably be inspected after | |||
843 | * session-cleanup:: Manage PHP Sessions. | 831 | * session-cleanup:: Manage PHP Sessions. |
844 | * jabberd:: Jabberd dispatcher daemon. | ||
845 | @end menu | 832 | @end menu |
@@ -1169,438 +1156,2 @@ actually remove them. | |||
1169 | 1156 | ||
1170 | @node jabberd | ||
1171 | @section Jabberd | ||
1172 | @cindex jabberd | ||
1173 | The @command{jabberd} utility is a dispatcher daemon for | ||
1174 | @samp{Jabberd 2.x} | ||
1175 | (@uref{http://www.jabber.org/software/jabberd2x.shtml}). It is | ||
1176 | intended as a replacement for the similar utility shipped with the | ||
1177 | @samp{jabberd 2.x} package. There were two reasons that urged for the | ||
1178 | replacement: first, the original @command{jabberd} is written in Perl | ||
1179 | and consumes way too many resources because of that. Secondly, it is | ||
1180 | not flexible enough. In particular, it is only able to control jabber | ||
1181 | daemons, but cannot control external transports (such as @acronym{GG} | ||
1182 | or @acronym{GIT}. | ||
1183 | |||
1184 | @menu | ||
1185 | * jabintro:: Jabberd Operation Overview | ||
1186 | * jabopts:: Command Line Options. | ||
1187 | * jabberd.cfg:: Main Jabberd Configuration File. | ||
1188 | @end menu | ||
1189 | |||
1190 | @node jabintro | ||
1191 | @subsection Jabberd Operation Overview | ||
1192 | |||
1193 | The @acronym{GSC} @command{jabberd} is a supervisor daemon that | ||
1194 | starts a number of @dfn{components} and controls their execution. | ||
1195 | A component is either a jabberd core component (as, | ||
1196 | e.g. @command{c2s}) or some external program (e.g. a transport). The | ||
1197 | daemon reads the list of components from its configuration file upon | ||
1198 | startup. By default, the configuration file is named | ||
1199 | @file{jabberd.cfg} and is located in @code{$sysconfdir} directory, but | ||
1200 | its exact location can be overridden at startup (see @option{-c} | ||
1201 | option, below). If run with the root privileges, @command{jabberd} | ||
1202 | switches to the privileges of a selected user (by default | ||
1203 | @samp{jabber}) right after startup. Then, the program changes file | ||
1204 | creation mask to a safe value (the default is @samp{037}). Unless | ||
1205 | explicitly requested to remain in the foreground, the utility detaches | ||
1206 | itself from the controlling terminal and switches to the background. | ||
1207 | The daemon starts the configured components | ||
1208 | in the order of their appearance in the configuration file. The exact | ||
1209 | command line options and arguments for each component are specified | ||
1210 | in the configuration file. If a particular subprocess prints its | ||
1211 | diagnostics on stderr or stdout, you may instruct @command{jabberd} to | ||
1212 | capture and divert it to a particular @command{syslogd} | ||
1213 | priority (@pxref{stdout}). After launching the components | ||
1214 | @command{jabberd} enters its main loop. It sleeps until either some | ||
1215 | component finishes or a signal is delivered. If a component finishes, | ||
1216 | @command{jabberd} scans its internal list to find components that | ||
1217 | depend on the finished one. Each such component is then terminated | ||
1218 | by sending it @acronym{SIGTERM} signal. Then, the finished component and | ||
1219 | its dependent components are started again. If a process is | ||
1220 | restarted more than 10 times within a two minutes interval, it is | ||
1221 | disabled for the next five minutes (the same way the standard | ||
1222 | @acronym{UNIX} @command{init} utility operates). | ||
1223 | |||
1224 | The @command{jabberd} utility exits if it recieves any of the | ||
1225 | following signals: @acronym{SIGTERM}, @acronym{SIGQUIT}, | ||
1226 | @acronym{SIGINT}. It attempts to restart itself if delivered the | ||
1227 | @acronym{SIGHUP} signal. This is possible only if the utility is | ||
1228 | started using its absolute file name. In any case, before exiting, | ||
1229 | the utility shuts down all components @emph{in the reverse | ||
1230 | order} of their appearance in the configuration file. The processes | ||
1231 | are shut down by sending them @acronym{SIGTERM} signals. If a | ||
1232 | component does not exit within a 1 second interval, it is re-sent the | ||
1233 | same signal. This procedure continues until either all components | ||
1234 | terminate or the @dfn{shutdown timeout} interval expires, whichever | ||
1235 | happens first. If the latter happens, any components still left | ||
1236 | running are slayed using @acronym{SIGKILL} signal. The default | ||
1237 | shutdown timeout is 5 seconds and it may be changed using | ||
1238 | @code{shutdown-timeout} configuration file statement (@pxref{cfgstat}). | ||
1239 | |||
1240 | Two signals are special to @command{jabberd}: @acronym{SIGUSR1} | ||
1241 | and @acronym{SIGUSR2}. The @acronym{SIGUSR1} signal instructs the | ||
1242 | program to shut down and restart a particular component or a set | ||
1243 | of components. The list of components to be restarted is passed to | ||
1244 | the running program via a @dfn{control file} (@pxref{ctlfile}). This | ||
1245 | mechanism is used by @command{jabberd | ||
1246 | --restart}. @FIXME-xref{restarting selected components}. | ||
1247 | |||
1248 | The @acronym{SIGUSR2} signal instructs @command{jabberd} to return | ||
1249 | statistics about running components. It is used by @command{jabberd | ||
1250 | --status} (@FIXME-pxref{showing runtime statistics}). | ||
1251 | |||
1252 | @node jabopts | ||
1253 | @subsection Jabberd Invocation | ||
1254 | @UNREVISED{} | ||
1255 | |||
1256 | By default, @command{jabberd} attempts to start in @dfn{dispatcher | ||
1257 | mode}, which is described in the previous subsection. If started | ||
1258 | without additional options, the program will use compiled-in defaults. | ||
1259 | Otherwise, the following options may be given: | ||
1260 | |||
1261 | @table @option | ||
1262 | @item --config-file=@var{file} | ||
1263 | @itemx -c @var{file} | ||
1264 | Use @var{file} as the main configuration file. | ||
1265 | |||
1266 | @item --debug | ||
1267 | @itemx -D | ||
1268 | Increase debugging level. | ||
1269 | |||
1270 | @item --foreground | ||
1271 | @itemx -f | ||
1272 | Do not disconnect from the controlling terminal, but run in | ||
1273 | foreground mode instead. This option is mainly useful for debugging. | ||
1274 | It implies @option{-e} (see below). | ||
1275 | |||
1276 | @item --force | ||
1277 | Attempt to start up even if another instance of @command{jabberd} | ||
1278 | seems to be running. | ||
1279 | |||
1280 | @item --stderr | ||
1281 | @itemx -e | ||
1282 | Print all diagnostics on the standard output. | ||
1283 | @end table | ||
1284 | |||
1285 | A set of options may be used to control the running instance of the | ||
1286 | program and request a detailed information about it. | ||
1287 | |||
1288 | @table @option | ||
1289 | @item --restart @var{tag} [@var{tags}...] | ||
1290 | @itemx -r @var{tag} [@var{tag}...] | ||
1291 | Restart named components. Any number of arguments can be | ||
1292 | specified. Each @var{tag} must correspond to a valid tag in | ||
1293 | @file{jabberd.cfg} file. | ||
1294 | |||
1295 | @item --status | ||
1296 | Display information about the running instance. Return 0 if the | ||
1297 | instance is running, 1 otherwise. | ||
1298 | |||
1299 | @smallexample | ||
1300 | $ jabberd --status | ||
1301 | jabberd: [INFO] jabberd is running; PID 537 | ||
1302 | retranslator jit/stderr 548 | ||
1303 | retranslator jit/stdout 547 | ||
1304 | retranslator ggtrans/stderr 545 | ||
1305 | retranslator ggtrans/stdout 544 | ||
1306 | core router 539 router -c /usr/local/etc/jabberd/router.xml | ||
1307 | core resolver 540 resolver -c /usr/local/etc/jabberd/resolver.xml | ||
1308 | core sm 541 sm -c /usr/local/etc/jabberd/sm.xml | ||
1309 | core s2s 542 s2s -c /usr/local/etc/jabberd/s2s.xml | ||
1310 | core c2s 543 c2s -c /usr/local/etc/jabberd/c2s.xml | ||
1311 | transport ggtrans 546 /usr/local/sbin/jggtrans -f | ||
1312 | transport jit 549 /usr/local/bin/jabberd-jit -c /usr/local/etc/jit.xml | ||
1313 | @end smallexample | ||
1314 | |||
1315 | @item --stop | ||
1316 | Stop the running instance by sending it the @acronym{SIGTERM} signal. | ||
1317 | |||
1318 | @item --reload | ||
1319 | @item --hup | ||
1320 | Restart the running instance by sending it the @acronym{SIGHUP} signal. | ||
1321 | @end table | ||
1322 | |||
1323 | The following are informational options: | ||
1324 | |||
1325 | @table @option | ||
1326 | @item --help | ||
1327 | @itemx -h | ||
1328 | Display a terse usage summary. | ||
1329 | |||
1330 | @item --version | ||
1331 | @itemx -v | ||
1332 | Print program version and licensing information and exit. | ||
1333 | @end table | ||
1334 | |||
1335 | @node jabberd.cfg | ||
1336 | @subsection Jabberd Configuration File | ||
1337 | |||
1338 | The configuration file has a line-oriented syntax. Empty lines are | ||
1339 | ignored. Comments are introduced by a pound sign (@samp{#}), | ||
1340 | everything starting from the first occurrence of @samp{#} up to the | ||
1341 | end of line is ignored. | ||
1342 | |||
1343 | Configuration statements consist of @dfn{command word} and one or | ||
1344 | several @dfn{arguments}, separated by any amount of whitespace. There | ||