Difference between revisions of "Fcron"

From CBLFS
Jump to navigationJump to search
(Formatting)
Line 24: Line 24:
 
== Note to DESTDIR Fans ==
 
== Note to DESTDIR Fans ==
  
This package uses DESTDIR and for the most part installs itself beautifully. It has one problem however. The problem is [[Linux-PAM]]-related, so if you haven't installed [[Linux-PAM]], then you can ignore the rest of this section.
+
== Configuration Information ==
  
The script that determines whether you are you using the /etc/pam.conf or the /etc/pam.d scheme for [[Linux-PAM]] configuration checks whether or not /etc/pam.d exists. If it does, then it assumes that you're using the /etc/pam.d scheme. If it doesn't, then it assumes that you're using the /etc/pam.conf scheme. This works just fine unless you're using DESTDIR. The script fails to take DESTDIR into account. As such, it goes looking for <DESTDIR>/etc/pam.d and naturally doesn't find it.
 
 
So, if you're using DESTDIR, then it will ''always'' decide that you're using the /etc/pam.conf scheme. If you ''are'' using that scheme, then everythings fine and you can ignore the rest of this section. However if you're using the /etc/pam.d scheme, then you need to run the following command prior to running '''make install''':
 
 
install -dv <DESTDIR>/etc/pam.d
 
 
This rather simple fix makes it so that Fcron's script thinks that you're using the /etc/pam.d scheme - which of course is what we want. With that, DESTDIR works just as you'd expect.
 
 
== Additional Configuration Options ==
 
 
{|
 
{|
|<i>--with-editor=PATH:</i> Set the default editor for fcron. Without this flag, Fcron assumes '''vi'''.
+
|''--with-editor=PATH'': Set the default editor for fcron. Without this flag, Fcron assumes '''vi'''.
 
|-
 
|-
|<i>--with-run-non-privileged=no:</i> This is used if you want to run '''fcron''' as an unprivleged user. You need to look at [http://fcron.free.fr/doc/en/faq.html  Fcron's FAQ] if you want to do this.
+
|''--with-run-non-privileged=no'': This is used if you want to run '''fcron''' as an unprivleged user. You need to look at [http://fcron.free.fr/doc/en/faq.html  Fcron's FAQ] if you want to do this.
 
|-
 
|-
|<i>--with-dsssl-dir=/usr/share/sgml/docbook/dsssl-stylesheets-{{DocBook DSSSL StyleSheets-Version}}:</i> Pass this to build the DocBook documentation.  This path assumes that you followed the CBLFS instructions for installing the [[DocBook DSSSL StyleSheets]].
+
|''--with-dsssl-dir=/usr/share/sgml/docbook/dsssl-stylesheets-{{DocBook DSSSL StyleSheets-Version}}'': Pass this to build the DocBook documentation.  This path assumes that you followed the CBLFS instructions for installing the [[DocBook DSSSL StyleSheets]].
 
|}
 
|}
  
== Extra ==
+
{{Note|Fcron uses ''DESTDIR'', but has a problem with [[Linux-PAM]]. If you haven't installed [[Linux-PAM]], then you can ignore the rest of this note.
 
 
If you want to Fcron to log its messages, then you need to add it to /etc/syslog.conf.
 
 
 
<pre>
 
sed -i 's@# End /etc/syslog.conf@@' /etc/syslog.conf &&
 
cat >> /etc/syslog.conf << "EOF"
 
# log Fcron:
 
cron.*                                          -/var/log/cron.log
 
  
# End /etc/syslog.conf
+
The script that determines whether you are you using the /etc/pam.conf or the /etc/pam.d scheme for [[Linux-PAM]] configuration checks whether or not /etc/pam.d exists. If it does, then it assumes that you're using the /etc/pam.d scheme. If it doesn't, then it assumes that you're using the /etc/pam.conf scheme. This works fine unless you're using ''DESTDIR''. The script fails to take ''DESTDIR'' into account. As such, it goes looking for <DESTDIR>/etc/pam.d and naturally doesn't find it.
EOF
 
</pre>
 
  
The large spacing makes it so that it lines up with what's already in /etc/syslog.conf. The sed makes it so that the comment that delineates the end of the file still delineates the end of the file after our addition.
+
So, if you're using ''DESTDIR'', then it will '''always''' decide that you're using the /etc/pam.conf scheme. If you '''are''' using that scheme, then everythings fine. However if you're using the /etc/pam.d scheme, then you need to execute the following command prior to running '''make install''':
  
In order to bring our changes into effect, we need to reload the '''sysklogd''' daemon:
+
install -dv <DESTDIR>/etc/pam.d
  
/etc/rc.d/init.d/sysklogd reload
+
This simple fix makes it so that Fcron's script detects that you're using the /etc/pam.d scheme. With this, ''DESTDIR'' works as expected.}}
  
 
== Non-Multilib ==
 
== Non-Multilib ==
Line 126: Line 107:
 
== Configuring ==
 
== Configuring ==
  
=== Config Files ===
+
=== Configuration Files ===
  
/etc/fcron.conf, /etc/fcron.allow, and /etc/fcron.deny
+
The files /etc/fcron.conf, /etc/fcron.allow, and /etc/fcron.deny are used to configure fcron behavior.
  
 
=== Configuration Information ===
 
=== Configuration Information ===
  
You don't really need to do anything to configure Fcron, but '''fcrontab''' is used to write '''fcron''' scripts. Refer to the man pages for more information.
+
'''fcrontab''' is used to write '''fcron''' scripts. Refer to the man pages for more information.
  
 
If [[Linux-PAM]] was installed, then two PAM configuration files were installed in /etc/pam.d. However, if there is no /etc/pam.d and you are using /etc/pam.conf instead, then corresponding configuration sections were added to your pam.conf file instead.
 
If [[Linux-PAM]] was installed, then two PAM configuration files were installed in /etc/pam.d. However, if there is no /etc/pam.d and you are using /etc/pam.conf instead, then corresponding configuration sections were added to your pam.conf file instead.
 +
 +
=== Logging Fcron Messages ===
 +
 +
If you want to Fcron to log its messages, then you need to add it to /etc/syslog.conf.
 +
 +
<pre>
 +
sed -i 's@# End /etc/syslog.conf@@' /etc/syslog.conf &&
 +
cat >> /etc/syslog.conf << "EOF"
 +
# log Fcron:
 +
cron.*                                          -/var/log/cron.log
 +
 +
# End /etc/syslog.conf
 +
EOF
 +
</pre>
 +
 +
The large spacing makes it so that it lines up with what's already in /etc/syslog.conf. The sed makes it so that the comment that delineates the end of the file still delineates the end of the file after our addition.
 +
 +
In order to bring our changes into effect, we need to reload the '''sysklogd''' daemon:
 +
 +
/etc/rc.d/init.d/sysklogd reload
 +
  
 
=== Boot Script ===
 
=== Boot Script ===

Revision as of 08:02, 18 February 2008

Download Source: ftp://ftp.seul.org/pub/fcron/fcron-3.1.2.src.tar.gz

Introduction to Fcron

Fcron is a periodical command scheduler which aims at replacing Vixie-Cron, so it implements most of its functionalities. However, unlike Vixie Cron, Fcron does not assume that your system is running either all the time or regularly. You can, for instance, tell Fcron to execute tasks every x hours y minutes of system up time or to do a job only once in a specified interval of time. Fcron has also many more features: you can also set a nice value to a job, run it depending on the system load average, and much more.

Project Homepage: http://fcron.free.fr/

Dependencies

Optional

Creating the fcron User/Group

We need to create the fcron group and the fcron user to run fcron:

groupadd -g 24 fcron &&
useradd -c "Fcron User" -d /dev/null -u 24 -g fcron -s /bin/false fcron

Note to DESTDIR Fans

Configuration Information

--with-editor=PATH: Set the default editor for fcron. Without this flag, Fcron assumes vi.
--with-run-non-privileged=no: This is used if you want to run fcron as an unprivleged user. You need to look at Fcron's FAQ if you want to do this.
--with-dsssl-dir=/usr/share/sgml/docbook/dsssl-stylesheets-1.79: Pass this to build the DocBook documentation. This path assumes that you followed the CBLFS instructions for installing the DocBook DSSSL StyleSheets.
Caution.png

Note

Fcron uses DESTDIR, but has a problem with Linux-PAM. If you haven't installed Linux-PAM, then you can ignore the rest of this note.

The script that determines whether you are you using the /etc/pam.conf or the /etc/pam.d scheme for Linux-PAM configuration checks whether or not /etc/pam.d exists. If it does, then it assumes that you're using the /etc/pam.d scheme. If it doesn't, then it assumes that you're using the /etc/pam.conf scheme. This works fine unless you're using DESTDIR. The script fails to take DESTDIR into account. As such, it goes looking for <DESTDIR>/etc/pam.d and naturally doesn't find it.

So, if you're using DESTDIR, then it will always decide that you're using the /etc/pam.conf scheme. If you are using that scheme, then everythings fine. However if you're using the /etc/pam.d scheme, then you need to execute the following command prior to running make install:

install -dv <DESTDIR>/etc/pam.d
This simple fix makes it so that Fcron's script detects that you're using the /etc/pam.d scheme. With this, DESTDIR works as expected.

Non-Multilib

Compile the package:

./configure --prefix=/usr --sysconfdir=/etc \
    --localstatedir=/var --with-boot-install=no \
     --without-sendmail &&
make

Install the package:

make install

Command Explanations

--without-sendmail: This stops Fcron from e-mailing you the results of the 'fcron script.

--with-boot-install=no: This prevents the installation of the package's bootscript.

Multilib

This package does not provide any libraries so only one installation is needed.

32Bit

Compile the package:

CC="gcc ${BUILD32}" ./configure --prefix=/usr \
    --sysconfdir=/etc --localstatedir=/var \
    --with-boot-install=no --without-sendmail &&
make

Install the package:

make install

N32

Compile the package:

CC="gcc ${BUILDN32}" ./configure --prefix=/usr \
    --sysconfdir=/etc --localstatedir=/var \
    --with-boot-install=no --without-sendmail &&
make

Install the package:

make install

64Bit

Compile the package:

CC="gcc ${BUILD64}" ./configure --prefix=/usr \
    --sysconfdir=/etc --localstatedir=/var \
    --with-boot-install=no --without-sendmail &&
make

Install the package:

make install

Configuring

Configuration Files

The files /etc/fcron.conf, /etc/fcron.allow, and /etc/fcron.deny are used to configure fcron behavior.

Configuration Information

fcrontab is used to write fcron scripts. Refer to the man pages for more information.

If Linux-PAM was installed, then two PAM configuration files were installed in /etc/pam.d. However, if there is no /etc/pam.d and you are using /etc/pam.conf instead, then corresponding configuration sections were added to your pam.conf file instead.

Logging Fcron Messages

If you want to Fcron to log its messages, then you need to add it to /etc/syslog.conf.

sed -i 's@# End /etc/syslog.conf@@' /etc/syslog.conf &&
cat >> /etc/syslog.conf << "EOF"
# log Fcron:
cron.*                                          -/var/log/cron.log

# End /etc/syslog.conf
EOF

The large spacing makes it so that it lines up with what's already in /etc/syslog.conf. The sed makes it so that the comment that delineates the end of the file still delineates the end of the file after our addition.

In order to bring our changes into effect, we need to reload the sysklogd daemon:

/etc/rc.d/init.d/sysklogd reload


Boot Script

Bootscripts has a boot script for Fcron. Install it as follows:

make install-fcron

Contents

Installed Programs: fcron, fcrondyn, fcronsighup, fcrontab
Installed Libraries: None
Installed Directory: /usr/share/doc/fcron-3.1.2, /var/spool/fcron

Short Descriptions

fcron is a daemon to execute scheduled tasks.
fcrondyn is a user tool intended to interact with a running fcron daemon. It can, for instance, list user's jobs loaded by fcron, run one of them, renice a running job, send a signal to a running job, etc.
fcronsighup is the program used by fcrontab to tell fcron it should reload its configuration.
fcrontab is the program intended to install, edit, list and remove the tables used by fcron daemon. As fcron internally uses a non-human readable format (this is needed because fcron saves more informations than the user gives, for example the time and date of next execution), the user cannot directly edit their fcrontab (the one used by fcron).
Retrieved from "?title=Fcron&oldid=13249"