Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Need help on tomcat restart via cronjob

by derby (Abbot)
on Oct 30, 2013 at 10:27 UTC ( #1060315=note: print w/replies, xml ) Need Help??


in reply to Need help on tomcat restart via cronjob

Probably not a perl problem but either a sudo permission problem or an environment variable problem.

  • What account is kicking off the crontab? A users or roots? If a user, does that user have sudo permissions -- if it's roots crontab, you don't need to sudo at all.
  • There may be environment variables (JAVA_HOME and PATH come to mind) that are set when you kick off from the command line but are not present in the cron environment. Tomcat (catalina.sh) will invoke the setenv.sh script in order to set environment variables. By default that script is either blank or not there. Just create it and and your needed env settings there.

-derby
  • Comment on Re: Need help on tomcat restart via cronjob

Replies are listed 'Best First'.
Re^2: Need help on tomcat restart via cronjob
by SriniK (Beadle) on Oct 30, 2013 at 10:46 UTC
    I am running the script from root user the below are the evs from the script
    HOME : /root CVS_RSH : ssh DISPLAY : :99 LESSOPEN : |/usr/bin/lesspipe.sh MAIL : /var/spool/mail/root PWD : /root LANG : en_US.UTF-8 USER : root G_BROKEN_F: 1 LOGNAME : root SHLVL : 2 HOSTNAME : ***.****.****.** JAVA : /usr/bin/ _ : /bin/env PATH : /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/b +in:/root/bin SHELL : /bin/sh HISTSIZE : 1000 HISTCONTRO: ignoredups

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1060315]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2022-01-25 00:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (65 votes). Check out past polls.

    Notices?