Added systemd support

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2018-07-14 12:57:08 +00:00
parent f72a87ca60
commit 70c2580fdc
6 changed files with 91 additions and 2 deletions

3
configure vendored
View File

@ -4848,7 +4848,7 @@ CFLAGS="$static -O2 -Wall -g"
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 smtp.o session.o bdat.o message.o attachment.o digest.o store.o archive.o tai.o import.o import_maildir.o import_mailbox.o import_pop3.o import_imap.o imap.o pop3.o extract.o mydomains.o $objs"
ac_config_files="$ac_config_files Makefile src/Makefile etc/Makefile util/Makefile init.d/Makefile unit_tests/Makefile webui/Makefile contrib/imap/Makefile"
ac_config_files="$ac_config_files Makefile src/Makefile etc/Makefile util/Makefile init.d/Makefile systemd/Makefile unit_tests/Makefile webui/Makefile contrib/imap/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@ -5546,6 +5546,7 @@ do
"etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;;
"util/Makefile") CONFIG_FILES="$CONFIG_FILES util/Makefile" ;;
"init.d/Makefile") CONFIG_FILES="$CONFIG_FILES init.d/Makefile" ;;
"systemd/Makefile") CONFIG_FILES="$CONFIG_FILES systemd/Makefile" ;;
"unit_tests/Makefile") CONFIG_FILES="$CONFIG_FILES unit_tests/Makefile" ;;
"webui/Makefile") CONFIG_FILES="$CONFIG_FILES webui/Makefile" ;;
"contrib/imap/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/imap/Makefile" ;;

View File

@ -534,7 +534,7 @@ CFLAGS="$static -O2 -Wall -g"
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 smtp.o session.o bdat.o message.o attachment.o digest.o store.o archive.o tai.o import.o import_maildir.o import_mailbox.o import_pop3.o import_imap.o imap.o pop3.o extract.o mydomains.o $objs"
AC_CONFIG_FILES([Makefile src/Makefile etc/Makefile util/Makefile init.d/Makefile unit_tests/Makefile webui/Makefile contrib/imap/Makefile])
AC_CONFIG_FILES([Makefile src/Makefile etc/Makefile util/Makefile init.d/Makefile systemd/Makefile unit_tests/Makefile webui/Makefile contrib/imap/Makefile])
AC_OUTPUT
echo

39
systemd/Makefile.in Normal file
View File

@ -0,0 +1,39 @@
SHELL = @SHELL@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
includedir = @includedir@
libdir = @libdir@
libexecdir = @libexecdir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
mandir = @mandir@
datarootdir = @datarootdir@
localstatedir = @localstatedir@
CC = @CC@
CFLAGS = @CFLAGS@ @CPPFLAGS@
DEFS = @defs@
INCDIR = -I. -I../.. -I../../src @INCDIR@ @sql_includes@
LIBDIR = -L. @LIBDIR@ @LDFLAGS@ -L../../src
LIBS = @LIBS@ @sql_libs@
RUNNING_USER = @RUNNING_USER@
RUNNING_GROUP = `@id_bin@ -gn $(RUNNING_USER)`
INSTALL = @INSTALL@
all:
echo all
install:
$(INSTALL) -m 0644 $(srcdir)/piler.service $(DESTDIR)$(libexecdir)/piler/piler.service
$(INSTALL) -m 0644 $(srcdir)/piler-smtp.service $(DESTDIR)$(libexecdir)/piler/piler-smtp.service
$(INSTALL) -m 0644 $(srcdir)/pilersearch.service $(DESTDIR)$(libexecdir)/piler/pilersearch.service
clean:
echo clean
distclean: clean
rm -f Makefile

View File

@ -0,0 +1,15 @@
[Unit]
Description=Piler SMTP server
After=network.target auditd.service
[Service]
ExecStart=/usr/sbin/piler-smtp -d
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=forking
User=root
[Install]
WantedBy=multi-user.target
Alias=piler-smtp.service

16
systemd/piler.service Normal file
View File

@ -0,0 +1,16 @@
[Unit]
Description=Piler daemon
After=network.target mariadb.service
[Service]
ExecStart=/usr/sbin/piler -d
PIDFile=/var/run/piler/piler.pid
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=forking
User=root
[Install]
WantedBy=multi-user.target
Alias=piler.service

View File

@ -0,0 +1,18 @@
[Unit]
Description=Searchd for piler daemon
After=network.target mariadb.service
[Service]
ExecStart=/usr/bin/searchd --config /etc/piler/sphinx.conf
ExecStartPre=/bin/bash -c "if [[ ! -d /var/run/piler ]]; then mkdir -p /var/run/piler; chown piler:piler /var/run/piler; fi"
PIDFile=/var/run/piler/searchd.pid
KillMode=process
Restart=on-failure
RestartPreventExitStatus=255
Type=forking
User=piler
[Install]
WantedBy=multi-user.target
Alias=pilersearch.service