diff --git a/deliverytiersuite/delivery-tier-suite/delivery-tier-distribution/src/main/rootFiles/DTSProductionService.sh b/deliverytiersuite/delivery-tier-suite/delivery-tier-distribution/src/main/rootFiles/DTSProductionService.sh index 1f8adf5e30..6d67432846 100644 --- a/deliverytiersuite/delivery-tier-suite/delivery-tier-distribution/src/main/rootFiles/DTSProductionService.sh +++ b/deliverytiersuite/delivery-tier-suite/delivery-tier-distribution/src/main/rootFiles/DTSProductionService.sh @@ -94,7 +94,7 @@ function removeServiceFromStartup { function removeServiceScript() { echo "Removing files." set -x - rm -f "/etc/init.d/${SERVICE_NAME}" + rm -f "/etc/systemd/${SERVICE_NAME}" rm -f "/etc/default/${SERVICE_NAME}" { set +x; } > /dev/null 2>&1 } @@ -132,13 +132,13 @@ echo ${EXECUTABLE} if [[ $(type -P "service") ]]; then serviceCmd="service ${SERVICE_NAME}" else - serviceCmd="/etc/init.d/${SERVICE_NAME}" + serviceCmd="/etc/systemd/${SERVICE_NAME}" fi echo before uninstall $uninstall if [ "$uninstall" != "true" ]; then - if [ -f "/etc/init.d/${SERVICE_NAME}" ]; then + if [ -f "/etc/systemd/${SERVICE_NAME}" ]; then echo "Service $SERVICE_NAME already installed" exit 1 fi @@ -165,11 +165,11 @@ chown -R "${RX_USER}:${RX_GROUP}" "${rxDir}" echo "Setting up pid folder /var/run${SERVICE_NAME} setting ownership to user=${RX_USER} group=${RX_GROUP}" mkdir -p ${TOMCAT_RUN} chown -R "${RX_USER}:${RX_GROUP}" "${TOMCAT_RUN}" -echo "Copying startup script ${CATALINA_HOME}/bin/catalina.sh /etc/init.d/${SERVICE_NAME}" -sed -e "s/\${PercussionProductionDTS_service}/$SERVICE_NAME/" ${CATALINA_HOME}/bin/catalina.sh >> /etc/init.d/${SERVICE_NAME} -sed -i "3 a CATALINA_HOME=${CATALINA_HOME}" /etc/init.d/${SERVICE_NAME} -sed -i "4 a JAVA_HOME=${JAVA_HOME}" /etc/init.d/${SERVICE_NAME} -chmod 755 "/etc/init.d/${SERVICE_NAME}" +echo "Copying startup script ${CATALINA_HOME}/bin/catalina.sh /etc/systemd/${SERVICE_NAME}" +sed -e "s/\${PercussionProductionDTS_service}/$SERVICE_NAME/" ${CATALINA_HOME}/bin/catalina.sh >> /etc/systemd/${SERVICE_NAME} +sed -i "3 a CATALINA_HOME=${CATALINA_HOME}" /etc/systemd/${SERVICE_NAME} +sed -i "4 a JAVA_HOME=${JAVA_HOME}" /etc/systemd/${SERVICE_NAME} +chmod 755 "/etc/systemd/${SERVICE_NAME}" cat <<-EOF > /etc/default/${SERVICE_NAME} @@ -184,7 +184,7 @@ cat <<-EOF > /etc/default/${SERVICE_NAME} chown -R "${RX_USER}:${RX_GROUP}" "${TOMCAT_RUN}" EOF -echo "Configuration for service ${SERVICE_NAME} in /etc/init.d/${SERVICE_NAME} must reinstall or update if paths change" +echo "Configuration for service ${SERVICE_NAME} in /etc/systemd/${SERVICE_NAME} must reinstall or update if paths change" echo "************" cat /etc/default/${SERVICE_NAME} @@ -203,8 +203,8 @@ elif [[ $(type -P "update-rc.d") ]]; then update-rc.d ${SERVICE_NAME} defaults elif [ -d "/etc/rc2.d" ]; then echo "Fall back to symbolic linking into /etc/rcx.d folders" - ln /etc/init.d/${SERVICE_NAME} /etc/rc2.d/S99${SERVICE_NAME} - ln /etc/init.d/${SERVICE_NAME} /etc/rc0.d/K99${SERVICE_NAME} + ln /etc/systemd/${SERVICE_NAME} /etc/rc2.d/S99${SERVICE_NAME} + ln /etc/systemd/${SERVICE_NAME} /etc/rc0.d/K99${SERVICE_NAME} else echo "Cannot find chkconfig or update-rc.d or /etc/rc2.d to run service on startup consult documentation for alternative" echo ${distVersion} @@ -219,16 +219,16 @@ echo "*************" else #Unistall checkForProductionDTSService -if [ ! -f "/etc/init.d/${SERVICE_NAME}" ]; then - echo "Service $SERVICE_NAME not installed in /etc/init.d/${SERVICE_NAME}" +if [ ! -f "/etc/systemd/${SERVICE_NAME}" ]; then + echo "Service $SERVICE_NAME not installed in /etc/systemd/${SERVICE_NAME}" exit 1 fi -if cat "/etc/init.d/${SERVICE_NAME}" | grep -q "catalina"; then - echo "Found service installed to /etc/init.d/${SERVICE_NAME}" +if cat "/etc/systemd/${SERVICE_NAME}" | grep -q "catalina"; then + echo "Found service installed to /etc/systemd/${SERVICE_NAME}" else - cat "/etc/init.d/${SERVICE_NAME}" | grep -q "catalina" - echo "Service installed to /etc/init.d/${SERVICE_NAME} is not a Percussion Production DTS service" + cat "/etc/systemd/${SERVICE_NAME}" | grep -q "catalina" + echo "Service installed to /etc/systemd/${SERVICE_NAME} is not a Percussion Production DTS service" exit 1 fi diff --git a/deliverytiersuite/delivery-tier-suite/delivery-tier-distribution/src/main/rootFiles/DTSStagingService.sh b/deliverytiersuite/delivery-tier-suite/delivery-tier-distribution/src/main/rootFiles/DTSStagingService.sh index 711ad0932e..74f809415c 100644 --- a/deliverytiersuite/delivery-tier-suite/delivery-tier-distribution/src/main/rootFiles/DTSStagingService.sh +++ b/deliverytiersuite/delivery-tier-suite/delivery-tier-distribution/src/main/rootFiles/DTSStagingService.sh @@ -94,7 +94,7 @@ function removeServiceFromStartup { function removeServiceScript() { echo "Removing files." set -x - rm -f "/etc/init.d/${SERVICE_NAME}" + rm -f "/etc/systemd/${SERVICE_NAME}" rm -f "/etc/default/${SERVICE_NAME}" { set +x; } > /dev/null 2>&1 } @@ -130,13 +130,13 @@ echo ${EXECUTABLE} if [[ $(type -P "service") ]]; then serviceCmd="service ${SERVICE_NAME}" else - serviceCmd="/etc/init.d/${SERVICE_NAME}" + serviceCmd="/etc/systemd/${SERVICE_NAME}" fi echo before uninstall $uninstall if [ "$uninstall" != "true" ]; then - if [ -f "/etc/init.d/${SERVICE_NAME}" ]; then + if [ -f "/etc/systemd/${SERVICE_NAME}" ]; then echo "Service $SERVICE_NAME already installed" exit 1 fi @@ -164,11 +164,11 @@ chown -R "${RX_USER}:${RX_GROUP}" "${rxDir}" echo "Setting up pid folder /var/run/${SERVICE_NAME} setting ownership to user=${RX_USER} group=${RX_GROUP}" mkdir -p ${TOMCAT_RUN} chown -R "${RX_USER}:${RX_GROUP}" "${TOMCAT_RUN}" -echo "Copying startup script ${CATALINA_HOME}/bin/catalina.sh /etc/init.d/${SERVICE_NAME}" -sed -e "s/\${PercussionStagingDTS_service}/$SERVICE_NAME/" ${CATALINA_HOME}/bin/catalina.sh >> /etc/init.d/${SERVICE_NAME} -sed -i "3 a CATALINA_HOME=${CATALINA_HOME}" /etc/init.d/${SERVICE_NAME} -sed -i "4 a JAVA_HOME=${JAVA_HOME}" /etc/init.d/${SERVICE_NAME} -chmod 755 "/etc/init.d/${SERVICE_NAME}" +echo "Copying startup script ${CATALINA_HOME}/bin/catalina.sh /etc/systemd/${SERVICE_NAME}" +sed -e "s/\${PercussionStagingDTS_service}/$SERVICE_NAME/" ${CATALINA_HOME}/bin/catalina.sh >> /etc/systemd/${SERVICE_NAME} +sed -i "3 a CATALINA_HOME=${CATALINA_HOME}" /etc/systemd/${SERVICE_NAME} +sed -i "4 a JAVA_HOME=${JAVA_HOME}" /etc/systemd/${SERVICE_NAME} +chmod 755 "/etc/systemd/${SERVICE_NAME}" cat <<-EOF > /etc/default/${SERVICE_NAME} @@ -179,7 +179,7 @@ cat <<-EOF > /etc/default/${SERVICE_NAME} CATALINA_PID="${TOMCAT_RUN}/PercussionStagingDTS.pid" EOF -echo "Configuration for service ${SERVICE_NAME} in /etc/init.d/${SERVICE_NAME} must reinstall or update if paths change" +echo "Configuration for service ${SERVICE_NAME} in /etc/systemd/${SERVICE_NAME} must reinstall or update if paths change" echo "************" cat /etc/default/${SERVICE_NAME} @@ -198,8 +198,8 @@ elif [[ $(type -P "update-rc.d") ]]; then update-rc.d ${SERVICE_NAME} defaults elif [ -d "/etc/rc2.d" ]; then echo "Fall back to symbolic linking into /etc/rcx.d folders" - ln /etc/init.d/${SERVICE_NAME} /etc/rc2.d/S99${SERVICE_NAME} - ln /etc/init.d/${SERVICE_NAME} /etc/rc0.d/K99${SERVICE_NAME} + ln /etc/systemd/${SERVICE_NAME} /etc/rc2.d/S99${SERVICE_NAME} + ln /etc/systemd/${SERVICE_NAME} /etc/rc0.d/K99${SERVICE_NAME} else echo "Cannot find chkconfig or update-rc.d or /etc/rc2.d to run service on startup consult documentation for alternative" echo ${distVersion} @@ -214,16 +214,16 @@ echo "*************" else #Uninstall checkForStagingDTSService -if [ ! -f "/etc/init.d/${SERVICE_NAME}" ]; then - echo "Service $SERVICE_NAME not installed in /etc/init.d/${SERVICE_NAME}" +if [ ! -f "/etc/systemd/${SERVICE_NAME}" ]; then + echo "Service $SERVICE_NAME not installed in /etc/systemd/${SERVICE_NAME}" exit 1 fi -if cat "/etc/init.d/${SERVICE_NAME}" | grep -q "catalina"; then - echo "Found service installed to /etc/init.d/${SERVICE_NAME}" +if cat "/etc/systemd/${SERVICE_NAME}" | grep -q "catalina"; then + echo "Found service installed to /etc/systemd/${SERVICE_NAME}" else - cat "/etc/init.d/${SERVICE_NAME}" | grep -q "catalina" - echo "Service installed to /etc/init.d/${SERVICE_NAME} is not a Percussion Staging DTS service" + cat "/etc/systemd/${SERVICE_NAME}" | grep -q "catalina" + echo "Service installed to /etc/systemd/${SERVICE_NAME} is not a Percussion Staging DTS service" exit 1 fi diff --git a/system/Tools/jetty/service/install-jetty-service.sh b/system/Tools/jetty/service/install-jetty-service.sh index 05be7565f2..2d68f974cc 100644 --- a/system/Tools/jetty/service/install-jetty-service.sh +++ b/system/Tools/jetty/service/install-jetty-service.sh @@ -45,17 +45,17 @@ function checkForJbossService() { while read -r line; do service=$(basename ${line}) echo "Found JBoss service $service in $line" - serviceHome=$(grep "^SERVER_DIR=" /etc/init.d/${service} | cut -d "=" -f 2) + serviceHome=$(grep "^SERVER_DIR=" /etc/systemd/${service} | cut -d "=" -f 2) echo $serviceHome if [ "$serviceHome" == "$rxDir" ]; then currentService=$service fi - done < <(grep -l /etc/init.d/* -e 'RhythmyxD') + done < <(grep -l /etc/systemd/* -e 'RhythmyxD') if [ ! -z "$currentService" ]; then if [ "$cleanupJBoss" != "true" ]; then - echo "Warning Jboss startup /etc/init.d/${currentService} for this instance ${rxDir} exists use to remove" + echo "Warning Jboss startup /etc/systemd/${currentService} for this instance ${rxDir} exists use to remove" usage fi echo "Cleaning up JBoss init scripts" @@ -96,7 +96,7 @@ function removeServiceScript() { echo "removing files" set -x - rm -f "/etc/init.d/${1}" + rm -f "/etc/systemd/${1}" rm -f "/etc/default/${1}" rm -rf "$JETTY_RUN" rm -f "$JETTY_BASE/${SERVICE_NAME}.state" @@ -121,14 +121,14 @@ JETTY_RUN=/var/run/rxjetty/${SERVICE_NAME} if [[ $(type -P "service") ]]; then serviceCmd="service ${SERVICE_NAME}" else - serviceCmd="/etc/init.d/${SERVICE_NAME}" + serviceCmd="/etc/systemd/${SERVICE_NAME}" fi echo before uninstall $uninstall if [ "$uninstall" != "true" ];then echo in uninstall - if [ -f "/etc/init.d/${SERVICE_NAME}" ];then + if [ -f "/etc/systemd/${SERVICE_NAME}" ];then echo "Service $SERVICE_NAME already installed" exit 1 fi @@ -176,10 +176,10 @@ echo in uninstall chown -R "${RX_USER}:${RX_GROUP}" "${JETTY_RUN}" chmod -R ugo+rw /var/run/rxjetty/${SERVICE_NAME} - echo "copying startup script ${JETTY_DEFAULTS}/bin/jetty.sh /etc/init.d/${SERVICE_NAME}" + echo "copying startup script ${JETTY_DEFAULTS}/bin/jetty.sh /etc/systemd/${SERVICE_NAME}" - sed -e "s/\${rxjetty_service}/$SERVICE_NAME/" ${JETTY_DEFAULTS}/bin/rxjetty.sh > /etc/init.d/${SERVICE_NAME} - chmod 755 "/etc/init.d/${SERVICE_NAME}" + sed -e "s/\${rxjetty_service}/$SERVICE_NAME/" ${JETTY_DEFAULTS}/bin/rxjetty.sh > /etc/systemd/${SERVICE_NAME} + chmod 755 "/etc/systemd/${SERVICE_NAME}" cat <<-EOF > /etc/default/${SERVICE_NAME} JAVA_HOME=${JAVA_HOME} @@ -199,7 +199,7 @@ echo in uninstall chmod -R ugo+rw /var/run/rxjetty/${SERVICE_NAME} EOF - echo "configuration for service ${SERVICE_NAME} in /etc/init.d/${SERVICE_NAME} must reinstall or update if paths change" + echo "configuration for service ${SERVICE_NAME} in /etc/systemd/${SERVICE_NAME} must reinstall or update if paths change" echo "**********" cat /etc/default/${SERVICE_NAME} @@ -220,8 +220,8 @@ EOF update-rc.d ${SERVICE_NAME} defaults elif [ -d "/etc/rc2.d" ]; then echo "Fall back to symbolic linking into /etc/rcx.d folders e.g. Solaris 9" - ln /etc/init.d/${SERVICE_NAME} /etc/rc2.d/S99${SERVICE_NAME} - ln /etc/init.d/${SERVICE_NAME} /etc/rc0.d/K99${SERVICE_NAME} + ln /etc/systemd/${SERVICE_NAME} /etc/rc2.d/S99${SERVICE_NAME} + ln /etc/systemd/${SERVICE_NAME} /etc/rc0.d/K99${SERVICE_NAME} else echo "Cannot find chkconfig or update-rc.d or /etc/rc2.d to run service on startup consult documentation on alternatives for your distro" echo ${distVersion} @@ -237,16 +237,16 @@ else # Uninstall echo checking for jetty service checkForJettyService - if [ ! -f "/etc/init.d/${SERVICE_NAME}" ];then - echo "Service $SERVICE_NAME not installed in /etc/init.d/${SERVICE_NAME}" + if [ ! -f "/etc/systemd/${SERVICE_NAME}" ];then + echo "Service $SERVICE_NAME not installed in /etc/systemd/${SERVICE_NAME}" exit 1 fi - if cat "/etc/init.d/${SERVICE_NAME}" | grep -q "jetty"; then - echo "Found service installed to /etc/init.d/${SERVICE_NAME}" + if cat "/etc/systemd/${SERVICE_NAME}" | grep -q "jetty"; then + echo "Found service installed to /etc/systemd/${SERVICE_NAME}" else - cat "/etc/init.d/${SERVICE_NAME}" | grep -q "jetty" - echo "Service installed to /etc/init.d/${SERVICE_NAME} is not a Rhythmyx Jetty Service" + cat "/etc/systemd/${SERVICE_NAME}" | grep -q "jetty" + echo "Service installed to /etc/systemd/${SERVICE_NAME} is not a Rhythmyx Jetty Service" exit 1 fi if ${serviceCmd} status | grep "Jetty running" ; then