--- apcupsd-3.14.13/./autoconf/config.h.in~ 2015-01-02 19:12:47.000000000 +0200 +++ apcupsd-3.14.13/./autoconf/config.h.in 2015-09-16 16:40:33.785163382 +0300 @@ -295,6 +295,9 @@ /* Default directory in which log is written */ #undef LOGDIR +/* Define the default "status" files directory. */ +#undef STATDIR + /* Default port number for NIS server */ #undef NISPORT --- apcupsd-3.14.13/autoconf/configure.in~ 2015-09-16 16:36:41.000000000 +0300 +++ apcupsd-3.14.13/autoconf/configure.in 2015-09-16 16:37:57.190362425 +0300 @@ -14,7 +14,7 @@ dnl Config header file. AC_CONFIG_HEADER(include/apcconfig.h:autoconf/config.h.in) topdir=`pwd` -AC_CONFIG_AUX_DIR(${topdir}/autoconf) +AC_CONFIG_AUX_DIR([autoconf]) dnl dnl Absolute srcdir @@ -887,9 +887,6 @@ dnl If the AC_CONFIG_AUX_DIR macro for a dnl find the mkinstalldirs script in another subdir than ($topdir). dnl Try to locate it. MKINSTALLDIRS= -if test -n "$ac_aux_dir"; then - MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" -fi if test x$MKINSTALLDIRS = x ; then MKINSTALLDIRS="\$(topdir)/autoconf/mkinstalldirs" fi @@ -1261,16 +1261,25 @@ # Find the default directory to put the root-mode PID file in for PIDDIR in "/var/run" "/etc/apcupsd" do - if test -d $PIDDIR + if test -d $PIDDIR then break; fi done -# Find the default directory to put the apcupsd.events and apcupsd.status files +# Find the default directory to put the apcupsd.events file for LOGDIR in "/var/log" "/etc/apcupsd" do - if test -d $LOGDIR + if test -d $LOGDIR + then + break; + fi +done + +# Find the default directory to put the apcupsd.status file +for STATDIR in "/var/log" "/etc/apcupsd" "/var/lib/apcupsd" +do + if test -d $STATDIR then break; fi @@ -1499,9 +1508,14 @@ # now allow user to specify LOGDIR AC_ARG_WITH(log-dir, - [AC_HELP_STRING([--with-log-dir=DIR], [Specify EVENTS and STATUS directory (default is OS dependent)])], + [AC_HELP_STRING([--with-log-dir=DIR], [Specify EVENTS directory (default is OS dependent)])], [LOGDIR="$withval";]) +# now allow user to specify STATDIR +AC_ARG_WITH(stat-dir, + [AC_HELP_STRING([--with-stat-dir=DIR], [Specify STATUS directory (default is OS dependent)])], + [STATDIR="$withval";]) + # now allow user to specify LOCKDIR AC_ARG_WITH(lock-dir, [AC_HELP_STRING([--with-lock-dir=DIR], [Specify serial port lock directory (default is OS dependent)])], @@ -1396,6 +1396,8 @@ AC_SUBST(LOGDIR) AC_DEFINE_UNQUOTED(NOLOGDIR, "$nologdir", [Default directory in which nologin file is written]) AC_SUBST(nologdir) +AC_DEFINE_UNQUOTED(STATDIR, "$STATDIR") +AC_SUBST(STATDIR) AC_DEFINE_UNQUOTED(PWRFAILDIR, "$PWRFAILDIR", [Default directory in which powerfail flag file is written]) AC_SUBST(PWRFAILDIR) AC_SUBST(LOCKDIR) @@ -1713,7 +1729,8 @@ Install man files: ${mandir} Nologin file in: ${nologdir} PID directory: ${PIDDIR} - LOG dir (events, status) ${LOGDIR} + LOG dir (events) ${LOGDIR} + STAT dir (status) ${STATDIR} LOCK dir (for serial port) ${LOCKDIR} Power Fail dir ${PWRFAILDIR} Compiler: ${CXX} ${CXXVERSION} --- apcupsd-3.12.1/platforms/etc/apcupsd.conf.in.orig 2005-12-31 00:26:41.000000000 +0100 +++ apcupsd-3.12.1/platforms/etc/apcupsd.conf.in 2006-01-24 13:45:20.000000000 +0100 @@ -227,7 +227,7 @@ STATTIME 0 # Location of STATUS file (written to only if STATTIME is non-zero) -STATFILE @LOGDIR@/apcupsd.status +STATFILE @STATDIR@/apcupsd.status # LOGSTATS [ on | off ] on enables, off disables # Note! This generates a lot of output, so if