aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--Makefile.am3
-rw-r--r--configure.ac3
-rw-r--r--doc/gsc.texi449
-rw-r--r--jabberd/Makefile.am22
-rw-r--r--jabberd/jabberd.h62
-rw-r--r--jabberd/main.c910
-rw-r--r--jabberd/progman.c647
-rw-r--r--mc/trurl.mc15
9 files changed, 15 insertions, 2102 deletions
diff --git a/ChangeLog b/ChangeLog
index 6894c0e..b855c2f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1 +1,7 @@
12010-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
12009-08-03 Sergey Poznyakoff <gray@gnu.org.ua> 72009-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
118ppp 118ppp
119rc.d 119rc.d'
120jabberd'
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
128Jabberd
129
130* jabintro:: Jabberd Operation Overview
131* jabopts:: Command Line Options.
132* jabberd.cfg:: Main Jabberd Configuration File.
133
134Jabberd Configuration File
135
136* cfgstat:: Configuration File Statements
137* example:: An Example of the Configuration file
138
139Startup Scripts 127Startup 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
1176intended as a replacement for the similar utility shipped with the
1177@samp{jabberd 2.x} package. There were two reasons that urged for the
1178replacement: first, the original @command{jabberd} is written in Perl
1179and consumes way too many resources because of that. Secondly, it is
1180not flexible enough. In particular, it is only able to control jabber
1181daemons, but cannot control external transports (such as @acronym{GG}
1182or @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
1194starts a number of @dfn{components} and controls their execution.
1195A component is either a jabberd core component (as,
1196e.g. @command{c2s}) or some external program (e.g. a transport). The
1197daemon reads the list of components from its configuration file upon
1198startup. By default, the configuration file is named
1199@file{jabberd.cfg} and is located in @code{$sysconfdir} directory, but
1200its exact location can be overridden at startup (see @option{-c}
1201option, below). If run with the root privileges, @command{jabberd}
1202switches to the privileges of a selected user (by default
1203@samp{jabber}) right after startup. Then, the program changes file
1204creation mask to a safe value (the default is @samp{037}). Unless
1205explicitly requested to remain in the foreground, the utility detaches
1206itself from the controlling terminal and switches to the background.
1207The daemon starts the configured components
1208in the order of their appearance in the configuration file. The exact
1209command line options and arguments for each component are specified
1210in the configuration file. If a particular subprocess prints its
1211diagnostics on stderr or stdout, you may instruct @command{jabberd} to
1212capture and divert it to a particular @command{syslogd}
1213priority (@pxref{stdout}). After launching the components
1214@command{jabberd} enters its main loop. It sleeps until either some
1215component finishes or a signal is delivered. If a component finishes,
1216@command{jabberd} scans its internal list to find components that
1217depend on the finished one. Each such component is then terminated
1218by sending it @acronym{SIGTERM} signal. Then, the finished component and
1219its dependent components are started again. If a process is
1220restarted more than 10 times within a two minutes interval, it is
1221disabled 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
1225following 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
1228started using its absolute file name. In any case, before exiting,
1229the utility shuts down all components @emph{in the reverse
1230order} of their appearance in the configuration file. The processes
1231are shut down by sending them @acronym{SIGTERM} signals. If a
1232component does not exit within a 1 second interval, it is re-sent the
1233same signal. This procedure continues until either all components
1234terminate or the @dfn{shutdown timeout} interval expires, whichever
1235happens first. If the latter happens, any components still left
1236running are slayed using @acronym{SIGKILL} signal. The default
1237shutdown 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}
1241and @acronym{SIGUSR2}. The @acronym{SIGUSR1} signal instructs the
1242program to shut down and restart a particular component or a set
1243of components. The list of components to be restarted is passed to
1244the running program via a @dfn{control file} (@pxref{ctlfile}). This
1245mechanism is used by @command{jabberd
1246--restart}. @FIXME-xref{restarting selected components}.
1247
1248 The @acronym{SIGUSR2} signal instructs @command{jabberd} to return
1249statistics 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
1257mode}, which is described in the previous subsection. If started
1258without additional options, the program will use compiled-in defaults.
1259Otherwise, 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
1273foreground mode instead. This option is mainly useful for debugging.
1274It implies @option{-e} (see below).
1275
1276@item --force
1277 Attempt to start up even if another instance of @command{jabberd}
1278seems 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
1286program 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
1292specified. 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
1297instance is running, 1 otherwise.
1298
1299@smallexample
1300$ jabberd --status
1301jabberd: [INFO] jabberd is running; PID 537
1302retranslator jit/stderr 548
1303retranslator jit/stdout 547
1304retranslator ggtrans/stderr 545
1305retranslator ggtrans/stdout 544
1306core router 539 router -c /usr/local/etc/jabberd/router.xml
1307core resolver 540 resolver -c /usr/local/etc/jabberd/resolver.xml
1308core sm 541 sm -c /usr/local/etc/jabberd/sm.xml
1309core s2s 542 s2s -c /usr/local/etc/jabberd/s2s.xml
1310core c2s 543 c2s -c /usr/local/etc/jabberd/c2s.xml
1311transport ggtrans 546 /usr/local/sbin/jggtrans -f
1312transport 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
1339ignored. Comments are introduced by a pound sign (@samp{#}),
1340everything starting from the first occurrence of @samp{#} up to the
1341end of line is ignored.
1342
1343 Configuration statements consist of @dfn{command word} and one or
1344several @dfn{arguments}, separated by any amount of whitespace. There
1345are @samp{simple} and @samp{compound} configuration statements.
1346Simple statements occupy a single line. Compound statements begin
1347with a simple statement, occupy several lines, and end with @code{end}
1348statement, appearing on a line by itself. Compound statements in turn
1349contain another simple statements.
1350
1351 The simplest working @file{ja