|
|
f52b70 |
diff -up dovecot-2.3.15/dovecot-init.service.initbysystemd dovecot-2.3.15/dovecot-init.service
|
|
|
f52b70 |
--- dovecot-2.3.15/dovecot-init.service.initbysystemd 2021-06-21 20:21:49.250680889 +0200
|
|
|
f52b70 |
+++ dovecot-2.3.15/dovecot-init.service 2021-06-21 20:21:49.250680889 +0200
|
|
|
c83283 |
@@ -0,0 +1,13 @@
|
|
|
70765b |
+[Unit]
|
|
|
70765b |
+Description=One-time Dovecot init service
|
|
|
70765b |
+ConditionPathExists=|!/etc/pki/dovecot/certs/dovecot.pem
|
|
|
70765b |
+
|
|
|
70765b |
+[Service]
|
|
|
70765b |
+Type=oneshot
|
|
|
70765b |
+RemainAfterExit=no
|
|
|
70765b |
+ExecStart=/bin/sh -c '\
|
|
|
70765b |
+if [ ! -f /etc/pki/dovecot/certs/dovecot.pem ]; \
|
|
|
70765b |
+then\
|
|
|
70765b |
+ SSLDIR=/etc/pki/dovecot/ OPENSSLCONFIG=/etc/pki/dovecot/dovecot-openssl.cnf /usr/libexec/dovecot/mkcert.sh /dev/null 2>&1;\
|
|
|
70765b |
+fi'
|
|
|
70765b |
+
|
|
|
f52b70 |
diff -up dovecot-2.3.15/dovecot.service.in.initbysystemd dovecot-2.3.15/dovecot.service.in
|
|
|
f52b70 |
--- dovecot-2.3.15/dovecot.service.in.initbysystemd 2021-06-21 20:21:49.250680889 +0200
|
|
|
f52b70 |
+++ dovecot-2.3.15/dovecot.service.in 2021-06-21 20:22:46.935981920 +0200
|
|
|
f52b70 |
@@ -11,7 +11,8 @@
|
|
|
70765b |
Description=Dovecot IMAP/POP3 email server
|
|
|
70765b |
Documentation=man:dovecot(1)
|
|
|
f52b70 |
Documentation=https://doc.dovecot.org/
|
|
|
70765b |
-After=local-fs.target network-online.target
|
|
|
70765b |
+After=local-fs.target network-online.target dovecot-init.service
|
|
|
70765b |
+Requires=dovecot-init.service
|
|
|
70765b |
|
|
|
70765b |
[Service]
|
|
|
f52b70 |
Type=@systemdservicetype@
|
|
|
f52b70 |
diff -up dovecot-2.3.15/Makefile.am.initbysystemd dovecot-2.3.15/Makefile.am
|
|
|
f52b70 |
--- dovecot-2.3.15/Makefile.am.initbysystemd 2021-06-21 20:21:49.250680889 +0200
|
|
|
f52b70 |
+++ dovecot-2.3.15/Makefile.am 2021-06-21 20:24:26.676765849 +0200
|
|
|
f52b70 |
@@ -21,6 +21,7 @@ EXTRA_DIST = \
|
|
|
f52b70 |
run-test-valgrind.supp \
|
|
|
f52b70 |
dovecot.service.in \
|
|
|
f52b70 |
dovecot.socket \
|
|
|
f52b70 |
+ dovecot-init.service \
|
|
|
f52b70 |
$(conf_DATA)
|
|
|
70765b |
|
|
|
f52b70 |
noinst_DATA = dovecot-config
|
|
|
f52b70 |
@@ -69,7 +70,8 @@ dovecot-config: dovecot-config.in Makefi
|
|
|
f52b70 |
if WANT_SYSTEMD
|
|
|
70765b |
systemdsystemunit_DATA = \
|
|
|
70765b |
dovecot.socket \
|
|
|
70765b |
- dovecot.service
|
|
|
70765b |
+ dovecot.service \
|
|
|
70765b |
+ dovecot-init.service
|
|
|
70765b |
endif
|
|
|
70765b |
|
|
|
70765b |
install-exec-hook:
|