The Fcron package contains a periodical command scheduler which aims at replacing Vixie Cron.
Download (HTTP): http://fcron.free.fr/fcron-2.9.3.src.tar.gz
Download (FTP): ftp://ftp.seul.org/pub/fcron/fcron-2.9.3.src.tar.gz
Download size: 365 KB
Estimated Disk space required: 3.3 MB
Estimated build time: 0.11 SBU
Sendmail-8.12.10 or Postfix-2.0.16 or qmail-1.03 or Exim-4.24 or Courier-0.43.2, Linux-PAM-0.77, OpenJade-1.3.2 and DocBook DSSSL Stylesheets-1.78
Fcron uses the cron facility of syslog to log all messages. Since LFS does not set up this facility in /etc/syslog.conf, it needs to be done prior to installing Fcron. This command will append the necessary line to the current /etc/syslog.conf.
cat >> /etc/syslog.conf << "EOF" # Begin fcron addition to /etc/syslog.conf cron.* -/var/log/cron.log # End fcron addition EOF |
The configuration file has been modified, so reloading the sysklogd daemon will activate the changes.
/etc/rc.d/init.d/sysklogd reload |
For security reasons, we need to create an unprivileged user and group for fcron:
groupadd fcron && useradd -c fcron -g fcron fcron |
Install Fcron by running the following commands:
./configure --without-sendmail --with-answer-all=no && make && make install |
--without-sendmail: Fcron does not require an MTA to run but will use one, if it is installed, to email you the results of the fcron script. If you wish to utilize this feature change the switch to --with-sendmail=[path to your MTA] .
--with-answer-all=no: After the files are installed, the make install script enters into a configuration routine. The first test will be whether to install a boot script in the /etc/rc.d/init.d directory with the appropriate symbolic links in run levels 2, 3, 4, and 5. The second is to stop any current fcron processes and start a new one. Since this is probably your first install and we want a boot script based upon the BLFS template we answer 'n' to both tests.
--with-dsssl-dir=/usr/share/sgml/docbook/dsssl-stylesheets-1.78 : Can be added if you have installed OpenJade and dsssl-stylesheets to generate the documentation from the DocBook source files.
There are no required changes in any of the config files. Configuration information can be found in the man page for fcron.conf.
fcron scripts are written using fcrontab . Refer to the man page for fcrontab for proper parameters for your situation.
Create the boot script with the following:
cat > /etc/rc.d/init.d/fcron << "EOF" #!/bin/sh # Begin $rc_base/init.d/fcron # Based on sysklogd script from LFS-3.1 and earlier. # Rewritten by Gerard Beekmans - [email protected] source /etc/sysconfig/rc source $rc_functions case "$1" in start) echo "Starting fcron..." loadproc fcron ;; stop) echo "Stopping fcron..." killproc fcron ;; restart) $0 stop sleep 1 $0 start ;; status) statusproc fcron ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 ;; esac # End $rc_base/init.d/fcron EOF chmod 755 /etc/rc.d/init.d/fcron |
Create the symbolic links to this file in the relevant rc.d directory with the following commands:
cd /etc/rc.d/init.d && ln -sf ../init.d/fcron ../rc0.d/K08fcron && ln -sf ../init.d/fcron ../rc2.d/S40fcron && ln -sf ../init.d/fcron ../rc3.d/S40fcron && ln -sf ../init.d/fcron ../rc4.d/S40fcron && ln -sf ../init.d/fcron ../rc5.d/S40fcron && ln -sf ../init.d/fcron ../rc6.d/K08fcron |