SYSTEMCTL = @SYSTEMCTL@
SYSTEMD_UNIT_DIR = @SYSTEMD_UNIT_DIR@
+ifndef USE_CROND
+USE_CROND = @USE_CROND@
+endif
+ifeq ($(USE_CROND),y)
+SYSTEMD_UNIT_DIR =
+endif
+
# Run-command directories
ifndef RC_DIR
RC_DIR = @RC_DIR@
fi \
fi
ifeq ($(COPY_ONLY),n)
- if [ -x "$(SYSTEMCTL)" ]; then \
+ if [ -n "$(SYSTEMD_UNIT_DIR)" -a -x "$(SYSTEMCTL)" ]; then \
$(SYSTEMCTL) enable sysstat.service; \
fi
endif
uninstall_all: uninstall_base
ifeq ($(COPY_ONLY),n)
- if [ -z "$(SYSTEMD_UNIT_DIR)" -o ! -d $(DESTDIR)$(SYSTEMD_UNIT_DIR) ]; then \
- -su $(CRON_OWNER) -c "crontab -l > /tmp/crontab-$(CRON_OWNER).old" ; \
- -$(CP) -a /tmp/crontab-$(CRON_OWNER).old ./crontab-$(CRON_OWNER).`date '+%Y%m%d.%H%M%S'`.old ; \
- @echo "USER'S CRONTAB SAVED IN CURRENT DIRECTORY (USING .old SUFFIX)." ; \
- -su $(CRON_OWNER) -c "crontab -r" ; \
+ -if [ -z "$(SYSTEMD_UNIT_DIR)" -o ! -d "$(DESTDIR)$(SYSTEMD_UNIT_DIR)" ]; then \
+ su $(CRON_OWNER) -c "crontab -l > /tmp/crontab-$(CRON_OWNER).old" ; \
+ $(CP) -a /tmp/crontab-$(CRON_OWNER).old ./crontab-$(CRON_OWNER).`date '+%Y%m%d.%H%M%S'`.old ; \
+ echo "USER'S CRONTAB SAVED IN CURRENT DIRECTORY (USING .old SUFFIX)." ; \
+ su $(CRON_OWNER) -c "crontab -r" ; \
fi
- if [ -x $(SYSTEMCTL) ]; then \
+ -if [ -n "$(SYSTEMD_UNIT_DIR)" -a -x "$(SYSTEMCTL)" ]; then \
$(SYSTEMCTL) disable sysstat.service; \
fi
endif
- if [ -n "$(SYSTEMD_UNIT_DIR)" -a -d $(DESTDIR)$(SYSTEMD_UNIT_DIR) ]; then \
+ if [ -n "$(SYSTEMD_UNIT_DIR)" -a -d "$(DESTDIR)$(SYSTEMD_UNIT_DIR)" ]; then \
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/sysstat.service; \
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/sysstat-collect.service; \
rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/sysstat-collect.timer; \
--- /dev/null
+By default sysstat uses systemd if available to start
+the sa1 (the data collector) and sa2 scripts periodically.
+Answer y if you want to use the standard cron daemon instead.
+Default answer is n (no).
SADC_OPT
sadc_options
cron_interval
+USE_CROND
cron_owner
INSTALL_CRON
CLEAN_SA_DIR
enable_compress_manpg
enable_clean_sa_dir
enable_install_cron
+enable_use_crond
enable_collect_all
enable_copy_only
enable_documentation
--enable-compress-manpg compress sysstat manual pages
--enable-clean-sa-dir clean system activity directory
--enable-install-cron install a crontab to start sar
+ --enable-use-crond use standard cron daemon
--enable-collect-all collect all possible activities
--enable-copy-only only copy files when installing
--disable-documentation do not install documentation
# --disable-pcp do not link against PCP libraries even if available
# --disable-stripping do not strip object files
# --enable-copy-only only copy files when installing sysstat
+# --enable-use-crond use standard cron daemon
#
# Some influential environment variables:
# rcdir directory where startup scripts are installed
REM_CHOWN=$CHOWN
fi
+# Check whether we should use the standard cron daemon
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we should use the standard cron daemon" >&5
+$as_echo_n "checking whether we should use the standard cron daemon... " >&6; }
+ # Check whether --enable-use-crond was given.
+if test "${enable_use_crond+set}" = set; then :
+ enableval=$enable_use_crond; UCROND=$enableval
+else
+ UCROND=no
+fi
+
+ if test $UCROND != "yes"; then
+ USE_CROND=n
+ UCROND=no
+ else
+ USE_CROND=y
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $UCROND" >&5
+$as_echo "$UCROND" >&6; }
+
+
# Crontab interval
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking crontab interval" >&5
$as_echo_n "checking crontab interval... " >&6; }
AUX_DOC=yes
fi
-if test $AUX_DOC != "no"; then
+if test $AUX_DOC != "no"; then
AUX_DOC="yes"
INSTALL_DOC="y"
else
Sysstat version: $PACKAGE_VERSION
Installation prefix: $prefix
rc directory: ${RC_DIR}
- Init directory: ${INIT_DIR}
- Systemd unit dir: ${with_systemdsystemunitdir}
- Configuration file: ${SYSCONFIG_DIR}/${SYSCONFIG_FILE}
+ Init directory: ${INIT_DIR}"
+if test $UCROND != "yes"; then
+ echo " Systemd unit dir: ${with_systemdsystemunitdir}"
+else
+ echo " Use standard cron daemon"
+fi
+echo " Configuration file: ${SYSCONFIG_DIR}/${SYSCONFIG_FILE}
Man pages directory: $mandir
Compiler: $CC
Compiler flags: $CFLAGS
"
-
# --disable-pcp do not link against PCP libraries even if available
# --disable-stripping do not strip object files
# --enable-copy-only only copy files when installing sysstat
+# --enable-use-crond use standard cron daemon
#
# Some influential environment variables:
# rcdir directory where startup scripts are installed
REM_CHOWN=$CHOWN
fi
+# Check whether we should use the standard cron daemon
+ AC_MSG_CHECKING(whether we should use the standard cron daemon)
+ AC_ARG_ENABLE(use-crond,
+ AC_HELP_STRING([--enable-use-crond],
+ [use standard cron daemon]),
+ UCROND=$enableval,UCROND=no)
+ if test $UCROND != "yes"; then
+ USE_CROND=n
+ UCROND=no
+ else
+ USE_CROND=y
+ fi
+ AC_MSG_RESULT($UCROND)
+ AC_SUBST(USE_CROND)
+
# Crontab interval
AC_MSG_CHECKING(crontab interval)
AC_ARG_VAR([cron_interval],[crontab interval])
AC_HELP_STRING([--disable-documentation],
[do not install documentation]),
AUX_DOC=$enableval,AUX_DOC=yes)
-if test $AUX_DOC != "no"; then
+if test $AUX_DOC != "no"; then
AUX_DOC="yes"
INSTALL_DOC="y"
else
Sysstat version: $PACKAGE_VERSION
Installation prefix: $prefix
rc directory: ${RC_DIR}
- Init directory: ${INIT_DIR}
- Systemd unit dir: ${with_systemdsystemunitdir}
- Configuration file: ${SYSCONFIG_DIR}/${SYSCONFIG_FILE}
+ Init directory: ${INIT_DIR}"
+if test $UCROND != "yes"; then
+ echo " Systemd unit dir: ${with_systemdsystemunitdir}"
+else
+ echo " Use standard cron daemon"
+fi
+echo " Configuration file: ${SYSCONFIG_DIR}/${SYSCONFIG_FILE}
Man pages directory: $mandir
Compiler: $CC
Compiler flags: $CFLAGS
"
-
#!/bin/sh
#@(#) Configuration script for sysstat
-# (C) 2000-2014 Sebastien GODARD (sysstat <at> orange.fr)
+# (C) 2000-2020 Sebastien GODARD (sysstat <at> orange.fr)
ASK="sh build/Ask.sh"
fi
fi
+if [ "${CRON}" != "" ];
+then
+ USE_CROND=`${ASK} 'Use standard cron daemon? (y/n)' "--enable-use-crond" "use-crond"`
+ if [ "${USE_CROND}" = "y" ]; then
+ USE_CROND="--enable-use-crond "
+ else
+ USE_CROND=""
+ echo "Parameter --enable-use-crond is NOT set"
+ fi
+fi
+
if [ "${CRON}" != "" ];
then
CRON_INTERVAL=`${ASK} 'Crontab sampling interval (in minutes):' "cron_interval" "cron_interval"`
echo
echo -n "./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${SYSCONFIG_FILE} \
-${CLEAN_SA_DIR}${NLS}${HISTORY}${COMPRESSAFTER}${MAN}${IGNORE_FILE_ATTR}${CRON}${RCDIR}"
+${CLEAN_SA_DIR}${NLS}${HISTORY}${COMPRESSAFTER}${MAN}${IGNORE_FILE_ATTR}${CRON}${USE_CROND}${RCDIR}"
if [ "${SADC_OPT}" != "" ];
then
echo -n "sadc_options=\"${SADC_OPT}\""
./configure ${PREFIX}${SA_LIB_DIR}${SA_DIR}${SYSCONFIG_DIR}${SYSCONFIG_FILE} \
${CLEAN_SA_DIR}${NLS} \
-${HISTORY}${COMPRESSAFTER}${MAN}${IGNORE_FILE_ATTR}${CRON}${RCDIR} \
+${HISTORY}${COMPRESSAFTER}${MAN}${IGNORE_FILE_ATTR}${CRON}${USE_CROND}${RCDIR} \
sadc_options="${SADC_OPT}" ${COMPRESSMANPG}${INSTALL_DOC}${DEBUGINFO}${SENSORS} \
${PCP}${STRIP}${COPY_ONLY}
-