Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on 05-06-2015 10:14 PM - edited 05-06-2015 10:35 PM
Hello All, I am building a custom Service using CSD. I want to install some of the dependencies prior to start the service(just one time) for. example installation of drivers, starting database servers etc. . I am doing that by calling a shell script prior to exec. But the problem is whenever there is a call to start to the service all the pre strart process run again. How can i achieve this.
#!/bin/bash
CMD=$1
case $CMD in
(start)
echo "Starting the MyApp Service"
cp -r /opt/cloudera/parcels/myapp-2.1 /opt/
chmod 777 -R /opt/myapp-2.1/
sh /opt/myapp-2.1/resource/scripts/installer/MainScript
exec python -m SimpleHTTPServer 8080
;;
(stop)
sh /opt/myapp-2.1/resource/scripts/installer/StopAll
;;
(restart)
sh /opt/myapp-2.1/resource/scripts/installer/RestartAll
;;
(*)
echo "Don't understand [$CMD]"
;;
esac
Created 05-07-2015 06:04 PM
Created 05-07-2015 06:04 PM
Created 05-13-2015 03:57 AM
Thanks for the reply. dlo.
It works.