Difference between pages "Gentoo Prefix On Mac OS X" and "Installing a Cron Daemon"

From Funtoo
(Difference between pages)
Jump to: navigation, search
 
(fill out page)
 
Line 1: Line 1:
There is a way to install Gentoo so that it runs within Mac OS X. This install method is called "Gentoo Prefix".
+
== Introduction ==
 +
Cron daemons allow you to configure certain tasks to be run at specific times. Installing a cron daemon is a good idea because some packages may assume that you have a cron daemon installed and create jobs to update their databases with a cron daemon. There are several different loggers available to Funtoo users:
 +
* '''Fcron'''
 +
* '''Cronie'''
 +
* '''Vixie-Cron'''
  
There is a handy script you can use to install Gentoo Prefix on any Mac OS X machine.
+
== Installation ==
 +
To install the cron daemon, run the following command:
 +
<console>
 +
# ##i## emerge --ask fcron
  
== Requirements ==
+
These are the packages that would be merged, in order:
  
For Gentoo Prefix installation to work, you must have the Xcode command-line tools installed, so that a compiler toolchain exists. Here are the steps to install the Xcode command-line tools:
+
Calculating dependencies... done!
 +
[ebuild  N    ] sys-process/cronbase-0.3.2-r1
 +
[ebuild  N    ] sys-process/fcron-3.1.2-r2  USE="mta pam readline system-crontab -debug (-selinux)" LINGUAS="-fr"
  
# Install Xcode itself from the Apple Mac OS X install media. If you are using Mac OS Lion, then the Apple App Store has Xcode available. Search for "Xcode" and you will be able to download and install it.
+
##b## Would you like to merge these packages? [Yes/No]##i## yes
# Now, start Xcode.
+
</console>
# Go to the Xcode menu, then Preferences, then the Downloads tab.
+
# Click "Install" next to "Command Line Tools".
+
# You will need to log in with your Apple Developer ID for the download to continue.
+
  
Here's how you do it. As root (<tt>sudo su -</tt>), type:
+
Now enable the cron init script so that is starts when your system boots, and enable the cron daemon:
 
+
The <tt>EPREFIX</tt> variable controls the install location. The default is <tt>~/gentoo</tt>.
+
  
 
<console>
 
<console>
$ ##i##wget http://www.cs.stonybrook.edu/~ryao/prefix-install.sh && chmod u+x ./prefix-install.sh && env MAKEOPTS=-j5 ./prefix-install.sh
+
# ##i##rc-update add fcron default
 +
* service fcron added to runlevel default
 +
# ##i##rc
 +
* Caching service dependencies ...             [ ok ]
 +
* Starting fcron ...                           [ ok ]
 
</console>
 
</console>
  
Bam!
+
=== System Cron Jobs ===
 +
 
 +
After the cron daemon has been emerged, you may see a message to run <tt>emerge --config</tt> to configure your cron daemon to process system cron jobs. System cron jobs are scripts that are installed by various packages into the following directories:
 +
 
 +
* <tt>/etc/cron.hourly</tt>
 +
* <tt>/etc/cron.daily</tt>
 +
* <tt>/etc/cron.weekly</tt>
 +
* <tt>/etc/cron.monthly</tt>
 +
 
 +
For example, you should find a <tt>/etc/cron.daily/man-db</tt> script that is installed by the <tt>man-db</tt> ebuild. This system cron job updates the man cache every day.
 +
 
 +
You may choose to enable your cron daemon so that it runs system cron jobs, or choose not to. Enabling a cron daemon to run system cron jobs will result in a bit more activity on your system, but should ensure that the system runs more optimally most of the time (caching of man pages, etc.)
 +
 
 +
If you would like to have your system run system cron jobs, use <tt>emerge --config</tt> as specified in the emerge output:
 +
 
 +
<console>
 +
# ##i##emerge --config sys-process/fcron
 +
Configuring pkg... * This is going to set up fcron to execute check_system_crontabs. * In this configuration, you're no longer free to edit the systab * at your leisure, at it'll be rewritten the moment the crontabs * are modified.Rebuilding fcron systab.2013-10-19 21:20:38  INFO installing file /tmp/fcrontab.84pova for user systabModifications will be taken into account right now.</console>
  
Now, let's work on Funtoo Prefix :)
+
Your cron daemon is now configured to automatically run system cron jobs.
  
[[Category:Featured]]
+
[[Category:System]]

Revision as of 21:27, 19 October 2013

Introduction

Cron daemons allow you to configure certain tasks to be run at specific times. Installing a cron daemon is a good idea because some packages may assume that you have a cron daemon installed and create jobs to update their databases with a cron daemon. There are several different loggers available to Funtoo users:

  • Fcron
  • Cronie
  • Vixie-Cron

Installation

To install the cron daemon, run the following command:

#  emerge --ask fcron

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] sys-process/cronbase-0.3.2-r1
[ebuild  N     ] sys-process/fcron-3.1.2-r2  USE="mta pam readline system-crontab -debug (-selinux)" LINGUAS="-fr" 

 Would you like to merge these packages? [Yes/No] yes

Now enable the cron init script so that is starts when your system boots, and enable the cron daemon:

# rc-update add fcron default
* service fcron added to runlevel default
# rc
 * Caching service dependencies ...              [ ok ]
 * Starting fcron ...                            [ ok ]

System Cron Jobs

After the cron daemon has been emerged, you may see a message to run emerge --config to configure your cron daemon to process system cron jobs. System cron jobs are scripts that are installed by various packages into the following directories:

  • /etc/cron.hourly
  • /etc/cron.daily
  • /etc/cron.weekly
  • /etc/cron.monthly

For example, you should find a /etc/cron.daily/man-db script that is installed by the man-db ebuild. This system cron job updates the man cache every day.

You may choose to enable your cron daemon so that it runs system cron jobs, or choose not to. Enabling a cron daemon to run system cron jobs will result in a bit more activity on your system, but should ensure that the system runs more optimally most of the time (caching of man pages, etc.)

If you would like to have your system run system cron jobs, use emerge --config as specified in the emerge output:

# emerge --config sys-process/fcron
Configuring pkg... * This is going to set up fcron to execute check_system_crontabs. * In this configuration, you're no longer free to edit the systab * at your leisure, at it'll be rewritten the moment the crontabs * are modified.Rebuilding fcron systab.2013-10-19 21:20:38  INFO installing file /tmp/fcrontab.84pova for user systabModifications will be taken into account right now.

Your cron daemon is now configured to automatically run system cron jobs.