File: debian-systemd-start.patch

package info (click to toggle)
postfix 3.10.4-1~deb13u1
  • links: PTS, VCS
  • area: main
  • in suites: trixie-proposed-updates
  • size: 28,028 kB
  • sloc: ansic: 134,613; makefile: 17,991; sh: 6,971; perl: 2,795; python: 1,448; awk: 158
file content (32 lines) | stat: -rw-r--r-- 1,175 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From: Michael Tokarev <mjt@tls.msk.ru>
Date: Tue, 24 Dec 2024 12:21:10 +0300
Subject: add "debian-systemd-start" subcommand to postfix-script
Forwarded: not-needed

In order to have stricter privileges at runtime, there's a need
to split postfix startup procedure to "setup" stage and "runtime"
stage, because "setup" stage requires more privileges (for example,
it does `create-missing`, which needs chown).  In Debian, for
systemd startup, we run `postfix check` in ExecStartPre with full
privs, and `postfix debian-systemd-start` in regular ExecStart,
with restricted privileges.

diff --git a/conf/postfix-script b/conf/postfix-script
--- a/conf/postfix-script
+++ b/conf/postfix-script
@@ -127,4 +127,15 @@ stop_msg)
 	;;
 
+debian-systemd-start) # debian-specific
+	# Second part of the startup.  First part is done in ExecStartPre.
+	rm -f $queue_directory/quick-start
+	rm -f $queue_directory/debian-systemd-start #XXX read MAIL_DEBUG & MAIL_VERBOSE
+	[ -d /run/systemd/system ] && [ -n "$INVOCATION_ID" ] || {
+		$FATAL "the Postfix mail system is started through systemd but not under systemd?"
+		exit 1
+	}
+	$daemon_directory/master -w
+	;;
+
 start|start-fg)