This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=1799c137bcf4348e04c92edcc481dffc16f74c8c

commit 1799c137bcf4348e04c92edcc481dffc16f74c8c
Author: Guillem Jover <[email protected]>
AuthorDate: Mon Sep 6 04:54:02 2021 +0200

    build: Switch from hardcoded /run to parametrized runstatedir
---
 debian/rules              | 1 +
 man/Makefile.am           | 1 +
 man/start-stop-daemon.pod | 6 +++---
 utils/Makefile.am         | 1 +
 utils/start-stop-daemon.c | 4 ++--
 5 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/debian/rules b/debian/rules
index 5b8537752..5c5fcb2cc 100755
--- a/debian/rules
+++ b/debian/rules
@@ -61,6 +61,7 @@ build-tree/config.status:
                --sysconfdir=/etc \
                --sbindir=/sbin \
                --localstatedir=/var \
+               --runstatedir=/run \
                --libexecdir=\$${exec_prefix}/lib \
                --with-devlibdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
                --without-libmd \
diff --git a/man/Makefile.am b/man/Makefile.am
index 6f615fe64..54a99c98f 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -219,6 +219,7 @@ PODSUBST = $(SED) \
        -e 's/%VERSION%/$(PACKAGE_VERSION)/g' \
        -e 's/%RELEASE_DATE%/$(PACKAGE_RELEASE_DATE)/g' \
        -e 's:%CONFDIR%:$(sysconfdir):g' \
+       -e 's:%RUNSTATEDIR%:$(runstatedir):g' \
        -e 's:%LOGDIR%:$(logdir):g' \
        -e 's:%ADMINDIR%:$(admindir):g' \
        -e 's:%BACKUPSDIR%:$(backupsdir):g' \
diff --git a/man/start-stop-daemon.pod b/man/start-stop-daemon.pod
index 499e9451c..e5c40a0c8 100644
--- a/man/start-stop-daemon.pod
+++ b/man/start-stop-daemon.pod
@@ -485,7 +485,7 @@ food, running as user food, with pid in food.pid):
 =over
 
  start-stop-daemon --start --oknodo --user food --name food \
-       --pidfile /run/food.pid --startas /usr/sbin/food \
+       --pidfile %RUNSTATEDIR%/food.pid --startas /usr/sbin/food \
        --chuid food -- --daemon
 
 =back
@@ -495,7 +495,7 @@ Send B<SIGTERM> to B<food> and wait up to 5 seconds for it 
to stop:
 =over
 
  start-stop-daemon --stop --oknodo --user food --name food \
-       --pidfile /run/food.pid --retry 5
+       --pidfile %RUNSTATEDIR%/food.pid --retry 5
 
 =back
 
@@ -504,6 +504,6 @@ Demonstration of a custom schedule for stopping B<food>:
 =over
 
  start-stop-daemon --stop --oknodo --user food --name food \
-       --pidfile /run/food.pid --retry=TERM/30/KILL/5
+       --pidfile %RUNSTATEDIR%/food.pid --retry=TERM/30/KILL/5
 
 =back
diff --git a/utils/Makefile.am b/utils/Makefile.am
index 0bfb2e9f9..a86cba32b 100644
--- a/utils/Makefile.am
+++ b/utils/Makefile.am
@@ -5,6 +5,7 @@ AM_CPPFLAGS = \
        -DLOCALEDIR=\"$(localedir)\" \
        -DLOGDIR=\"$(logdir)\" \
        -DSYSCONFDIR=\"$(sysconfdir)\" \
+       -DRUNSTATEDIR=\"$(runstatedir)\" \
        -idirafter $(top_srcdir)/lib/compat \
        -I$(top_builddir) \
        -I$(top_srcdir)/lib
diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
index b6835cdc6..6863151c1 100644
--- a/utils/start-stop-daemon.c
+++ b/utils/start-stop-daemon.c
@@ -566,8 +566,8 @@ setup_socket_name(const char *suffix)
 {
        const char *basedir;
 
-       if (getuid() == 0 && access("/run", F_OK) == 0) {
-               basedir = "/run";
+       if (getuid() == 0 && access(RUNSTATEDIR, F_OK) == 0) {
+               basedir = RUNSTATEDIR;
        } else {
                basedir = getenv("TMPDIR");
                if (basedir == NULL)

-- 
Dpkg.Org's dpkg

Reply via email to