Installing services using bash
I'm having a little trouble trying to install a service on each one of my 48 nodes. I'm very new to bash scripting and it seems pretty easy so far, but I'm I can't get the "chkconfig" to work in my script. I'm hoping someone can look at this and tell me what I'm doing wrong. Here is an example of the part of my script I'm getting errors. Thanks in advance!
################################################## echo "Hello, $USER. Please wait while I install and start Phoenixd on all nodes." echo echo "Starting Job Manager on N2" ssh n2 cp /opt/matlab-beta/toolbox/dml/bin/glnx86/rh_phoenixd /etc/init.d/phoenixd echo "Phoenixd has been installed" ssh n2 /sbin/chkconfig --add /etc/init.d/phoenixd ssh n2 /sbin/chkconfig --level 345 /etc/init.d/phoenixd on echo "Phoenixd sevice has been added to startup" ssh n2 /etc/init.d/phoenixd start ################################################## After I run this little script, I get this error: ################################################## root-root@master% /home/johnston/scripts/matlabnodeinstall Hello, root. Please wait while I install and start Matlab on all nodes. Starting Job Manager on N2 Phoenixd has been installed error reading information on service /etc/init.d/phoenixd: No such file or directory error reading information on service /etc/init.d/phoenixd: No such file or directory root-root@master% ################################################## I've checked and the phoenixd file has been copied over to the /etc/init.d/ folder, so I'm wonder why it's telling me that there is no such file. |
Try wrapping the "cp ... .. " into double quotes ...
The only thing I can really think of. Cheers, Tink |
The copy part is working just fine. When I go to that node and do a ls /etc/init.d, I see the service. So I know that that's OK. What's not working is adding the lines for "chkconfig" and I'm not sure why. I'm not sure why it's failing when I try run that command. I've even tried && it all on one line with the same result.
|
'scuse me if I sound ignorant and uninformed. But: wouldn't it make more sense to establish a symlink to /etc/init.d/phoenixd so that it's there and waiting when the call is made to start it up?
The problem may be a matter of sequencing. Which comes first? Cp the file, or call the file? If it's there as a symlink, sequencing should no longer be a problem. Am I making sense, or just rambling? |
Wow... I'm such a dork... Thank you bigrigdriver. I think you figured out my problem. I will try that first thing in the morning. :)
|
All times are GMT -5. The time now is 07:52 PM. |