Skip to contentSkip to conversation

package/exim: fix log and pid file paths

PATCH New Pascal de Bruijn 3 participants 3 messages Mar 2, 2020 – May 6, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/exim: fix log and pid file paths

both the logs and pid should not be placed in /var/spool

we place the log in /var/log/exim and
we place the pid in /var/run/exim

using binary name subdirectory in both cases allows for the use of systemd's LogsDirectory and RuntimeDirectory statements

package/exim/S86exim +9 -1
index bec88fc222..0d09361f65 100644
@@ -3,11 +3,19 @@
 # Start/stop exim
 #
 
-PIDFILE=/var/lock/exim/exim-daemon.pid
+PIDFILE=/var/run/exim/exim.pid
 
 case "$1" in
   start)
 	echo "Starting exim..."
+	if [ ! -d /var/log/exim ]; then
+	  mkdir -p /var/log/exim
+	  chown exim:mail /var/log/exim
+	fi
+	if [ ! -d /var/run/exim ]; then
+	  mkdir -p /var/run/exim
+	  chown root:mail /var/run/exim
+	fi
 	start-stop-daemon -S -x exim -- -bd
 	;;
   stop)
package/exim/exim.mk +2 -0
index e4b0bfc1b4..0e74bdd8e0 100644
@@ -39,6 +39,8 @@ define EXIM_USE_DEFAULT_CONFIG_FILE
 	$(INSTALL) -m 0644 $(@D)/src/EDITME $(@D)/Local/Makefile
 	$(call exim-config-change,BIN_DIRECTORY,/usr/sbin)
 	$(call exim-config-change,CONFIGURE_FILE,/etc/exim/configure)
+	$(call exim-config-change,LOG_FILE_PATH,/var/log/exim/exim_%slog)
+	$(call exim-config-change,PID_FILE_PATH,/var/run/exim/exim.pid)
 	$(call exim-config-change,EXIM_USER,ref:exim)
 	$(call exim-config-change,EXIM_GROUP,mail)
 	$(call exim-config-change,TRANSPORT_LMTP,yes)
package/exim/exim.service +4 -0
index fe97727ab5..ac3f067de4 100644
@@ -3,6 +3,10 @@ Description=Exim MTA
 After=syslog.target network.target
 
 [Service]
+User=exim
+Group=mail
+LogsDirectory=exim
+RuntimeDirectory=exim
 ExecStart=/usr/sbin/exim -bdf
 Restart=always
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 package/exim: fix log and pid file paths

Quoted 9 lines · On Mon, 2 Mar 2020 11:19:02 +0100 Pascal de Bruijn <[email protected]>…

both the logs and pid should not be placed in /var/spool

we place the log in /var/log/exim and
we place the pid in /var/run/exim

using binary name subdirectory in both cases allows for the use of systemd's LogsDirectory and RuntimeDirectory statements

Applied with an improved commit log. It would however be nice to convert the exim init script to the "new" init script template, for higher consistency.

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw

PATCH 1/1 package/exim: fix log and pid file paths

Quoted 10 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Quoted 5 lines · On Mon, 2 Mar 2020 11:19:02 +0100 Pascal de Bruijn <[email protected]>…

both the logs and pid should not be placed in /var/spool

we place the log in /var/log/exim and
we place the pid in /var/run/exim

Quoted 8 lines
Quoted 4 lines

using binary name subdirectory in both cases allows for the use of systemd's LogsDirectory and RuntimeDirectory statements

Applied with an improved commit log. It would however be nice to convert the exim init script to the "new" init script template, for higher consistency.

Committed to 2020.02.x, thanks.

Signature · 1 line
Bye, Peter Korsgaard