diff --git a/configure b/configure index e6203a1..acb0bed 100755 --- a/configure +++ b/configure @@ -3485,7 +3485,7 @@ echo "\"Configure command: ./configure $PARAMS\"" >> $CONFIGURE_PARAMS_FILE -SUBDIRS="src etc util init.d test" +SUBDIRS="src etc util init.d test contrib/reload" @@ -4830,7 +4830,7 @@ LIBS="$antispam_libs $sunos_libs " OBJS="dirs.o base64.o misc.o counters.o cfg.o sig.o decoder.o hash.o parser.o parser_utils.o rules.o session.o message.o attachment.o digest.o store.o archive.o tai.o import.o imap.o pop3.o extract.o mydomains.o retr.o $objs" -ac_config_files="$ac_config_files Makefile src/Makefile etc/Makefile util/Makefile init.d/Makefile test/Makefile contrib/imap/Makefile" +ac_config_files="$ac_config_files Makefile src/Makefile etc/Makefile util/Makefile init.d/Makefile test/Makefile contrib/imap/Makefile contrib/reload/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -5530,6 +5530,7 @@ "init.d/Makefile") CONFIG_FILES="$CONFIG_FILES init.d/Makefile" ;; "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; "contrib/imap/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/imap/Makefile" ;; + "contrib/reload/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/reload/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/configure.in b/configure.in index 81c5363..5c4b239 100644 --- a/configure.in +++ b/configure.in @@ -85,7 +85,7 @@ echo "\"Configure command: ./configure $PARAMS\"" >> $CONFIGURE_PARAMS_FILE -SUBDIRS="src etc util init.d test" +SUBDIRS="src etc util init.d test contrib/reload" dnl static build @@ -524,7 +524,7 @@ LIBS="$antispam_libs $sunos_libs " OBJS="dirs.o base64.o misc.o counters.o cfg.o sig.o decoder.o hash.o parser.o parser_utils.o rules.o session.o message.o attachment.o digest.o store.o archive.o tai.o import.o imap.o pop3.o extract.o mydomains.o retr.o $objs" -AC_CONFIG_FILES([Makefile src/Makefile etc/Makefile util/Makefile init.d/Makefile test/Makefile contrib/imap/Makefile]) +AC_CONFIG_FILES([Makefile src/Makefile etc/Makefile util/Makefile init.d/Makefile test/Makefile contrib/imap/Makefile contrib/reload/Makefile]) AC_OUTPUT diff --git a/contrib/reload/pilerreload.c b/contrib/reload/pilerreload.c index c5aa7bc..c3cbc29 100644 --- a/contrib/reload/pilerreload.c +++ b/contrib/reload/pilerreload.c @@ -25,7 +25,7 @@ void fatal(char *s){ - printf("pilerctl: fatal: %s\n", s); + syslog(LOG_PRIORITY, "fatal: %s", s); exit(1); } @@ -35,6 +35,8 @@ int pid; FILE *f; + (void) openlog("pilerreload", LOG_PID, LOG_MAIL); + cfg = read_config(CONFIG_FILE); f = fopen(cfg.pidfile, "r"); @@ -46,7 +48,11 @@ pid = atoi(buf); - if(pid > 1) kill(pid, SIGHUP); + if(pid > 1){ + if(kill(pid, SIGHUP) == 0) syslog(LOG_PRIORITY, "reloaded"); + else syslog(LOG_PRIORITY, "failed to reload"); + } + else fatal("invalid pid"); return 0; } diff --git a/util/Makefile.in b/util/Makefile.in index c23d490..3dd8a26 100644 --- a/util/Makefile.in +++ b/util/Makefile.in @@ -35,10 +35,11 @@ $(INSTALL) -m 0755 $(srcdir)/indexer.delta.sh $(DESTDIR)$(libexecdir)/piler $(INSTALL) -m 0755 $(srcdir)/indexer.main.sh $(DESTDIR)$(libexecdir)/piler $(INSTALL) -m 0755 $(srcdir)/import.sh $(DESTDIR)$(libexecdir)/piler + $(INSTALL) -m 0755 $(srcdir)/purge.sh $(DESTDIR)$(libexecdir)/piler $(INSTALL) -m 0755 $(srcdir)/postinstall.sh $(DESTDIR)$(libexecdir)/piler clean: - + rm -f postinstall.sh distclean: clean rm -f Makefile