Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-06-2005, 07:57 PM   #1
LQ Newbie
Registered: Mar 2003
Location: Sydney, Australia
Distribution: Red Hat 7.1
Posts: 15

Rep: Reputation: 0
Running Scripts at Boot, via Cron etc

I have a script that stops my Tomcat server, restarts it, and restarts Apache.

It's called /_tomcat_all, and I can run it fine from the command line (as root).

All that's in it is:

/usr/local/apache2/bin/./apachectl restart

I tried to get cron to run this daily, but I get the error message:

/_tomcat_all: /bin/./ No such file or directory
/_tomcat_all: /bin/./ No such file or directory

I have the same sort of errors when I tried to get a script to run during boot, via /etc/rc.d/init.d and the default runlevel /etc/rc.d/rc3.d.

Can anone suggest what might be wrong with this please?


Max Hugen
Old 12-06-2005, 08:17 PM   #2
LQ Guru
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Linux Mint 17, Debian 8
Posts: 7,865

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
"/_tomcat_all: /bin/./ No such file or directory
/_tomcat_all: /bin/./ No such file or directory"

The PATH used by a cron job is pretty skimpy. I suggest that you set the PATH as the first statement in your script, for example:

PATH =$PATH:/bin:/usr/local/apache2/bin/

Steve Stites
Old 12-06-2005, 09:42 PM   #3
LQ Newbie
Registered: Mar 2003
Location: Sydney, Australia
Distribution: Red Hat 7.1
Posts: 15

Original Poster
Rep: Reputation: 0

After specifying the path CATALINA_HOME, it must have progressed to the tomcat shutdown and startup scripts - but since they themselves use other paths such as JAVA_HOME, all this still won't work!

Kinda makes cron a bit useless, it seems. Stumps me how running a shell script can't access the PATH just because it's run via cron.

I certainly don't want to circumvent the PATH by adding it to each and every script running under cron - probably cause myself a major headache in the future if I ever change the 'real' PATH!

Is there any way I can run a script daily that has access to the server's PATH?

Cheers, Max


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
running scripts at boot... thedp SUSE / openSUSE 2 10-17-2005 08:21 AM
running scripts at boot viniosity Ubuntu 3 07-19-2005 08:52 PM
Autostart Samba & Running scripts at boot DocNick Linux - General 5 11-09-2004 05:02 AM
My box hangs when running boot scripts elkrammer Linux - Distributions 5 03-31-2003 07:02 PM
Running scripts at boot time saintt Linux - Software 1 08-09-2002 05:03 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:17 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration