Difference between pages "KVM" and "Installing a Cron Daemon"

(Difference between pages)
 
(fill out page)
 
Line 1: Line 1:
 
 
== Introduction ==
 
== 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'''
  
KVM is a hardware-accelerated full-machine hypervisor and virtualization solution included as part of kernel 2.6.20 and later. It allows you to create and start hardware-accelerated virtual machines under Linux using the QEMU tools.
+
== Installation ==
 +
To install the cron daemon, run the following command:
 +
<console>
 +
# ##i## emerge --ask fcron
  
== Kernel Setup ==
+
These are the packages that would be merged, in order:
  
To enable KVM, the following kernel config parameters should be enabled (this is based on a 3.x kernel):
+
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"
  
Under <tt>Processor type and features</tt>, enable <tt>Linux guest support</tt>, and enable the following options:
+
##b## Would you like to merge these packages? [Yes/No]##i## yes
 +
</console>
  
{{kernelop|title=Processor type and features,Linux guest support|desc=
+
Now enable the cron init script so that is starts when your system boots, and enable the cron daemon:
--- Linux guest support
+
[*]  Enable paravirtualization code
+
[ ]    paravirt-ops debugging (NEW)
+
[*]    Paravirtualization layer for spinlocks
+
[ ]    Xen guest support (NEW)
+
[*]  KVM Guest support (including kvmclock) (NEW)
+
[ ]    Enable debug information for KVM Guests in debugfs (NEW)
+
[ ]  Paravirtual steal time accounting (NEW)
+
}}
+
  
 +
<console>
 +
# ##i##rc-update add fcron default
 +
* service fcron added to runlevel default
 +
# ##i##rc
 +
* Caching service dependencies ...              [ ok ]
 +
* Starting fcron ...                            [ ok ]
 +
</console>
  
Under the <tt>Virtualization</tt> category from the main kernel config menu, enable <tt>Kernel-based Virtual Machine (KVM) support</tt>, and enable at least one type of KVM, either for Intel or AMD processors. It is also recommended to enable <tt>Host kernel acceleration for virtio net</tt>.
+
=== System Cron Jobs ===
  
{{kernelop|title=Virtualization|desc=
+
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:
--- Virtualization
+
<M>   Kernel-based Virtual Machine (KVM) support
+
<M>    KVM for Intel processors support
+
<M>    KVM for AMD processors support
+
[*]    KVM legacy PCI device assignment support
+
<M>   Host kernel accelerator for virtio net
+
}}
+
  
 +
* <tt>/etc/cron.hourly</tt>
 +
* <tt>/etc/cron.daily</tt>
 +
* <tt>/etc/cron.weekly</tt>
 +
* <tt>/etc/cron.monthly</tt>
  
You can use modules or build these parts directly into the kernel. Build your new kernel and modules, and reboot.
+
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.
  
== User-space tools ==
+
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 are using QEMU on your desktop, add the following USE flag to <tt>/etc/portage/make.conf</tt>:
+
If you would like to have your system run system cron jobs, use <tt>emerge --config</tt> as specified in the emerge output:
 
+
<pre>
+
USE="$USE usbredir"
+
</pre>
+
This will enable good mouse support for QEMU on your desktop.
+
 
+
Now, emerge qemu:
+
  
 
<console>
 
<console>
# ##i## emerge qemu
+
# ##i##emerge --config sys-process/fcron
</console>
+
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>
  
==Initial Setup==
+
Your cron daemon is now configured to automatically run system cron jobs.
 
+
Prior to using KVM, modprobe the appropriate accelerated driver for Intel or AMD:
+
 
+
<console>
+
# ##i##modprobe kvm_intel
+
</console>
+
  
[[Category:Virtualization]]
+
[[Category:System]]
[[Category:KVM]]
+

Revision as of 21:27, October 19, 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.