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
05-07-2015 06:04 PM