From 677936675eb2bc49cfff5de1a39ec2fd187c4236 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Mon, 26 Apr 2021 08:29:02 +0300 Subject: [PATCH] dovecot.service: Set type to notify only when compiling with systemd --- Makefile.am | 1 + configure.ac | 4 ++++ dovecot.service.in | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 88a40ffbe3..34f58c79a8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -64,6 +64,7 @@ if HAVE_LIBSYSTEMD $(AM_V_GEN)sed -e 's,@sbindir\@,$(sbindir),g' \ -e 's,@bindir\@,$(bindir),g' \ -e 's,@rundir\@,$(rundir),g' \ + -e 's,@systemdservicetype\@,$(systemdservicetype),g' \ $< > $@ systemdsystemunit_DATA = \ diff --git a/configure.ac b/configure.ac index f34db514b4..19242beb60 100644 --- a/configure.ac +++ b/configure.ac @@ -244,10 +244,13 @@ AC_ARG_WITH([systemd], want_systemd="$withval" ) +systemdservicetype='simple' + AS_IF([test "$want_systemd" != "no"], [ PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [ AC_DEFINE([HAVE_LIBSYSTEMD],[1], [Define to 1 if you have libsystemd]) systemdsystemunitdir=`$PKG_CONFIG --variable=systemdsystemunitdir systemd` + systemdservicetype='notify' ], [AS_IF([test "$want_systemd" = "yes"], [ AC_MSG_ERROR([libsystemd not found]) ], @@ -256,6 +259,7 @@ AS_IF([test "$want_systemd" != "no"], [ ]) AC_SUBST(systemdsystemunitdir) +AC_SUBST(systemdservicetype) AM_CONDITIONAL(HAVE_LIBSYSTEMD, [test "$want_systemd" != "no"]) dovecot_moduledir="$libdir/dovecot" diff --git a/dovecot.service.in b/dovecot.service.in index 6aae19439a..3455cceaae 100644 --- a/dovecot.service.in +++ b/dovecot.service.in @@ -14,7 +14,7 @@ Documentation=https://doc.dovecot.org/ After=local-fs.target network-online.target [Service] -Type=notify +Type=@systemdservicetype@ ExecStart=@sbindir@/dovecot -F ExecReload=@bindir@/doveadm reload ExecStop=@bindir@/doveadm stop -- 2.47.3