diff mbox series

[v2] package/{bandwithd, dhcpcd, htpdate, minidlna, nginx, nss-pam-ldapd, openvmtools}: use PIDFile=/run in systemd services

Message ID 20200915215645.2010-1-buildroot@heine.tech
State Superseded
Headers show
Series [v2] package/{bandwithd, dhcpcd, htpdate, minidlna, nginx, nss-pam-ldapd, openvmtools}: use PIDFile=/run in systemd services | expand

Commit Message

Michael Nosthoff Sept. 15, 2020, 9:56 p.m. UTC
Fixes:

systemd[1]: /usr/lib/systemd/system/nginx.service:7: PIDFile= references
a path below legacy directory /var/run/, updating /var/run/nginx.pid →
/run/nginx.pid; please update the unit file accordingly.

Details:
 - https://github.com/systemd/systemd/pull/10712

Signed-off-by: Michael Nosthoff <buildroot@heine.tech>
---
 package/bandwidthd/bandwidthd.service | 2 +-
 package/dhcpcd/dhcpcd.service         | 2 +-
 package/htpdate/htpdate.service       | 2 +-
 package/minidlna/minidlnad.service    | 2 +-
 package/nginx/nginx.service           | 2 +-
 package/nss-pam-ldapd/nslcd.service   | 2 +-
 package/openvmtools/vmtoolsd.service  | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)

Comments

Thomas Petazzoni Sept. 16, 2020, 6:45 a.m. UTC | #1
Hello,

On Tue, 15 Sep 2020 23:56:45 +0200
Michael Nosthoff via buildroot <buildroot@busybox.net> wrote:

> Fixes:
> 
> systemd[1]: /usr/lib/systemd/system/nginx.service:7: PIDFile= references
> a path below legacy directory /var/run/, updating /var/run/nginx.pid →
> /run/nginx.pid; please update the unit file accordingly.
> 
> Details:
>  - https://github.com/systemd/systemd/pull/10712
> 
> Signed-off-by: Michael Nosthoff <buildroot@heine.tech>

I think we would normally prefer one patch for each. For example, for
htpdate, we also need to fix the PIDFile path so that it has a .pid
extension.

Also, is there something that needs to be done with Postgresql:

package/postgresql/postgresql.service:PIDFile=/var/lib/pgsql/postmaster.pid

is it expected to have the PIDFile in /var/lib ?

Thomas
Michael Nosthoff Sept. 16, 2020, 9:29 a.m. UTC | #2
Hi,

On 16.09.2020 08:45, Thomas Petazzoni wrote:
> Hello,
> 

> I think we would normally prefer one patch for each. For example, for
> htpdate, we also need to fix the PIDFile path so that it has a .pid
> extension.

okay, i'll split that up.
> 
> Also, is there something that needs to be done with Postgresql:
> 
> package/postgresql/postgresql.service:PIDFile=/var/lib/pgsql/postmaster.pid
> 
> is it expected to have the PIDFile in /var/lib ?

I'm not sure where the initial .service file came from. The postgres
manual doesn't use PIDFile as it has a Type=notify configuration [0].
Debian uses a forking config for it's clustered setup [1], maybe it was
derived from there.

The unit was changed to notify in [2] and I think this commit should
have also removed the PIDFile.

(for the initial topic this isn't an issue because /var/lib is still a
valid folder, but while we're at it...)


[0] https://www.postgresql.org/docs/12/server-start.html
[1]
https://salsa.debian.org/postgresql/postgresql-common/-/blob/master/systemd/postgresql@.service
[2]
https://git.busybox.net/buildroot/commit/package/postgresql/postgresql.service?id=eada187e77022f0da30884a826dc1767ba99abe8

Regards,
Michael
Michael Nosthoff Sept. 16, 2020, 3:33 p.m. UTC | #3
Only systemd .services of Type=notify need a PIDFile entry. [0]
This pidfile should be located in /run. [0]
/var/run is deprecated and systemd warns about it on every bootup. [1]
This series fixes all affected packages.

Details:
 [0] https://www.freedesktop.org/software/systemd/man/systemd.service.html#PIDFile=
 [1] https://github.com/systemd/systemd/pull/10712
  

Michael Nosthoff (8):
  package/nginx: use /run for PIDFile
  package/bandwithd: use /run for PIDFile
  package/dhcpcd: use /run for PIDFile
  package/htpdate: use /run for PIDFile
  package/minidlna: use /run for PIDFile
  package/nss-pam-ldapd: use /run for PIDFile
  package/openvmtools: use /run for PIDFile
  package/postgresql: remove PIDFile from .service

 package/bandwidthd/bandwidthd.service | 2 +-
 package/dhcpcd/dhcpcd.service         | 2 +-
 package/htpdate/htpdate.service       | 4 ++--
 package/minidlna/minidlnad.service    | 2 +-
 package/nginx/nginx.service           | 2 +-
 package/nss-pam-ldapd/nslcd.service   | 2 +-
 package/openvmtools/vmtoolsd.service  | 4 ++--
 package/postgresql/postgresql.service | 1 -
 8 files changed, 9 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/package/bandwidthd/bandwidthd.service b/package/bandwidthd/bandwidthd.service
index 9c03d42946..ab7f05a2e8 100644
--- a/package/bandwidthd/bandwidthd.service
+++ b/package/bandwidthd/bandwidthd.service
@@ -5,7 +5,7 @@  After=network.target
 [Service]
 Type=forking
 ExecStart=/usr/bin/bandwidthd
-PIDFile=/var/run/bandwidthd.pid
+PIDFile=/run/bandwidthd.pid
 
 [Install]
 WantedBy=multi-user.target
diff --git a/package/dhcpcd/dhcpcd.service b/package/dhcpcd/dhcpcd.service
index 0552b5c73a..e648092c9b 100644
--- a/package/dhcpcd/dhcpcd.service
+++ b/package/dhcpcd/dhcpcd.service
@@ -5,7 +5,7 @@  After=network.target
 [Service]
 Type=forking
 EnvironmentFile=-/etc/default/dhcpcd
-PIDFile=/var/run/dhcpcd.pid
+PIDFile=/run/dhcpcd.pid
 ExecStart=/sbin/dhcpcd $DAEMON_ARGS
 Restart=always
 
diff --git a/package/htpdate/htpdate.service b/package/htpdate/htpdate.service
index 0c77550813..aedb73eb93 100644
--- a/package/htpdate/htpdate.service
+++ b/package/htpdate/htpdate.service
@@ -4,7 +4,7 @@  After=network.target
 
 [Service]
 Type=forking
-PIDFile=/var/run/htpdate
+PIDFile=/run/htpdate
 Environment=HTPDATE_ARGS="-a -s -t https://www.google.com"
 EnvironmentFile=-/etc/default/htpdate
 ExecStart=/usr/bin/htpdate -D -i /var/run/htpdate $HTPDATE_ARGS
diff --git a/package/minidlna/minidlnad.service b/package/minidlna/minidlnad.service
index f69476b303..4e968d3858 100644
--- a/package/minidlna/minidlnad.service
+++ b/package/minidlna/minidlnad.service
@@ -5,7 +5,7 @@  After=network.target
 [Service]
 Type=forking
 ExecStart=/usr/sbin/minidlnad
-PIDFile=/var/run/minidlna/minidlna.pid
+PIDFile=/run/minidlna/minidlna.pid
 
 [Install]
 WantedBy=multi-user.target
diff --git a/package/nginx/nginx.service b/package/nginx/nginx.service
index 320df9a80e..9fd215fd3e 100644
--- a/package/nginx/nginx.service
+++ b/package/nginx/nginx.service
@@ -4,7 +4,7 @@  After=syslog.target network.target
 
 [Service]
 Type=forking
-PIDFile=/var/run/nginx.pid
+PIDFile=/run/nginx.pid
 ExecStartPre=/usr/bin/mkdir -p /var/log/nginx /var/tmp/nginx
 ExecStartPre=/usr/sbin/nginx -t -q -g 'pid /var/run/nginx.pid; daemon on; master_process on;'
 ExecStart=/usr/sbin/nginx -g 'pid /var/run/nginx.pid; daemon on; master_process on;'
diff --git a/package/nss-pam-ldapd/nslcd.service b/package/nss-pam-ldapd/nslcd.service
index 6c0d71b241..5a000a8e4c 100644
--- a/package/nss-pam-ldapd/nslcd.service
+++ b/package/nss-pam-ldapd/nslcd.service
@@ -4,7 +4,7 @@  After=syslog.target network.target
 
 [Service]
 Type=forking
-PIDFile=/var/run/nslcd/nslcd.pid
+PIDFile=/run/nslcd/nslcd.pid
 ExecStart=/usr/sbin/nslcd
 
 [Install]
diff --git a/package/openvmtools/vmtoolsd.service b/package/openvmtools/vmtoolsd.service
index cb97357ec2..12e28f5923 100644
--- a/package/openvmtools/vmtoolsd.service
+++ b/package/openvmtools/vmtoolsd.service
@@ -5,7 +5,7 @@  ConditionVirtualization=vmware
 
 [Service]
 Type=forking
-PIDFile=/var/run/vmtoolsd.pid
+PIDFile=/run/vmtoolsd.pid
 ExecStart=/usr/bin/vmtoolsd -b /var/run/vmtoolsd.pid
 Restart=on-failure
 KillMode=process