| 1 |
AUTHOR: Sune Molgaard <sune at molgaard.org> |
|---|
| 2 |
|
|---|
| 3 |
DATE: 2004-13-12 |
|---|
| 4 |
|
|---|
| 5 |
LICENSE: Creative Commons Attribution-NonCommercial-ShareAlike License |
|---|
| 6 |
http://creativecommons.org/licenses/by-nc-sa/1.0/ |
|---|
| 7 |
|
|---|
| 8 |
SYNOPSIS: Installing the at daemon. |
|---|
| 9 |
|
|---|
| 10 |
DESCRIPTION: |
|---|
| 11 |
|
|---|
| 12 |
This hint will guide you through installing the at daemon, that facilitates delayed command execution. |
|---|
| 13 |
|
|---|
| 14 |
Attachments: |
|---|
| 15 |
|
|---|
| 16 |
http://www.linuxfromscratch.org/patches/downloads/at/at-3.1.8-fixes-1.patch |
|---|
| 17 |
http://www.linuxfromscratch.org/patches/downloads/at/at-3.1.8-fcron.patch |
|---|
| 18 |
|
|---|
| 19 |
PREREQUISITES: |
|---|
| 20 |
|
|---|
| 21 |
An LFS system and sendmail and fcron from BLFS. |
|---|
| 22 |
|
|---|
| 23 |
HINT: |
|---|
| 24 |
|
|---|
| 25 |
========= |
|---|
| 26 |
CONTENTS: |
|---|
| 27 |
========= |
|---|
| 28 |
|
|---|
| 29 |
1. Introduction |
|---|
| 30 |
2. Package Dependencies |
|---|
| 31 |
3. Package Installation |
|---|
| 32 |
Download the package |
|---|
| 33 |
Patch the package |
|---|
| 34 |
Configure the build |
|---|
| 35 |
Build the package |
|---|
| 36 |
Install the package |
|---|
| 37 |
Install the init script |
|---|
| 38 |
4. Closing |
|---|
| 39 |
|
|---|
| 40 |
================ |
|---|
| 41 |
1. INTRODUCTION: |
|---|
| 42 |
================ |
|---|
| 43 |
|
|---|
| 44 |
The at package facilitates delayed program execution. The original location is no longer available, and the package seems to be maintained by debian now. |
|---|
| 45 |
|
|---|
| 46 |
======================== |
|---|
| 47 |
2. PACKAGE DEPENDENCIES: |
|---|
| 48 |
======================== |
|---|
| 49 |
|
|---|
| 50 |
At seems to depend on an MTA to report failures and such, so installing sendmail as per the BLFS book is recommended. Furthermore, it relies on a cron, and I have made the patch BLFS compliant, so that it relies on fcron. |
|---|
| 51 |
|
|---|
| 52 |
===================== |
|---|
| 53 |
PACKAGE INSTALLATION: |
|---|
| 54 |
===================== |
|---|
| 55 |
|
|---|
| 56 |
--------------------- |
|---|
| 57 |
Download the package: |
|---|
| 58 |
--------------------- |
|---|
| 59 |
|
|---|
| 60 |
At seems to be maintained by debian now, so download the package from: |
|---|
| 61 |
|
|---|
| 62 |
ftp://ftp.debian.org/debian/pool/main/a/at/at_3.1.8-11.tar.gz |
|---|
| 63 |
|
|---|
| 64 |
----------------- |
|---|
| 65 |
Patch the package |
|---|
| 66 |
----------------- |
|---|
| 67 |
|
|---|
| 68 |
patch -Np1 -i ../at-3.1.8-fixes-1.patch |
|---|
| 69 |
patch -Np1 -i ../at-3.1.8-fcron.patch |
|---|
| 70 |
|
|---|
| 71 |
-------------------- |
|---|
| 72 |
Configure the build: |
|---|
| 73 |
-------------------- |
|---|
| 74 |
|
|---|
| 75 |
The values presented here are based on a relatively clean LFS/BLFS build, and should thus be appropriate for most. However, you may want to consult ./configure --help. |
|---|
| 76 |
|
|---|
| 77 |
./configure --prefix=/usr --with-daemon_username=nobody --with-daemon_groupname=nogroup |
|---|
| 78 |
|
|---|
| 79 |
------------------ |
|---|
| 80 |
Build the package: |
|---|
| 81 |
------------------ |
|---|
| 82 |
|
|---|
| 83 |
make |
|---|
| 84 |
|
|---|
| 85 |
make install |
|---|
| 86 |
|
|---|
| 87 |
chmod 755 /var/spool/fcron |
|---|
| 88 |
|
|---|
| 89 |
------------------------ |
|---|
| 90 |
Install the init script: |
|---|
| 91 |
------------------------ |
|---|
| 92 |
|
|---|
| 93 |
cp debian/rc /etc/rc.d/init.d/atd |
|---|
| 94 |
|
|---|
| 95 |
cat > /etc/rc.d/init.d/atd << "EOF" |
|---|
| 96 |
#!/bin/sh |
|---|
| 97 |
# Begin $rc_base/init.d/atd |
|---|
| 98 |
|
|---|
| 99 |
# Based on various other init scripts. |
|---|
| 100 |
# Rewritten by Sune Molgaard - sune@molgaard.org |
|---|
| 101 |
|
|---|
| 102 |
. /etc/sysconfig/rc |
|---|
| 103 |
. $rc_functions |
|---|
| 104 |
|
|---|
| 105 |
case "$1" in |
|---|
| 106 |
|
|---|
| 107 |
start) |
|---|
| 108 |
echo "Starting atd..." |
|---|
| 109 |
loadproc /usr/sbin/atd |
|---|
| 110 |
;; |
|---|
| 111 |
stop) |
|---|
| 112 |
echo "Stopping atd..." |
|---|
| 113 |
killproc atd |
|---|
| 114 |
;; |
|---|
| 115 |
|
|---|
| 116 |
restart) |
|---|
| 117 |
$0 stop |
|---|
| 118 |
sleep 1 |
|---|
| 119 |
$0 start |
|---|
| 120 |
;; |
|---|
| 121 |
|
|---|
| 122 |
status) |
|---|
| 123 |
statusproc atd |
|---|
| 124 |
;; |
|---|
| 125 |
|
|---|
| 126 |
*) |
|---|
| 127 |
echo "Usage: $0 {start|stop|restart|status}" |
|---|
| 128 |
exit 1 |
|---|
| 129 |
;; |
|---|
| 130 |
esac |
|---|
| 131 |
|
|---|
| 132 |
# End $rc_base/init.d/atd |
|---|
| 133 |
EOF |
|---|
| 134 |
|
|---|
| 135 |
chmod 755 /var/spool/fcron |
|---|
| 136 |
|
|---|
| 137 |
ln -s /etc/rc.d/init.d/atd /etc/rc.d/rc0.d/K07atd |
|---|
| 138 |
ln -s /etc/rc.d/init.d/atd /etc/rc.d/rc2.d/S41atd |
|---|
| 139 |
ln -s /etc/rc.d/init.d/atd /etc/rc.d/rc3.d/S41atd |
|---|
| 140 |
ln -s /etc/rc.d/init.d/atd /etc/rc.d/rc4.d/S41atd |
|---|
| 141 |
ln -s /etc/rc.d/init.d/atd /etc/rc.d/rc5.d/S41atd |
|---|
| 142 |
ln -s /etc/rc.d/init.d/atd /etc/rc.d/rc6.d/K07atd |
|---|
| 143 |
|
|---|
| 144 |
-------- |
|---|
| 145 |
CLOSING: |
|---|
| 146 |
-------- |
|---|
| 147 |
|
|---|
| 148 |
I personally use the at package to schedule recordings of TV shows for when I am not at home. It can be used for a multitude of other scenarios where you have to schedule something to run at one specific time and date. |
|---|
| 149 |
|
|---|
| 150 |
CHANGELOG: |
|---|
| 151 |
[2004-12-05] |
|---|
| 152 |
* Initial Release |
|---|
| 153 |
[2004-12-09] |
|---|
| 154 |
* Fixed a few typos... |
|---|
| 155 |
[2004-12-09] |
|---|
| 156 |
Remembered to fill in the "Patch the package" section... |
|---|
| 157 |
[2004-12-13] |
|---|
| 158 |
Another typo fix, and remembered to fill in the date section... |
|---|
| 159 |
[2005-06-13] |
|---|
| 160 |
Became aware of the fixes patch by Jim Gifford. Included it in the |
|---|
| 161 |
hint. Changed link to fcron patch from personal site to lfs site. |
|---|