aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Rees <crees@FreeBSD.org>2021-02-21 18:56:56 +0000
committerChris Rees <crees@FreeBSD.org>2021-02-23 13:19:44 +0000
commitd27999e51396b301d83bb7d6cdd51f6d6f4fff2d (patch)
treef2c33b038b50cad825da59091a8f571da0a729ad
parent77e1ccbee3ed6c837929e4e232fd07f95bfc8294 (diff)
downloadsrc-d27999e51396b301d83bb7d6cdd51f6d6f4fff2d.tar.gz
src-d27999e51396b301d83bb7d6cdd51f6d6f4fff2d.zip
Create dhclient pid directory if it doesn't exist
- Upgrading from older FreeBSD versions can result in errors - /var/run can be a tmpfs, and this should be handled correctly Approved by: markj Differential Revision: https://reviews.freebsd.org/D28843 MFC after: 2 weeks
-rwxr-xr-xlibexec/rc/rc.d/dhclient5
1 files changed, 5 insertions, 0 deletions
diff --git a/libexec/rc/rc.d/dhclient b/libexec/rc/rc.d/dhclient
index 520a0850ccbc..765e38266408 100755
--- a/libexec/rc/rc.d/dhclient
+++ b/libexec/rc/rc.d/dhclient
@@ -49,6 +49,11 @@ dhclient_prestart()
rc_flags="${rc_flags} -b"
fi
+
+ # /var/run/dhclient is not guaranteed to exist,
+ # e.g. if /var/run is a tmpfs
+ install -d -o root -g wheel -m 755 ${pidfile%/*}
+
rc_flags="${rc_flags} ${ifn}"
}