Results 1 to 7 of 7
I can not sudo, it MUST be root to start the needed services
Here are the commands I have a script executing:
./opt/WebSphere/AppServer/bin/startServer.sh server1
#######
./opt/WebSphere/AppServer/bin/startServer.sh icmrm
######
./opt/WebSphere/AppServer/bin/startServer.sh eClient_Server
...
- 10-30-2007 #1Linux Newbie
- Join Date
- Jun 2006
- Posts
- 139
Need to set root env in a script
I can not sudo, it MUST be root to start the needed services
Here are the commands I have a script executing:
./opt/WebSphere/AppServer/bin/startServer.sh server1
#######
./opt/WebSphere/AppServer/bin/startServer.sh icmrm
######
./opt/WebSphere/AppServer/bin/startServer.sh eClient_Server
#
#####
./etc/rc.cmrmproc -act start
####
./opt/IBMHttpServer/bin/apachectl restart
I keep getting
No such file or directory evertime I execute.
This is driving me batty
thanks
Mace
- 10-30-2007 #2
If you're getting an error message, that it's possible for this script to send output to the screen.
So sprinkle unique echo statements through the script, like this:
If you never see any of those xxx messages, you know it's probably the script itself that can't be found.Code:/bin/echo xxx1 ./opt/WebSphere/AppServer/bin/startServer.sh server1 /bin/echo xxx2 ####### ./opt/WebSphere/AppServer/bin/startServer.sh icmrm /bin/echo xxx3 ###### ./opt/WebSphere/AppServer/bin/startServer.sh eClient_Server /bin/echo xxx4 # ##### ./etc/rc.cmrmproc -act start /bin/echo xxx5 #### ./opt/IBMHttpServer/bin/apachectl restart /bin/echo xxx6
If you see the xxx messages, you can tell which command in that script is being executed when the error message occurs.
Hope this gets you on the right track.
- 10-30-2007 #3Linux Newbie
- Join Date
- Jun 2006
- Posts
- 139
I'll do that, I forgot to mention that this is run through cron. I can execute the scripts manually as root and it works but cron is killing me
thanks
Mace
- 10-30-2007 #4Linux Newbie
- Join Date
- Jun 2006
- Posts
- 139
results are:
xxx2
/opt/scripts/cmsanddb2up.sh: line 6: ./opt/WebSphere/AppServer/bin/startServer.sh: No such file or directory
xxx3
/opt/scripts/cmsanddb2up.sh: line 9: ./opt/WebSphere/AppServer/bin/startServer.sh: No such file or directory
xxx4
/opt/scripts/cmsanddb2up.sh: line 12: ./opt/WebSphere/AppServer/bin/startServer.sh: No such file or directory
xxx5
/opt/scripts/cmsanddb2up.sh: line 15: ./etc/rc.cmrmproc: No such file or directory
xxx6
/opt/scripts/cmsanddb2up.sh: line 18: ./opt/IBMHttpServer/bin/apachectl: No such file or directory
FYI cmsanddb2.sh is started by a script where I tried to su to root, it looks like this:
su root -c /opt/scripts/cmsanddb2up.sh
thanks
Mace
- 10-30-2007 #5What are those periods doing in there?Code:
./opt/WebSphere/AppServer/bin/startServer.sh server1 ####### ./opt/WebSphere/AppServer/bin/startServer.sh icmrm ###### ./opt/WebSphere/AppServer/bin/startServer.sh eClient_Server # ##### ./etc/rc.cmrmproc -act start
They indicate that these files are relative to your current directory. But you have no current directory while you're in a cron job. So you need to spell out the full path names, starting with /.
Unless you know otherwise, you should probably remove those periods.
- 10-30-2007 #6Linux Newbie
- Join Date
- Jun 2006
- Posts
- 139
removing the period worked the services "came" up but we are still unable to access db2 from the was server frontend. we can get to db2 through a backdoor , so it isn't db2 having the problem.
If I bring everthing down and run the script from a command line as root it will work
thanks
Mace
- 10-30-2007 #7What happens when you try? What error messages do you get? Don't paraphrase the messages; copy and paste into a reply.we are still unable to access db2 from the was server frontend


Reply With Quote