How to install the cron on DSL


Forum: User Feedback
Topic: How to install the cron on DSL
started by: kennyfung

Posted by kennyfung on Oct. 29 2004,02:12
Hi,
   I have a problem. I use dpkg-restore and apt-get install cron. I have successful to download cron but it cannot install at DSL. Some error message show on the display" Error ...(2)".
It exits the installation process. I found that the cron install on the subdirectory. Also I found the link redirect to /KNOPPIX/etc...". But I try to run the cron command. It promises that the cron.cfg read only file. Anybody can help me solve the problem? I want to use the DSL to build a control system. I need to schedule some job to process at different timeslot.

Posted by AwPhuch on Oct. 29 2004,04:20
Cron is already built into it

/etc/crontab...just edit that

Brian
AwPhuch

Posted by clacker on Oct. 29 2004,15:04
Kennyfung, are you trying to install cron from the liveCD or the hard drive?  I just tried it from the liveCD (0.8.3) and I got the same errors you did.  You need to add back the function xargs.  Can you run the gnu-util dsl on a hard drive install?  or apt-get the necessary files.  This is all you need to do for the hard drive install.

The second error was a liveCD only error and was due to the fact that cron needs to add a group, but dsl doesn't let you add users and groups by default.  If you are running from the live cd, my suggestion would be to use my adduser.sh script.
DO NOT RUN THIS SCRIPT FROM A HARD DRIVE INSTALL, YOU DO NOT NEED IT

Code Sample
#!/bin/bash
rm /etc/passwd-
rm -f /etc/passwd.org
cp /KNOPPIX/etc/passwd- /etc/passwd-
cp /KNOPPIX/etc/passwd.org /etc/passwd.org
rm -f /etc/gshadow
rm -f /etc/gshadow-
rm -f /etc/shadow.org
cp /KNOPPIX/etc/gshadow /etc/gshadow
cp /KNOPPIX/etc/gshadow- /etc/gshadow-
cp /KNOPPIX/etc/shadow.org /etc/shadow.org
rm -f /etc/group-
rm -f /etc/group.org
cp /KNOPPIX/etc/group- /etc/group-
cp /KNOPPIX/etc/group.org /etc/group.org


As far as using cron from the liveCD after apt-getting it, you need to start it up first.  I just typed /etc/init.d/cron start to do that (you only need to do that if you're on the liveCD or you just loaded cron, check to see if it's already running with ps -ax).  No error and you can see it running with a ps -ax command.  Now set a system variable so that cron knows which editor to use.  From a bash shell type:

export VISUAL=scite

to use scite as your crontab editor.  You could use any editor you want, I like scite myself.  Now edit a crontab file by typing crontab -e  Here is an example crontab file that appends the current time to a file every minute:

Code Sample
# minute (0-59 or *)
# hour (0-23 or *)
# day (1-31 or *)
# month (1-12 or *)
# day of week (0-6 6=Sunday)
* * * * * date >> /home/dsl/crontest



view your crontab file using crontab -l  You should be rockin' and rollin'

Posted by kennyfung on Nov. 02 2004,07:06
Hi clacker,
             Thank for your suggestion. I installed the cron successfully. My process is that:
1. cp -Rp /KNOPPIX/* /mnt/hda1/DSL-sys //I copied all the whole system into the system.
2. chroot /mnt/hda1/DSL-sys
3. dpkg-restore
4. apt-get install cron
5 I edit the /etc/crontab file
6. Run cron start ---O.K
I compress the Damnsmall to Live CD. I use Live CD to bootup and run cron start. The following error message shows on screen:
cron: can't open or create /var/run/cron.pid: Read-only file system.
The problem is that it run the /etc/init.d/cron script file. And the file will call the /var/run/cron.pid. This link will route to /KNOPPIX/var/run/crond.pd. This will be accessed the LIVE CD file. It unlike the directory /home. The /home subdirectory will built on the ramdisk. How can I solve the problem. Thanks!

Posted by clacker on Nov. 02 2004,16:49
kennyfung,  I think your problem might be that you tried to run cron during the remstering process.  Leave out your step #6 and you should be fine.  I did the following and my liveCD started up cron without any error:

make a source directory like you did before
move these three files to that directory:
       dsl-dpkg.dsl
       gnu-utils.dsl
       the deb file for cron from debian
chroot source/KNOPPIX    # this was my directory
mount -t proc /proc proc
mydsl-load dsl-dpkg.dsl
mydsl-load gnu-utils.dsl
dpkg -i cron_3.0pl1-86_i386.deb
rm dsl-dpkg.dsl
rm gnu-utils.dsl
rm cron_3.0pl1-86_i386.deb
umount proc
<CTRL> D

you were probably fine with what you did before only you started cron running in the remaster.  It starts on it's own.  don't run it before you boot the remastered disk.  You might be able to use crontab to edit the crontab file, I'm not sure.

Good luck with your project.  Let us know how it goes.

Posted by kennyfung on Nov. 03 2004,13:47
Hi clacker,
             Thank for your suggestion. I tried to following your step to process. Unfortunately, I still fail to use the cron. Some error message showed on the screen. Now I write the process and error message for your reference.

1. chroot /mnt/hda1/DSL-sys
2. mount -t proc /proc proc
3. mydsl-load dsl-dpkg.dsl
4. mydsl-load gnu-utils.dsl
Error: "hda6:Bad access:block 2, count=2 end_request: I/O error... Ext2-fs: unable to read superblock"
5. dpkg -i cron_3.0pli-72-i386.deb
(your version is cron-3.0pl1-86_i386.deb. I only download the cron-30pl1-72-i386.db from "apt-get install cron" command)
Error: "Error: cannot access . dpkg:error processing cron-30pl1-72-i386.deb cannot access archive: No such file or directory Error:were counted while processing cron-30pl1-72-i386.deb"
6. The 4 and 5 step is not successful so I only to complete "rm dsl-dpkg.dsl
7. umount proc
8 <CTRL>D
After the above process, I still remastering process. Error message shows on screen when bootup the  new remastering Live CD.
" starting periodic command scheduler: cron/usr/sbin/cron: couldn't open or create /var/run/crond.pid: Read only file system."
I try to use the "crontab -e" command. An error message appears. "no crontab for root -using an empty one /bin/sh: line 1: /usr/bin/editor: No such file or directory crontab: /usr/bin/editor exited with status 127."

Do you have any suggestion for me to solve the problem? Thanks!

Posted by clacker on Nov. 03 2004,14:25
kennyfung,

A) Are you using dsl 0.8.3?  That's what I used.

B) The error with mydsl-load gnu-utils.dsl shows a problem.  That shouldn't have failed.  Take a look at your error.  It says hda6, but your new root was on hda1.  Was the file you tried to install still on hda6?  You need to make sure all of those installation files are on in your new directory before you change the root (unless you are use apt-get to draw them from the internet).  I've noticed that gnu-utils makes some directoris writable, perhaps that's why I didn't get the error, because your gnu-utils failed.

C) My cron was that number because I changed the word "stable" to "unstable" in /etc/apt/source.list (some things only instal from the unstable packages because of dependancies with dsl).

Here is my whole routine.  I make a source directory on a Linux drive (a windows or Dos drive will not preserve permissions and modes).  so I did:

mkdir source
cp -Rp /KNOPPIX source
cp /wherever/dsl-dpkg.dsl source/KNOPPIX
cp /wherever/gnu-utils.dsl source/KNOPPIX
cp /wherever/cron-3.0pl1-86_i386.deb source/KNOPPIX
chroot source/KNOPPIX
mount -t proc /proc proc
mydsl-load dsl-dpkg.dsl
mydsl-load gnu-utils.dsl
dpkg -i cron_3.0pl1-86_i386.deb
rm dsl-dpkg.dsl
rm gnu-utils.dsl
rm cron_3.0pl1-86_i386.deb
umount proc
<CTRL> D


Then do the rest as you did.  I hope this helps.

Posted by kennyfung on Nov. 04 2004,01:24
Hi clacker,
              I use the dsl version 8 but I am not sure the version is 8... The cron is used apt-get command through the internet to download. I sure that I install all the file at hda1 since I only have one hard disk and cfdisk it with hda1 and one swap partition. Do you install the cron locally? But I will try to following your step to install the cron. Thanks your help!

Posted by somerville32@hotmail.com on Nov. 05 2004,13:39
If you open up Dillo from your desktop it usualy shows the DSL manual (if you have changed it then the file is usaly stored in file:///usr/share/doc/dsl/getting_started.html
(hopes that links works, if not just navigate to /usr/share/doc/dsl/getting_started.html)

At the top in big bold black letters it should say something like:

Getting Started with DSL Version ____ is replaced with the version number :)

Anyhow, I hope that help you determine your version number :)

~Me

Posted by kennyfung on Nov. 13 2004,13:27
Hi clacker,
              I tried to follow your step to build up the cron but I could not find the cron_3.0pl1-86_i386.deb from the Debian. I got the cron-3.0pl1.orig.tar.gz from Debian but I could not use the "make install" to complie it at Linux. Where I can find the dsl-dpkg.dsl ,gnu-utils.dsl and  cron_3.0pl1-86_i386.deb. Could you help me? Thanks!

Posted by clacker on Nov. 14 2004,05:17
kennyfung, look at the < mydsl repository > for dsl-dpkg.dsl and gnu-utils.dsl.  Load them with the mydsl button in emelfm.

Then get cron from the debian website (www.debian.org) < cron page >.  hit the i386 button to download it.

no need to build it, after you download the file, load it with dpkg -i cron_3.0pl1-86_i386.deb (where cronxxxxxx.deb it the file name).

Posted by kennyfung on Nov. 16 2004,04:38
Hi clacker,
             Thank for your help! I followed your step to install the cron. After I built the Damnsmall to LiveCD, I tried to run the adduser.sh and /etc/init.d/cron start. The cron was successfully to run (using the ps -ax). I saw the message that "376 ? s 0:00 /usr/sbin/cron." I typed the command  export VISUAL=scite". There was no error. Next, I used the "crontab -e". The following error message showed on the screen:
no crontab for root -using an empty one.

Gtk-warning** :  cannot open display.
crontab: "scite exited with status 1 "

I boot up the DSL with level 2. I may not use the windows mode editor. How can I solve the problem ? Can you give me any suggestion. Thanks!

Posted by clacker on Nov. 16 2004,18:17
kennyfung,  try export VISUAL=vi or export VISUAL=zile

vi and zile are two text editors that don't require X windows.

You shouldn't have to run addusers.sh or cron to start cron if you added it to the liveCD.  Try restarting and checking before you do anything with ps -ax

Posted by kennyfung on Nov. 17 2004,02:31
Hi clacker,
             Thank for your help. Now, I am successfully to run the cron.
 :D

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.