diff options
| author | Roy Marples <roy@marples.name> | 2016-11-08 12:17:20 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2016-11-08 12:17:20 +0000 |
| commit | 4e40c20810dfec3e2512c0844f058dd57202eb6b (patch) | |
| tree | 84a85c41cf9254a6b194d8311614d52a15ed2ab6 | |
| parent | 5d86d72bfe682c15053e001dc54b77c33798034f (diff) | |
| download | dhcpcd-4e40c20810dfec3e2512c0844f058dd57202eb6b.tar.xz | |
Default DBDIR from /var/db to /var/db/dhcpcd.
Move dhcpcd.duid and dhcpcd.secret from /etc into /var/db/dhcpcd.
Move leases and RDM monotonc from /var/db into /var/db/dhcpcd.
All moves files have the dhcpcd{.-} prefix dropped.
| -rw-r--r-- | Makefile | 28 | ||||
| -rw-r--r-- | README | 15 | ||||
| -rwxr-xr-x | configure | 2 | ||||
| -rw-r--r-- | defs.h | 8 | ||||
| -rw-r--r-- | dhcpcd.8.in | 16 |
5 files changed, 54 insertions, 15 deletions
@@ -130,8 +130,36 @@ _maninstall: ${MAN5} ${MAN8} _confinstall: ${INSTALL} -d ${DESTDIR}${SYSCONFDIR} + # Install a new default config if not present test -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.conf || \ ${INSTALL} -m ${CONFMODE} dhcpcd.conf ${DESTDIR}${SYSCONFDIR} + # Attempt to move files from sysconfig to dbdir + if [ ! -e ${DESTDIR}${DBDIR}/duid -a \ + -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.duid ]; \ + then \ + mv ${DESTDIR}${SYSCONFDIR}/dhcpcd.duid \ + ${DESTDIR}${DBDIR}/duid; \ + fi + if [ ! -e ${DESTDIR}${DBDIR}/secret -a \ + -e ${DESTDIR}${SYSCONFDIR}/dhcpcd.secret ]; \ + then \ + mv ${DESTDIR}${SYSCONFDIR}/dhcpcd.secret \ + ${DESTDIR}${DBDIR}/secret; \ + fi + # Move leases to new location + for lease in ${DESTDIR}${DBDIR}/../dhcpcd-*.lease*; do \ + [ -f "$$lease" ] || continue; \ + newlease=$$(basename "$$lease" | ${SED} -e "s/dhcpcd-//"); \ + mv "$$lease" ${DESTDIR}${DBDIR}/"$$newlease"; \ + done + # Move RDM monotonic to new location + if [ ! -e ${DESTDIR}${DBDIR}/rdm_monotonic -a \ + -e ${DESTDIR}${DBDIR}/../dhcpcd-rdm.monotonic ]; \ + then \ + mv ${DESTDIR}${DBDIR}/../dhcpcd-rdm.monotonic \ + ${DESTDIR}${DBDIR}/rdm_monotonic; \ + fi + hooks: cd dhcpcd-hooks; ${MAKE}; cd ..; done @@ -169,8 +169,19 @@ happen in a custom OS hook: Compatibility ------------- -dhcpcd-5.0 is only fully command line compatible with dhcpcd-4.0 -For compatibility with older versions, use dhcpcd-4.0 +dhcpcd-5 is only fully command line compatible with dhcpcd-4 +For compatibility with older versions, use dhcpcd-4 + + +Upgrading +--------- +dhcpcd-7 defaults the database directory to /var/db/dhcpcd instead of /var/db +and now stores dhcpcd.duid and dhcpcd.secret in there instead of /etc. +of /etc. +The Makefile _confinstall target will attempt to move the files correctly from +the old locations to the new locations. +Of course this won't work if dhcpcd-7 is packaged up, so packagers will need to +install similar logic into their dhcpcd package. ChangeLog @@ -182,7 +182,7 @@ done : ${LIBDIR:=$PREFIX/lib} : ${LIBEXECDIR:=$PREFIX/libexec} : ${STATEDIR:=/var} -: ${DBDIR:=$STATEDIR/db} +: ${DBDIR:=$STATEDIR/db/dhcpcd} : ${RUNDIR:=$STATEDIR/run} : ${MANDIR:=${PREFIX:-/usr}/share/man} : ${DATADIR:=${PREFIX:-/usr}/share} @@ -40,13 +40,13 @@ # define DEVDIR LIBDIR "/" PACKAGE "/dev" #endif #ifndef DUID -# define DUID SYSCONFDIR "/" PACKAGE ".duid" +# define DUID DBDIR "/duid" #endif #ifndef SECRET -# define SECRET SYSCONFDIR "/" PACKAGE ".secret" +# define SECRET DBDIR "/secret" #endif #ifndef LEASEFILE -# define LEASEFILE DBDIR "/" PACKAGE "-%s%s.lease" +# define LEASEFILE DBDIR "/%s%s.lease" #endif #ifndef LEASEFILE6 # define LEASEFILE6 LEASEFILE "6" @@ -61,7 +61,7 @@ # define UNPRIVSOCKET RUNDIR "/" PACKAGE ".unpriv.sock" #endif #ifndef RDM_MONOFILE -# define RDM_MONOFILE DBDIR "/" PACKAGE "-rdm.monotonic" +# define RDM_MONOFILE DBDIR "/rdm_monotonic" #endif #ifndef NO_SIGNALS diff --git a/dhcpcd.8.in b/dhcpcd.8.in index aa260f81..bb73abce 100644 --- a/dhcpcd.8.in +++ b/dhcpcd.8.in @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 15, 2016 +.Dd November 8, 2016 .Dt DHCPCD 8 .Os .Sh NAME @@ -751,10 +751,6 @@ knows which process to signal. .It Pa @SYSCONFDIR@/dhcpcd.conf Configuration file for dhcpcd. If you always use the same options, put them here. -.It Pa @SYSCONFDIR@/dhcpcd.duid -Text file that holds the DUID used to identify the host. -.It Pa @SYSCONFDIR@/dhcpcd.secret -Text file that holds a secret key known only to the host. .It Pa @SCRIPT@ Bourne shell script that is run to configure or de-configure an interface. .It Pa @LIBDIR@/dhcpcd/dev @@ -765,15 +761,19 @@ A directory containing bourne shell scripts that are run by the above script. Each script can be disabled by using the .Fl C , Fl Fl nohook option described above. -.It Pa @DBDIR@/dhcpcd\- Ns Ar interface Ns Ar -ssid Ns .lease +.It Pa @DBDIR@/duid +Text file that holds the DUID used to identify the host. +.It Pa @DBDIR@/secret +Text file that holds a secret key known only to the host. +.It Pa @DBDIR@/ Ns Ar interface Ns Ar -ssid Ns .lease The actual DHCP message sent by the server. We use this when reading the last lease and use the files mtime as when it was issued. -.It Pa @DBDIR@/dhcpcd\- Ns Ar interface Ns Ar -ssid Ns .lease6 +.It Pa @DBDIR@/ Ns Ar interface Ns Ar -ssid Ns .lease6 The actual DHCPv6 message sent by the server. We use this when reading the last lease and use the files mtime as when it was issued. -.It Pa @DBDIR@/dhcpcd-rdm.monotonic +.It Pa @DBDIR@/rdm_monotonic Stores the monotonic counter used in the .Ar replay field in Authentication Options. |
