aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-12-11 21:01:35 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-12-11 21:01:35 +0200
commit94c29f6b6180dca91ae4034ffcb50c6a5c171b75 (patch)
treeba75fd15d2cfe18cb083dc04267c58a63ae28208
parent4d759daeec0abf98294ece5a689c608890ffb4d1 (diff)
downloadpies-94c29f6b6180dca91ae4034ffcb50c6a5c171b75.tar.gz
pies-94c29f6b6180dca91ae4034ffcb50c6a5c171b75.tar.bz2
Final cleanup for version 1.2.
* configure.ac (INETD_SH): Rename to INETD. * NEWS: Update. * src/.gitignore (inetd.sh): rename to inetd. * doc/pies.texi: Update. * src/Makefile.am (pkgstatedir): New variable. (AM_CPPFLAGS): Add define. (inetd.sh): Replace with inetd. (install-exec-hook): Remove. * src/pies.c (statedir): New variable. (pies_keywords): New keyword: "state-directory". (set_file_names): Split in two functions: (set_conf_file_names, set_state_file_names). (main): Call set_conf_file_names before, and set_state_file_names after parsing the configs.
-rw-r--r--NEWS54
-rw-r--r--configure.ac4
-rw-r--r--doc/pies.texi28
-rw-r--r--src/.gitignore2
-rw-r--r--src/Makefile.am25
-rw-r--r--src/pies.c34
6 files changed, 101 insertions, 46 deletions
diff --git a/NEWS b/NEWS
index 025efe1..aafb8a7 100644
--- a/NEWS
+++ b/NEWS
@@ -1,13 +1,59 @@
1GNU Pies NEWS -- history of user-visible changes. 2009-10-26 1GNU Pies NEWS -- history of user-visible changes. 2009-12-11
2Copyright (C) 2009 Sergey Poznyakoff 2Copyright (C) 2009 Sergey Poznyakoff
3See the end of file for copying conditions. 3See the end of file for copying conditions.
4 4
5Please send Pies bug reports to <bug-pies@gnu.org.ua> 5Please send Pies bug reports to <bug-pies@gnu.org> or
6<bug-pies@gnu.org.ua>
6 7
7 8
8Version 1.1.90 (Git) 9Version 1.2, 2009-12-11
9 10
10Pies dubbed a GNU package. 11* First release as a GNU package.
12
13* Full inetd support
14
15The program supports all types of services (including built-in
16ones) and all types of protocols offered by the traditional `inetd'
17utility.
18
19The `inetd.conf' configuration file format is supported. The
20`inetd' configuration file may be supplied either from the command
21line (see below), or via the `include-inetd' configuration statement.
22
23* Inetd replacement
24
25A replacement script for inetd(8) is provided. It is fully
26compatible with the traditional inetd command line, but offers
27the flexibility and new features of pies.
28
29* Configuration file handling
30
31Several configuration files, eventually of different types,
32can be specified in the command line. New command line
33option `--syntax' declares the syntax of configuration
34files that follow it, e.g.:
35
36pies --config-file /etc/pies.conf \
37 --syntax=inetd --config-file /etc/inetd.conf \
38 --syntax=meta1 --config-file /etc/meta1/meta1.conf
39
40* New keywords.
41
42Component keywords: flags, service, socket-type,
43max-instances, max-rate, qotd-file.
44Global keywords: state-directory, include-inetd.
45
46* New option --instance
47
48The `--instance' option allows you to run several instances
49of pies, each of them using separate configuration and
50state files.
51
52* New option --rate
53
54For compatibility with inetd.
55
56* Improved status output.
11 57
12 58
13Version 1.1, 2009-10-20 59Version 1.1, 2009-10-20
diff --git a/configure.ac b/configure.ac
index 15c2835..3e138cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,7 +15,7 @@
15# along with GNU Pies. If not, see <http://www.gnu.org/licenses/>. 15# along with GNU Pies. If not, see <http://www.gnu.org/licenses/>.
16 16
17AC_PREREQ([2.63]) 17AC_PREREQ([2.63])
18AC_INIT([GNU Pies], [1.1.90], [bug-pies@gnu.org.ua]) 18AC_INIT([GNU Pies], [1.2], [bug-pies@gnu.org.ua])
19AC_CONFIG_SRCDIR([src/pies.h]) 19AC_CONFIG_SRCDIR([src/pies.h])
20AC_CONFIG_AUX_DIR([build-aux]) 20AC_CONFIG_AUX_DIR([build-aux])
21AC_CONFIG_HEADERS([config.h]) 21AC_CONFIG_HEADERS([config.h])
@@ -71,7 +71,7 @@ AC_ARG_ENABLE([inetd],
71 AC_HELP_STRING([--enable-inetd], 71 AC_HELP_STRING([--enable-inetd],
72 [build and install a replacement for SBINDIR/inetd]), 72 [build and install a replacement for SBINDIR/inetd]),
73 [case $enableval in 73 [case $enableval in
74 yes) AC_SUBST([INETD_SH], [inetd.sh]);; 74 yes) AC_SUBST([INETD], [inetd]);;
75 no) ;; 75 no) ;;
76 esac]) 76 esac])
77 77
diff --git a/doc/pies.texi b/doc/pies.texi
index 04c85a4..b6f2c91 100644
--- a/doc/pies.texi
+++ b/doc/pies.texi
@@ -277,9 +277,9 @@ in a single command line, e.g.:
277 277
278@smallexample 278@smallexample
279@group 279@group
280pies /etc/pies.conf \ 280pies --config-file /etc/pies.conf \
281 --syntax=inetd --config-file /etc/inetd.conf \ 281 --syntax=inetd --config-file /etc/inetd.conf \
282 --syntax=meta1 --config-file /etc/meta1/meta1.conf 282 --syntax=meta1 --config-file /etc/meta1/meta1.conf
283@end group 283@end group
284@end smallexample 284@end smallexample
285 285
@@ -2051,11 +2051,18 @@ start @command{jabberd} components:
2051@node State Files 2051@node State Files
2052@section State Files 2052@section State Files
2053@cindex state files 2053@cindex state files
2054 Pies uses several files to keep its state information. These files 2054 Pies uses several files to keep its state information. The
2055are kept in local state directory (usually @file{/var/run/pies}, or 2055directory which hosts these files is called @dfn{state directory}, it
2056@file{/usr/local/var/run/pies}). The table below describes these 2056is usually @file{/var/pies} or @file{/usr/local/var/pies}). The state
2057files. The @var{instance} in this table stands for the @command{pies} 2057directory can be configured at run time:
2058instance name (@pxref{instances}). Usually, it is @samp{pies}. 2058
2059@deffn {Config} state-directory @var{dir}
2060Set the program state directory.
2061@end deffn
2062
2063The table below describes the files kept in the state directory. The
2064@var{instance} in this table stands for the @command{pies} instance
2065name (@pxref{instances}). Usually, it is @samp{pies}.
2059 2066
2060@table @asis 2067@table @asis
2061@item @file{@var{instance}.pid} 2068@item @file{@var{instance}.pid}
@@ -2076,8 +2083,9 @@ built-in service (@pxref{qotd}).
2076@end table 2083@end table
2077 2084
2078 The following statements allow to redefine state file names. 2085 The following statements allow to redefine state file names.
2079Use them only if the defaults does not suit your needs, and the 2086Use them only if the defaults do not suit your needs, and niether
2080@option{--instance} option does not help: 2087the @code{state-directory} statement nor the @option{--instance}
2088can help:
2081 2089
2082@deffn {Config} pidfile @var{file} 2090@deffn {Config} pidfile @var{file}
2083Sets the PID file name. 2091Sets the PID file name.
diff --git a/src/.gitignore b/src/.gitignore
index fe9c6fe..18a7111 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -1,4 +1,4 @@
1inetd.sh 1inetd
2meta1gram.c 2meta1gram.c
3meta1gram.h 3meta1gram.h
4meta1gram.output 4meta1gram.output
diff --git a/src/Makefile.am b/src/Makefile.am
index 98815b0..856efe8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -57,28 +57,23 @@ LDADD = \
57 ../gnu/libgnu.a\ 57 ../gnu/libgnu.a\
58 $(MF_PROCTITLE_LIBS) 58 $(MF_PROCTITLE_LIBS)
59 59
60pkgstatedir=$(localstatedir)/pies
61
60AM_CPPFLAGS=\ 62AM_CPPFLAGS=\
61 -DDEFAULT_PREPROCESSOR="$(DEFAULT_PREPROCESSOR)"\ 63 -DDEFAULT_PREPROCESSOR="$(DEFAULT_PREPROCESSOR)"\
62 -DDEFAULT_VERSION_INCLUDE_DIR=\"$(incdir)\"\ 64 -DDEFAULT_VERSION_INCLUDE_DIR=\"$(incdir)\"\
63 -DDEFAULT_INCLUDE_DIR=\"$(pkgdatadir)/include\" 65 -DDEFAULT_INCLUDE_DIR=\"$(pkgdatadir)/include\"\
66 -DDEFAULT_STATE_DIR=\"$(pkgstatedir)\"
64 67
65AM_YFLAGS=-dvt -pmeta1 68AM_YFLAGS=-dvt -pmeta1
66AM_LFLAGS=-dvp -Pmeta1 -olex.yy.c 69AM_LFLAGS=-dvp -Pmeta1 -olex.yy.c
67 70
68SUFFIXES = .in .sh
69EXTRA_SCRIPTS = inetd.in 71EXTRA_SCRIPTS = inetd.in
70sbin_SCRIPTS = @INETD_SH@ 72sbin_SCRIPTS = @INETD@
71inetd.sh: inetd.in
72 73
73.in.sh: 74inetd: inetd.in
74 $(AM_V_GEN)sed 's|_SBINDIR_|$(sbindir)|' $< > $@ 75 $(AM_V_GEN)sed 's|_SBINDIR_|$(sbindir)|' \
76 $(top_srcdir)/src/inetd.in > $(top_builddir)/src/inetd
75 77
76install-exec-hook: 78install-data-hook:
77 if test -n "@INETD_SH@" && \ 79 test -d $(DESTDIR)$(pkgstatedir) || $(MKDIR_P) $(pkgstatedir)
78 test -f $(DESTDIR)$(sbindir)/@INETD_SH@; then \
79 test -f $(DESTDIR)$(sbindir)/inetd$(EXEEXT) && \
80 cd $(DESTDIR)$(sbindir) && \
81 mv -f inetd$(EXEEXT) inetd$(EXEEXT)~; \
82 cd $(DESTDIR)$(sbindir) && \
83 mv @INETD_SH@ inetd$(EXEEXT); \
84 fi
diff --git a/src/pies.c b/src/pies.c
index d9b5a6d..91fabca 100644
--- a/src/pies.c
+++ b/src/pies.c
@@ -27,6 +27,7 @@ char *log_tag;
27struct pies_privs pies_privs; 27struct pies_privs pies_privs;
28int foreground; 28int foreground;
29int command; 29int command;
30char *statedir = DEFAULT_STATE_DIR;
30char *instance; 31char *instance;
31char *pidfile; 32char *pidfile;
32char *ctlfile; 33char *ctlfile;
@@ -1421,6 +1422,10 @@ struct grecs_keyword pies_keywords[] = {
1421 NULL, 1422 NULL,
1422 N_("Show source info with debugging messages."), 1423 N_("Show source info with debugging messages."),
1423 grecs_type_bool, &source_info_option, 0, NULL}, 1424 grecs_type_bool, &source_info_option, 0, NULL},
1425 {"state-directory",
1426 NULL,
1427 N_("Full file name of the program state directory."),
1428 grecs_type_string, &statedir, 0, NULL},
1424 {"pidfile", 1429 {"pidfile",
1425 NULL, 1430 NULL,
1426 N_("Write PID to this file."), 1431 N_("Write PID to this file."),
@@ -2170,28 +2175,28 @@ mkfilename (const char *dir, const char *name, const char *suf)
2170 return s; 2175 return s;
2171} 2176}
2172 2177
2173void 2178static void
2174set_file_names (const char *base) 2179set_conf_file_names (const char *base)
2175{ 2180{
2176 const char *p;
2177
2178 p = strrchr (base, '/');
2179 if (p)
2180 base = p + 1;