RE: Cron Job Error!!!! A newbee Request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



HI Brian ,

Thanks for your reply . Indeed the 'env' are different .

From command prompt it is :

PWD=/home/projectdata/Accuweather/Parsers
CATALINA_HOME=/usr/local/tomcat
HOSTNAME=EmbienceInc
CLASSPATH=/usr/local/tomcat/common/lib/xercesImpl.jar:/usr/local/tomcat/common/lib/xml-apis.jar:/usr/local/tomcat/common/lib/xmlParserAPIs.jar:/usr/local/tomcat/servlet/WEB_INF/classes:/usr/local/tomcat/servlet:./:/usr/local/tomcat/common/lib/pg73jdbc2ee.jar:/usr/local/tomcat/common/lib/servlet.jar:/usr/local/tomcat/testapp/WEB-INF/classes:/usr/local/tomcat/testapp:/usr/local/tomcat/classes:
LESSOPEN=|/usr/bin/lesspipe.sh %s
USER=root
MACHTYPE=i386-redhat-linux-gnu
MAIL=/var/spool/mail/root
INPUTRC=/etc/inputrc
BASH_ENV=/root/.bashrc
TOMCAT_HOME=/usr/local/tomcat
LANG=en_US
JAVA_HOME=/usr/java/jdk1.3.1_07
LOGNAME=root
SHLVL=1
SHELL=/bin/bash
USERNAME=root
HOSTTYPE=i386
OSTYPE=linux-gnu
HISTSIZE=1000
HOME=/root
TERM=vt100
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/local/mysql/bin:/usr/local/pgsql/bin:/usr/java/jdk1.3.1_07/bin:/root/bin:/usr/java/jdk1.3.1_07/bin
APACHE_HOME=/usr/local/apache
SSH_TTY=/dev/pts/1
_=/usr/bin/env
OLDPWD=/home/projectdata/Accuweather

The env returned from the cron job is
 
PWD=/
HOSTNAME=EmbienceInc
MACHTYPE=i386-redhat-linux-gnu
MAILTO=root
LOGNAME=root
SHLVL=1
SHELL=/bin/bash
HOSTTYPE=i386
OSTYPE=linux-gnu
HOME=/
TERM=dumb
PATH=/sbin:/bin:/usr/sbin:/usr/bin
_=/usr/bin/env
 
I even tried exporting the classpath in the script. It gives another type of error called "export identifier" not found ..
 
BTW : I agree that this is NOT related to any security issue. I searched the net for Cronjobs and found some post regarding to them at this mailing list. I am sorry if I posted it at a wrong place . I appreciate if you can help me in solving this one..
 
Thanks
Ibrahim



-----Original Message-----
From: security-discuss-bounce@xxxxxxxxxxxxxxxxx
[mailto:security-discuss-bounce@xxxxxxxxxxxxxxxxx]On Behalf Of Brian
Hatch
Sent: Monday, March 10, 2003 4:57 PM
To: security-discuss@xxxxxxxxxxxxxxxxx
Subject: Re: Cron Job Error!!!! A newbee Request




> I have a simple cron job which has the following script
>
...

> When I manually run the command
>
> sh /<path>/currentParser.sh , it executes perfectly . But the same command
> doesn't work from the cron job. It fails to load the classes. It gives the
> following exception
...

Suggest you run

        $ /usr/bin/env

at the command line where things work fine.  Then create a new
temporary cron job entry:

* * * * * /usr/bin/env

which will send you email with the environment you've got when
cron calls things.  (Delete this cron job when done...)

Compare these two environments.  Something is missing from the env
via cron, or perhaps is changed (for example $HOME.)  Make sure you
add any necessary env vars to the script called from cron - you
probably just missed some.

One other possibility that is very unlikely is that the java
program(s) need an actual TTY, but I'd doubt that at this point.


BTW: This doesn't seem to be terribly security related...


--
Brian Hatch                  For every action,
   Systems and                there is an equal
   Security Engineer          and opposite
http://www.ifokr.org/bri/     criticism.

Every message PGP signed


[Index of Archives]     [Fedora Announce]     [Linux Crypto]     [Kernel]     [Netfilter]     [Bugtraq]     [USB]     [Fedora Security]

  Powered by Linux