diff --git a/build.sh b/build.sh index 8721c83..0f64c11 100755 --- a/build.sh +++ b/build.sh @@ -85,7 +85,7 @@ function build-package () { if [[ ${pkg} == deb ]]; then ADDITIONAL_DEPS="-d augeas-tools -d dos2unix" else - ADDITIONAL_DEPS="-d ruby-augeas -d dos2unix" + ADDITIONAL_DEPS="-d augeas -d dos2unix" fi fpm \ -s dir \ diff --git a/share/avst-app/lib/common/helpers.sh b/share/avst-app/lib/common/helpers.sh index b2f717e..9223e0f 100644 --- a/share/avst-app/lib/common/helpers.sh +++ b/share/avst-app/lib/common/helpers.sh @@ -219,6 +219,8 @@ parse_installed_avst_app_version () { INIT_HOME="${INIT_HOME:-/etc}" if [[ -f "${INIT_HOME}/redhat-release" ]]; then INSTALLED_AVSTAPP_CMD='rpm -qi avst-app' + elif [[ -f "${INIT_HOME}/os-release" ]] && [[ $(grep 'Amazon Linux' /etc/os-release) ]]; then + INSTALLED_AVSTAPP_CMD='rpm -qi avst-app' elif [[ -f "${INIT_HOME}/debian_version" ]]; then INSTALLED_AVSTAPP_CMD='dpkg -s avst-app' else diff --git a/share/avst-app/lib/common/install-service.d/10create_service_manager_file b/share/avst-app/lib/common/install-service.d/10create_service_manager_file index de5474d..daf0833 100755 --- a/share/avst-app/lib/common/install-service.d/10create_service_manager_file +++ b/share/avst-app/lib/common/install-service.d/10create_service_manager_file @@ -19,6 +19,8 @@ SYSTEMD_FILE='systemd.service' if [[ -f "${INIT_HOME}/redhat-release" ]]; then UPSTART_FILE='upstart-redhat.conf' +elif [[ -f "${INIT_HOME}/os-release" ]] && [[ $(grep 'Amazon Linux' /etc/os-release) ]]; then + UPSTART_FILE='upstart-redhat.conf' elif [[ -f "${INIT_HOME}/debian_version" ]]; then UPSTART_FILE='upstart-debian.conf' else diff --git a/share/avst-app/lib/common/install-service.d/20create_init.d_link b/share/avst-app/lib/common/install-service.d/20create_init.d_link index ce4a6c8..c96a949 100755 --- a/share/avst-app/lib/common/install-service.d/20create_init.d_link +++ b/share/avst-app/lib/common/install-service.d/20create_init.d_link @@ -24,6 +24,11 @@ else [[ -L "${INIT_HOME}/init.d/${INSTANCE_NAME}" ]] && rm -f "${INIT_HOME}/init.d/${INSTANCE_NAME}" echo 'initctl $1 $( basename $0 )' > "${INIT_HOME}/init.d/${INSTANCE_NAME}" chmod 755 "${INIT_HOME}/init.d/${INSTANCE_NAME}" + elif [[ -f "${INIT_HOME}/os-release" ]] && [[ $(grep 'Amazon Linux' /etc/os-release) ]]; then + debug "Upstart files for Amazon Linux" + [[ -L "${INIT_HOME}/init.d/${INSTANCE_NAME}" ]] && rm -f "${INIT_HOME}/init.d/${INSTANCE_NAME}" + echo 'initctl $1 $( basename $0 )' > "${INIT_HOME}/init.d/${INSTANCE_NAME}" + chmod 755 "${INIT_HOME}/init.d/${INSTANCE_NAME}" elif [[ -f "${INIT_HOME}/debian_version" ]]; then debug "Upstart files for Debian" ( diff --git a/share/avst-app/lib/common/modify.d/96manual_service b/share/avst-app/lib/common/modify.d/96manual_service index d7d0865..1acc217 100644 --- a/share/avst-app/lib/common/modify.d/96manual_service +++ b/share/avst-app/lib/common/modify.d/96manual_service @@ -46,6 +46,8 @@ else # if a RHEL based system use a second start on stanza as "manual" is not valid if [[ -f /etc/redhat-release ]]; then START_DIRECTIVE="start on never" + elif [[ -f "${INIT_HOME}/os-release" ]] && [[ $(grep 'Amazon Linux' /etc/os-release) ]]; then + START_DIRECTIVE="start on never" else START_DIRECTIVE="manual" fi diff --git a/share/avst-app/lib/product/sonarqube/install-service.d/10create_service_manager_file b/share/avst-app/lib/product/sonarqube/install-service.d/10create_service_manager_file index c23fb28..f39c3cd 100644 --- a/share/avst-app/lib/product/sonarqube/install-service.d/10create_service_manager_file +++ b/share/avst-app/lib/product/sonarqube/install-service.d/10create_service_manager_file @@ -20,6 +20,8 @@ SYSTEMD_HOME="${SYSTEMD_HOME:-/etc/systemd/system/}" SYSTEMD_FILE='sonarqube-systemd.service' if [[ -f "${INIT_HOME}/redhat-release" ]]; then UPSTART_FILE='upstart-redhat.conf' +elif [[ -f "${INIT_HOME}/os-release" ]] && [[ $(grep 'Amazon Linux' /etc/os-release) ]]; then + UPSTART_FILE='upstart-redhat.conf' elif [[ -f "${INIT_HOME}/debian_version" ]]; then UPSTART_FILE='upstart-debian.conf' else diff --git a/share/avst-app/lib/tomcat/start.d/99set_oom_on_redhat b/share/avst-app/lib/tomcat/start.d/99set_oom_on_redhat index 2e58097..e2b6f31 100644 --- a/share/avst-app/lib/tomcat/start.d/99set_oom_on_redhat +++ b/share/avst-app/lib/tomcat/start.d/99set_oom_on_redhat @@ -14,8 +14,10 @@ # limitations under the License. # Try hard not to be killed in Out-Of-Memory situations on RedHat, -# Ubuntu supports this setting inside .conf file +# or Amazon Linux, Ubuntu supports this setting inside .conf file if [[ -f '/etc/redhat-release' ]]; then pgrep -f "${INSTANCE_NAME}" | while read PID; do echo -17 > /proc/$PID/oom_adj; done +elif [[ -f "${INIT_HOME}/os-release" ]] && [[ $(grep 'Amazon Linux' /etc/os-release) ]]; then + pgrep -f "${INSTANCE_NAME}" | while read PID; do echo -17 > /proc/$PID/oom_adj; done fi