#!/bin/bash hvconfig_pre() { groupadd -f fcron hv_useradd -c fcron -g fcron fcron # Create a dummy sendmail executable to fool fcron DUMMY_SM_PATH=/usr/sbin/sendmail if [ ! -f ${DUMMY_SM_PATH} ]; then DUMMY_SM=yes touch ${DUMMY_SM_PATH} chmod 755 ${DUMMY_SM_PATH} fi CONFIGURE_OPTS="${CONFIGURE_OPTS} \ --with-editor=/usr/bin/nano \ --with-boot-install=no \ --with-answer-all=no" } hvbuild_post() { if [ "x${DUMMY_SM}" = "xyes" ]; then rm ${DUMMY_SM_PATH} fi rm -f /etc/fcron.conf mkdir -p /etc/fcron mv -f /etc/fcron.allow /etc/fcron mv -f /etc/fcron.deny /etc/fcron cat > /etc/fcron/fcron.conf << "EOF" # fcron.conf - Configuration file for fcron(8) and fcrontab(1). # See fcron.conf(5) for syntax and explanations. # # WARNING : this file must be owned by root:fcron and 640. # # # The spool directory where fcron stores its files fcrontabs = /var/spool/fcron # # The locations of the pid file and the fifo file pidfile = /var/run/fcron.pid fifofile = /var/run/fcron.fifo # # allow/deny files to determine which users are allowed to use fcrontab fcronallow = /etc/fcron/fcron.allow fcrondeny = /etc/fcron/fcron.deny # # Location of the programs used by fcron shell = /bin/sh sendmail = /usr/sbin/sendmail # # Location of the default editor for "fcrontab -e" editor = /usr/bin/nano EOF chmod 640 /etc/fcron/fcron.conf cat > /etc/fcron/fcrontab << "EOF" # &options min hrs day-of-month month day-of-week command # Run rotatelogs every day at 00:05 #&mail(false) 05 00 * * * /usr/local/bin/rotatelogs EOF chmod 640 /etc/fcron/fcrontab chown -R root.fcron /etc/fcron install -d /var/spool/fcron chown fcron.fcron /var/spool/fcron cat > /etc/fcron/configure << "EOF" #!/bin/sh fcrontab -c /etc/fcron/fcron.conf /etc/fcron/fcrontab exit $? EOF chmod 740 /etc/fcron/configure # Executing fcron configure script. /etc/fcron/configure install -v -m740 ${SCRDIR}/bootscripts/fcron /etc/rc.d/init.d # script-name start stop bootscript_add_rcsysinit fcron 95 84 }