Skip to content

Commit

Permalink
Fix #25: Save mrouted.genid in /var/lib instead of /run
Browse files Browse the repository at this point in the history
Saving in /var/lib means we could inspect the genid across reboots if
the system preserves /var/lib.  The /run is always cleared on reboot.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
  • Loading branch information
troglobit committed Mar 11, 2019
1 parent 0e819a4 commit 2e73ec3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ cat <<EOF
prefix................: $prefix
sysconfdir............: `eval echo $sysconfdir`
runstatedir...........: `eval echo $runstatedir`
localstatedir.........: `eval echo $localstatedir`
C Compiler............: $CC $CFLAGS $CPPFLAGS $LDFLAGS $LIBS

Optional features:
Expand Down
4 changes: 2 additions & 2 deletions man/mrouted.8
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,10 @@ writes its process ID to
.Pa /var/run/mrouted.pid
when it has completed its start up and is ready to receive signals.
.Sh FILES
.Bl -tag -width /var/run/mrouted.genid -compact
.Bl -tag -width /var/lib/mrouted.genid -compact
.It Pa /etc/mrouted.conf
Main configuration file.
.It Pa /var/run/mrouted.genid
.It Pa /var/lib/mrouted.genid
DVMRP generation ID. Used by neighboring DVRMP routers to detect when a
router is restarted.
.It Pa /var/run/mrouted.pid
Expand Down
2 changes: 1 addition & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ AUTOMAKE_OPTIONS = subdir-objects
# In GLIBC >= v2.20 this is replaced with -D_DEFAULT_SOURCE,
# but to build on older GLIBC systems we now need both ...
AM_CPPFLAGS = -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_GNU_SOURCE -I$(top_srcdir)/include
AM_CPPFLAGS += -DSYSCONFDIR=\"@sysconfdir@\" -DRUNSTATEDIR=\"@runstatedir@\"
AM_CPPFLAGS += -DSYSCONFDIR=\"@sysconfdir@\" -DRUNSTATEDIR=\"@runstatedir@\" -DPRESERVEDIR=\"@localstatedir@/lib\"
if LINUX
AM_CPPFLAGS += -DIOCTL_OK_ON_RAW_SOCKET
endif
Expand Down
2 changes: 1 addition & 1 deletion src/pathnames.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <paths.h>

#define _PATH_MROUTED_CONF SYSCONFDIR "/mrouted.conf"
#define _PATH_MROUTED_GENID RUNSTATEDIR "/mrouted.genid"
#define _PATH_MROUTED_GENID PRESERVEDIR "/mrouted.genid"
#define _PATH_MROUTED_SOCK RUNSTATEDIR "/mrouted.sock"

#endif /* MROUTED_PATHNAMES_H_ */

0 comments on commit 2e73ec3

Please sign in to comment.