diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-12-11 21:01:35 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-12-11 21:01:35 +0200 |
commit | 94c29f6b6180dca91ae4034ffcb50c6a5c171b75 (patch) | |
tree | ba75fd15d2cfe18cb083dc04267c58a63ae28208 | |
parent | 4d759daeec0abf98294ece5a689c608890ffb4d1 (diff) | |
download | pies-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-- | NEWS | 54 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | doc/pies.texi | 28 | ||||
-rw-r--r-- | src/.gitignore | 2 | ||||
-rw-r--r-- | src/Makefile.am | 25 | ||||
-rw-r--r-- | src/pies.c | 34 |
6 files changed, 101 insertions, 46 deletions
@@ -1,13 +1,59 @@ | |||
1 | GNU Pies NEWS -- history of user-visible changes. 2009-10-26 | 1 | GNU Pies NEWS -- history of user-visible changes. 2009-12-11 |
2 | Copyright (C) 2009 Sergey Poznyakoff | 2 | Copyright (C) 2009 Sergey Poznyakoff |
3 | See the end of file for copying conditions. | 3 | See the end of file for copying conditions. |
4 | 4 | ||
5 | Please send Pies bug reports to <bug-pies@gnu.org.ua> | 5 | Please send Pies bug reports to <bug-pies@gnu.org> or |
6 | <bug-pies@gnu.org.ua> | ||
6 | 7 | ||
7 | 8 | ||
8 | Version 1.1.90 (Git) | 9 | Version 1.2, 2009-12-11 |
9 | 10 | ||
10 | Pies dubbed a GNU package. | 11 | * First release as a GNU package. |
12 | |||
13 | * Full inetd support | ||
14 | |||
15 | The program supports all types of services (including built-in | ||
16 | ones) and all types of protocols offered by the traditional `inetd' | ||
17 | utility. | ||
18 | |||
19 | The `inetd.conf' configuration file format is supported. The | ||
20 | `inetd' configuration file may be supplied either from the command | ||
21 | line (see below), or via the `include-inetd' configuration statement. | ||
22 | |||
23 | * Inetd replacement | ||
24 | |||
25 | A replacement script for inetd(8) is provided. It is fully | ||
26 | compatible with the traditional inetd command line, but offers | ||
27 | the flexibility and new features of pies. | ||
28 | |||
29 | * Configuration file handling | ||
30 | |||
31 | Several configuration files, eventually of different types, | ||
32 | can be specified in the command line. New command line | ||
33 | option `--syntax' declares the syntax of configuration | ||
34 | files that follow it, e.g.: | ||
35 | |||
36 | pies --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 | |||
42 | Component keywords: flags, service, socket-type, | ||
43 | max-instances, max-rate, qotd-file. | ||
44 | Global keywords: state-directory, include-inetd. | ||
45 | |||
46 | * New option --instance | ||
47 | |||
48 | The `--instance' option allows you to run several instances | ||
49 | of pies, each of them using separate configuration and | ||
50 | state files. | ||
51 | |||
52 | * New option --rate | ||
53 | |||
54 | For compatibility with inetd. | ||
55 | |||
56 | * Improved status output. | ||
11 | 57 | ||
12 | 58 | ||
13 | Version 1.1, 2009-10-20 | 59 | Version 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 | ||
17 | AC_PREREQ([2.63]) | 17 | AC_PREREQ([2.63]) |
18 | AC_INIT([GNU Pies], [1.1.90], [bug-pies@gnu.org.ua]) | 18 | AC_INIT([GNU Pies], [1.2], [bug-pies@gnu.org.ua]) |
19 | AC_CONFIG_SRCDIR([src/pies.h]) | 19 | AC_CONFIG_SRCDIR([src/pies.h]) |
20 | AC_CONFIG_AUX_DIR([build-aux]) | 20 | AC_CONFIG_AUX_DIR([build-aux]) |
21 | AC_CONFIG_HEADERS([config.h]) | 21 | AC_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 |
280 | pies /etc/pies.conf \ | 280 | pies --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 |
2055 | are kept in local state directory (usually @file{/var/run/pies}, or | 2055 | directory which hosts these files is called @dfn{state directory}, it |
2056 | @file{/usr/local/var/run/pies}). The table below describes these | 2056 | is usually @file{/var/pies} or @file{/usr/local/var/pies}). The state |
2057 | files. The @var{instance} in this table stands for the @command{pies} | 2057 | directory can be configured at run time: |
2058 | instance name (@pxref{instances}). Usually, it is @samp{pies}. | 2058 | |
2059 | @deffn {Config} state-directory @var{dir} | ||
2060 | Set the program state directory. | ||
2061 | @end deffn | ||
2062 | |||
2063 | The table below describes the files kept in the state directory. The | ||
2064 | @var{instance} in this table stands for the @command{pies} instance | ||
2065 | name (@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. |
2079 | Use them only if the defaults does not suit your needs, and the | 2086 | Use them only if the defaults do not suit your needs, and niether |
2080 | @option{--instance} option does not help: | 2087 | the @code{state-directory} statement nor the @option{--instance} |
2088 | can help: | ||
2081 | 2089 | ||
2082 | @deffn {Config} pidfile @var{file} | 2090 | @deffn {Config} pidfile @var{file} |
2083 | Sets the PID file name. | 2091 | Sets 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 @@ | |||
1 | inetd.sh | 1 | inetd |
2 | meta1gram.c | 2 | meta1gram.c |
3 | meta1gram.h | 3 | meta1gram.h |
4 | meta1gram.output | 4 | meta1gram.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 | ||
60 | pkgstatedir=$(localstatedir)/pies | ||
61 | |||
60 | AM_CPPFLAGS=\ | 62 | AM_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 | ||
65 | AM_YFLAGS=-dvt -pmeta1 | 68 | AM_YFLAGS=-dvt -pmeta1 |
66 | AM_LFLAGS=-dvp -Pmeta1 -olex.yy.c | 69 | AM_LFLAGS=-dvp -Pmeta1 -olex.yy.c |
67 | 70 | ||
68 | SUFFIXES = .in .sh | ||
69 | EXTRA_SCRIPTS = inetd.in | 71 | EXTRA_SCRIPTS = inetd.in |
70 | sbin_SCRIPTS = @INETD_SH@ | 72 | sbin_SCRIPTS = @INETD@ |
71 | inetd.sh: inetd.in | ||
72 | 73 | ||
73 | .in.sh: | 74 | inetd: 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 | ||
76 | install-exec-hook: | 78 | install-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 | ||
@@ -27,6 +27,7 @@ char *log_tag; | |||
27 | struct pies_privs pies_privs; | 27 | struct pies_privs pies_privs; |
28 | int foreground; | 28 | int foreground; |
29 | int command; | 29 | int command; |
30 | char *statedir = DEFAULT_STATE_DIR; | ||
30 | char *instance; | 31 | char *instance; |
31 | char *pidfile; | 32 | char *pidfile; |
32 | char *ctlfile; | 33 | char *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 | ||
2173 | void | 2178 | static void |
2174 | set_file_names (const char *base) | 2179 | set_conf_file_names (const char *base) |
2175 | { | 2180 | { |
2176 | const char *p; | ||
2177 | |||
2178 | p = strrchr (base, '/'); | ||
2179 | if (p) | ||
2180 | base = p + 1; | ||