Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/amazon linux #55

Merged
merged 2 commits into from
Apr 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 2 additions & 0 deletions share/avst-app/lib/common/helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
(
Expand Down
2 changes: 2 additions & 0 deletions share/avst-app/lib/common/modify.d/96manual_service
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion share/avst-app/lib/tomcat/start.d/99set_oom_on_redhat
Original file line number Diff line number Diff line change
Expand Up @@ -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