dhcpcd-discuss

Re: [dhcpcd][PATCH 2/2] rundir: move from /var/run to /run by default

Roy Marples

Sat Dec 31 10:57:06 2011

On Fri, 30 Dec 2011 00:06:26 +0100, Tom Gundersen wrote:
Most Linux distributions seem to have adopted the new /run directory.
Use this by default.

Most != all and certainly the BSD's aren't using /run.
I dislike the notion that Linuxisms should be the default, especially when my preferred development platform is NetBSD :P

In most cases this will not make a difference as /var/run is a
symlink to /run, or /run is
bind-mounted on top of /var/run. However, as /run is available very
early during boot, using /run
rather than /var/run  means that dhcpcd could be used before /var is
mounted, which might be
particularly useful if /var is a network mount and the network requires DHCP.

I see no problem here, but the default needs to remain /var/run and at most /run should be detected as a directory by configure.

---
 configure               |    2 +-
 dhcpcd-hooks/50-yp.conf |    2 +-
 dhcpcd-run-hooks.in     |    2 +-
 dhcpcd.8.in             |    4 ++--
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index 884040e..2cb4664 100755
--- a/configure
+++ b/configure
@@ -68,7 +68,7 @@ done
 : ${LIBEXECDIR:=$PREFIX/libexec}
 : ${STATEDIR:=/var}
 : ${DBDIR:=$STATEDIR/db}
-: ${RUNDIR:=$STATEDIR/run}
+: ${RUNDIR:=/run}
 : ${MANDIR:=${PREFIX:-/usr}/share/man}

 eval SYSCONFDIR="$SYSCONFDIR"
diff --git a/dhcpcd-hooks/50-yp.conf b/dhcpcd-hooks/50-yp.conf
index 1a2bf4f..822822c 100644
--- a/dhcpcd-hooks/50-yp.conf
+++ b/dhcpcd-hooks/50-yp.conf
@@ -3,7 +3,7 @@

 ypbind_pid()
 {
-	[ -s /var/run/ypbind.pid ] && cat /var/run/ypbind.pid
+	[ -s /run/ypbind.pid ] && cat /run/ypbind.pid
 }

 make_yp_conf()
diff --git a/dhcpcd-run-hooks.in b/dhcpcd-run-hooks.in
index 52a1e18..aed5629 100644
--- a/dhcpcd-run-hooks.in
+++ b/dhcpcd-run-hooks.in
@@ -7,7 +7,7 @@ signature_base="# Generated by dhcpcd"
 signature="$signature_base $from $interface"
 signature_base_end="# End of dhcpcd"
 signature_end="$signature_base_end $from $interface"
-state_dir=/var/run/dhcpcd
+state_dir=/run/dhcpcd

 if_up=false
 if_down=false
diff --git a/dhcpcd.8.in b/dhcpcd.8.in
index b68d5dc..dafaa6a 100644
--- a/dhcpcd.8.in
+++ b/dhcpcd.8.in
@@ -557,11 +557,11 @@ option described above.
 .It Pa @DBDIR@/dhcpcd\- Ns Ar interface Ns .lease
 The actual DHCP message send by the server. We use this when reading
the last
 lease and use the files mtime as when it was issued.
-.It Pa /var/run/dhcpcd.pid
+.It Pa /run/dhcpcd.pid
 Stores the PID of
 .Nm
 running on all interfaces.
-.It Pa /var/run/dhcpcd\- Ns Ar interface Ns .pid
+.It Pa /run/dhcpcd\- Ns Ar interface Ns .pid
 Stores the PID of
 .Nm
 running on the

All of the above segments need to be changed to pickup $RUNDIR from configure.

Thanks

Roy

Follow-Ups:
Re: [dhcpcd][PATCH 2/2] rundir: move from /var/run to /run by defaultTom Gundersen
Archive administrator: postmaster@marples.name