[xen-tools-discuss] Re: cron popen xen-create-image

Christian Kortenhorst namit at namit.org
Tue Mar 4 15:18:30 CET 2008


On 3/4/08, Steve Kemp <steve at steve.org.uk> wrote:
>
> On Tue Mar 04, 2008 at 04:50:49 +0000, Christian Kortenhorst wrote:
> > Hey just wondering could anyone help me
> > When i run script using cron i get this problem
> > I: Extracting tzdata...
> > I: Extracting util-linux...
> > I: Extracting zlib1g...
> > W: Failure trying to run: chroot /tmp/2tKOOX5txm mount -t proc proc
> /proc
>
>
>   That's a strange one.
>
>   What happens if you run this as a cron-job:
>
>   #!/bin/sh
>   mkdir /tmp/cron.$$
>   moun -t proc proc /tmp/cron.$$

xen:~# ls /tmp/cron.
cron.10000/ cron.9546/  cron.9671/  cron.9732/  cron.9764/  cron.9800/
cron.9835/  cron.9871/  cron.9906/  cron.9966/
cron.8979/  cron.9580/  cron.9682/...

mount | grep cr
proc on /tmp/cron.9724 type proc (rw)
proc on /tmp/cron.9732 type proc (rw)
proc on /tmp/cron.9821 type proc (rw)
....

left it running bit long


syslog just shows this
Mar  4 13:41:01 xen /USR/SBIN/CRON[9614]: (root) CMD (/root/test_cron.sh)

> when just running script, any ideas what can do?
>
>
>   I guess the cron environment is different from the interactive one,
>   google will find lots of posts about that.  I guess you just need to
>   determine which differences are important.  Try dumping the environment
>   in both cases, via env, and seeing how they differ?


the only thing could think of would be the shell or the Path

xen:~# diff intter env_cron
1,7c1,2
< TERM=xterm-color
< SHELL=/bin/bash
< SSH_CLIENT=192.168.10.140 49597 22
< SSH_TTY=/dev/pts/1
< USER=root
< MAIL=/var/mail/root
< PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
---
> SHELL=/bin/sh
> PATH=/usr/bin:/bin
10,11d4
< PS1=\h:\w\$
< SHLVL=1
13c6
< LS_OPTIONS=--color=auto
---
> SHLVL=2
15d7
< SSH_CONNECTION=192.168.10.140 49597 192.168.0.93 22


Steve
>
> --
>
>
>


-- 
CK Computer Solutions
Christian Kortenhorst
+353-(0)87-6183349
+353-(0)1-4966287






More information about the xen-tools-discuss mailing list