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,3 +1,9 @@
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>
2 8
3 * vpn/svpnsh: Fix concurrent login recognition. 9 * vpn/svpnsh: Fix concurrent login recognition.
diff --git a/Makefile.am b/Makefile.am
index 6215e1f..fcba8a0 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,5 +34,4 @@ SUBDIRS=\
34 maint\ 34 maint\
35 mc\ 35 mc\
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
@@ -116,8 +116,7 @@ fsf-move
116maint 116maint
117mc 117mc
118ppp 118ppp
119rc.d 119rc.d'
120jabberd'
121 120
122AC_ARG_VAR([XMODLIST], 121AC_ARG_VAR([XMODLIST],
123 [Comma-delimited list of modules to exclude from building (see also --enable-modules)]) 122 [Comma-delimited list of modules to exclude from building (see also --enable-modules)])
diff --git a/doc/gsc.texi b/doc/gsc.texi
index 29e5e1b..87e1ce5 100644
--- a/doc/gsc.texi
+++ b/doc/gsc.texi
@@ -119,23 +119,11 @@ Root Utilities
119* bind replication:: A Framework for Replicating Master @command{bind} Server. 119* bind replication:: A Framework for Replicating Master @command{bind} Server.
120* firewall:: M4 Wrappers For Setting Firewalls. 120* firewall:: M4 Wrappers For Setting Firewalls.
121* session-cleanup:: Manage PHP Sessions. 121* session-cleanup:: Manage PHP Sessions.
122* jabberd:: Jabberd dispatcher daemon.
123 122
124firewall 123firewall
125 124
126* Primitives:: A set of primitives defined in @file{firewall.m4} 125* Primitives:: A set of primitives defined in @file{firewall.m4}
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
140 128
141* rc.inet1:: A Replacement for Slackware @command{rc.inet1}. 129* rc.inet1:: A Replacement for Slackware @command{rc.inet1}.
@@ -841,7 +829,6 @@ cases, though not always. Such files should probably be inspected after
841* bind replication:: A Framework for Replicating Master @command{bind} Server. 829* bind replication:: A Framework for Replicating Master @command{bind} Server.
842* firewall:: M4 Wrappers For Setting Firewalls. 830* firewall:: M4 Wrappers For Setting Firewalls.
843* session-cleanup:: Manage PHP Sessions. 831* session-cleanup:: Manage PHP Sessions.
844* jabberd:: Jabberd dispatcher daemon.
845@end menu 832@end menu
846 833
847@node ckaliases 834@node ckaliases
@@ -1167,442 +1154,6 @@ actually remove them.
1167@option{-n}. 1154@option{-n}.
1168@end table 1155@end table
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.