summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@gnu.org.ua>2009-12-11 19:01:35 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2009-12-11 19:01:35 (GMT)
commit94c29f6b6180dca91ae4034ffcb50c6a5c171b75 (patch) (side-by-side diff)
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.
Diffstat (more/less context) (ignore whitespace changes)
-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 @@
-GNU Pies NEWS -- history of user-visible changes. 2009-10-26
+GNU Pies NEWS -- history of user-visible changes. 2009-12-11
Copyright (C) 2009 Sergey Poznyakoff
See the end of file for copying conditions.
-Please send Pies bug reports to <bug-pies@gnu.org.ua>
+Please send Pies bug reports to <bug-pies@gnu.org> or
+<bug-pies@gnu.org.ua>
-Version 1.1.90 (Git)
+Version 1.2, 2009-12-11
-Pies dubbed a GNU package.
+* First release as a GNU package.
+
+* Full inetd support
+
+The program supports all types of services (including built-in
+ones) and all types of protocols offered by the traditional `inetd'
+utility.
+
+The `inetd.conf' configuration file format is supported. The
+`inetd' configuration file may be supplied either from the command
+line (see below), or via the `include-inetd' configuration statement.
+
+* Inetd replacement
+
+A replacement script for inetd(8) is provided. It is fully
+compatible with the traditional inetd command line, but offers
+the flexibility and new features of pies.
+
+* Configuration file handling
+
+Several configuration files, eventually of different types,
+can be specified in the command line. New command line
+option `--syntax' declares the syntax of configuration
+files that follow it, e.g.:
+
+pies --config-file /etc/pies.conf \
+ --syntax=inetd --config-file /etc/inetd.conf \
+ --syntax=meta1 --config-file /etc/meta1/meta1.conf
+
+* New keywords.
+
+Component keywords: flags, service, socket-type,
+max-instances, max-rate, qotd-file.
+Global keywords: state-directory, include-inetd.
+
+* New option --instance
+
+The `--instance' option allows you to run several instances
+of pies, each of them using separate configuration and
+state files.
+
+* New option --rate
+
+For compatibility with inetd.
+
+* Improved status output.
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 @@
# along with GNU Pies. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ([2.63])
-AC_INIT([GNU Pies], [1.1.90], [bug-pies@gnu.org.ua])
+AC_INIT([GNU Pies], [1.2], [bug-pies@gnu.org.ua])
AC_CONFIG_SRCDIR([src/pies.h])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
@@ -71,7 +71,7 @@ AC_ARG_ENABLE([inetd],
AC_HELP_STRING([--enable-inetd],
[build and install a replacement for SBINDIR/inetd]),
[case $enableval in
- yes) AC_SUBST([INETD_SH], [inetd.sh]);;
+ yes) AC_SUBST([INETD], [inetd]);;
no) ;;
esac])
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.:
@smallexample
@group
-pies /etc/pies.conf \
- --syntax=inetd --config-file /etc/inetd.conf \
- --syntax=meta1 --config-file /etc/meta1/meta1.conf
+pies --config-file /etc/pies.conf \
+ --syntax=inetd --config-file /etc/inetd.conf \
+ --syntax=meta1 --config-file /etc/meta1/meta1.conf
@end group
@end smallexample
@@ -2051,11 +2051,18 @@ start @command{jabberd} components:
@node State Files
@section State Files
@cindex state files
- Pies uses several files to keep its state information. These files
-are kept in local state directory (usually @file{/var/run/pies}, or
-@file{/usr/local/var/run/pies}). The table below describes these
-files. The @var{instance} in this table stands for the @command{pies}
-instance name (@pxref{instances}). Usually, it is @samp{pies}.
+ Pies uses several files to keep its state information. The
+directory which hosts these files is called @dfn{state directory}, it
+is usually @file{/var/pies} or @file{/usr/local/var/pies}). The state
+directory can be configured at run time:
+
+@deffn {Config} state-directory @var{dir}
+Set the program state directory.
+@end deffn
+
+The table below describes the files kept in the state directory. The
+@var{instance} in this table stands for the @command{pies} instance
+name (@pxref{instances}). Usually, it is @samp{pies}.
@table @asis
@item @file{@var{instance}.pid}
@@ -2076,8 +2083,9 @@ built-in service (@pxref{qotd}).
@end table
The following statements allow to redefine state file names.
-Use them only if the defaults does not suit your needs, and the
-@option{--instance} option does not help:
+Use them only if the defaults do not suit your needs, and niether
+the @code{state-directory} statement nor the @option{--instance}
+can help:
@deffn {Config} pidfile @var{file}
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 @@
-inetd.sh
+inetd
meta1gram.c
meta1gram.h
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 = \
../gnu/libgnu.a\
$(MF_PROCTITLE_LIBS)
+pkgstatedir=$(localstatedir)/pies
+
AM_CPPFLAGS=\
-DDEFAULT_PREPROCESSOR="$(DEFAULT_PREPROCESSOR)"\
-DDEFAULT_VERSION_INCLUDE_DIR=\"$(incdir)\"\
- -DDEFAULT_INCLUDE_DIR=\"$(pkgdatadir)/include\"
+ -DDEFAULT_INCLUDE_DIR=\"$(pkgdatadir)/include\"\
+ -DDEFAULT_STATE_DIR=\"$(pkgstatedir)\"
AM_YFLAGS=-dvt -pmeta1
AM_LFLAGS=-dvp -Pmeta1 -olex.yy.c
-SUFFIXES = .in .sh
EXTRA_SCRIPTS = inetd.in
-sbin_SCRIPTS = @INETD_SH@
-inetd.sh: inetd.in
+sbin_SCRIPTS = @INETD@
-.in.sh:
- $(AM_V_GEN)sed 's|_SBINDIR_|$(sbindir)|' $< > $@
+inetd: inetd.in
+ $(AM_V_GEN)sed 's|_SBINDIR_|$(sbindir)|' \
+ $(top_srcdir)/src/inetd.in > $(top_builddir)/src/inetd
-install-exec-hook:
- if test -n "@INETD_SH@" && \
- test -f $(DESTDIR)$(sbindir)/@INETD_SH@; then \
- test -f $(DESTDIR)$(sbindir)/inetd$(EXEEXT) && \
- cd $(DESTDIR)$(sbindir) && \
- mv -f inetd$(EXEEXT) inetd$(EXEEXT)~; \
- cd $(DESTDIR)$(sbindir) && \
- mv @INETD_SH@ inetd$(EXEEXT); \
- fi
+install-data-hook:
+ test -d $(DESTDIR)$(pkgstatedir) || $(MKDIR_P) $(pkgstatedir)
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;
struct pies_privs pies_privs;
int foreground;
int command;
+char *statedir = DEFAULT_STATE_DIR;
char *instance;
char *pidfile;
char *ctlfile;
@@ -1421,6 +1422,10 @@ struct grecs_keyword pies_keywords[] = {
NULL,
N_("Show source info with debugging messages."),
grecs_type_bool, &source_info_option, 0, NULL},
+ {"state-directory",
+ NULL,
+ N_("Full file name of the program state directory."),
+ grecs_type_string, &statedir, 0, NULL},
{"pidfile",
NULL,
N_("Write PID to this file."),
@@ -2170,28 +2175,28 @@ mkfilename (const char *dir, const char *name, const char *suf)
return s;
}
-void
-set_file_names (const char *base)
+static void
+set_conf_file_names (const char *base)
{
- const char *p;
-
- p = strrchr (base, '/');
- if (p)
- base = p + 1;
if (!conf_head)
{
char *name = mkfilename (SYSCONFDIR, base, ".conf");
add_config (current_syntax, name);
free (name);
}
+}
+
+static void
+set_state_file_names (const char *base)
+{
if (!pidfile)
- pidfile = mkfilename (LOCALSTATEDIR, base, ".pid");
+ pidfile = mkfilename (statedir, base, ".pid");
if (!ctlfile)
- ctlfile = mkfilename (LOCALSTATEDIR, base, ".ctl");
+ ctlfile = mkfilename (statedir, base, ".ctl");
if (!statfile)
- statfile = mkfilename (LOCALSTATEDIR, base, ".stat");
+ statfile = mkfilename (statedir, base, ".stat");
if (!qotdfile)
- qotdfile = mkfilename (LOCALSTATEDIR, base, ".qotd");
+ qotdfile = mkfilename (statedir, base, ".qotd");
}
int
@@ -2229,10 +2234,10 @@ main (int argc, char **argv)
else
instance++;
}
- else
- log_tag = instance;
- set_file_names (instance);
+ log_tag = instance;
+
+ set_conf_file_names (instance);
if (!DEFAULT_PREPROCESSOR)
grecs_preprocessor = NULL;
@@ -2274,6 +2279,7 @@ main (int argc, char **argv)
}
}
+ set_state_file_names (instance);
set_mailer_argcv ();
if (lint_mode)

Return to:

Send suggestions and report system problems to the System administrator.