Remove pidof hack as it was not stable

This commit is contained in:
mpilman 2019-03-02 14:36:55 -08:00 committed by Alex Miller
parent da72306642
commit 51ccdb1c9b
4 changed files with 26 additions and 17 deletions

View File

@ -1,3 +1,3 @@
FROM centos:7
RUN yum install -y yum-utils systemd
RUN yum install -y yum-utils systemd sysvinit-tools

View File

@ -277,7 +277,7 @@ set(CPACK_RPM_SERVER-EL7_PRE_INSTALL_SCRIPT_FILE
${CMAKE_SOURCE_DIR}/packaging/rpm/scripts/preserver.sh)
set(CPACK_RPM_SERVER-EL6_POST_INSTALL_SCRIPT_FILE
${CMAKE_SOURCE_DIR}/packaging/rpm/scripts/postserver.sh)
${CMAKE_SOURCE_DIR}/packaging/rpm/scripts/postserver-el6.sh)
set(CPACK_RPM_SERVER-EL7_POST_INSTALL_SCRIPT_FILE
${CMAKE_SOURCE_DIR}/packaging/rpm/scripts/postserver.sh)

View File

@ -0,0 +1,20 @@
if [ $1 -eq 1 ]; then
if [ ! -f /etc/foundationdb/fdb.cluster ]; then
description=$(LC_CTYPE=C tr -dc A-Za-z0-9 < /dev/urandom | head -c 8)
random_str=$(LC_CTYPE=C tr -dc A-Za-z0-9 < /dev/urandom | head -c 8)
echo $description:$random_str@127.0.0.1:4500 > /etc/foundationdb/fdb.cluster
chown foundationdb:foundationdb /etc/foundationdb/fdb.cluster
chmod 0664 /etc/foundationdb/fdb.cluster
NEWDB=1
fi
/sbin/chkconfig --add foundationdb >/dev/null 2>&1
/sbin/service foundationdb start >/dev/null 2>&1
if [ "$NEWDB" != "" ]; then
/usr/bin/fdbcli -C /etc/foundationdb/fdb.cluster --exec "configure new single memory" --timeout 20 >/dev/null 2>&1
fi
else
/sbin/service foundationdb condrestart >/dev/null 2>&1
fi
exit 0

View File

@ -3,30 +3,19 @@ if [ $1 -eq 1 ]; then
description=$(LC_CTYPE=C tr -dc A-Za-z0-9 < /dev/urandom | head -c 8)
random_str=$(LC_CTYPE=C tr -dc A-Za-z0-9 < /dev/urandom | head -c 8)
echo $description:$random_str@127.0.0.1:4500 > /etc/foundationdb/fdb.cluster
chown foundationdb:foundationdb /etc/foundationdb/fdb.cluster
chown foundationdb:foundationdb /etc/foundationdb/fdb.cluster
chmod 0664 /etc/foundationdb/fdb.cluster
NEWDB=1
fi
if pidof systemd > /dev/null
then
/usr/bin/systemctl enable foundationdb >/dev/null 2>&1
/usr/bin/systemctl start foundationdb >/dev/null 2>&1
else
/sbin/chkconfig --add foundationdb >/dev/null 2>&1
/sbin/service foundationdb start >/dev/null 2>&1
fi
/usr/bin/systemctl enable foundationdb >/dev/null 2>&1
/usr/bin/systemctl start foundationdb >/dev/null 2>&1
if [ "$NEWDB" != "" ]; then
/usr/bin/fdbcli -C /etc/foundationdb/fdb.cluster --exec "configure new single memory" --timeout 20 >/dev/null 2>&1
fi
else
if pidof systemd > /dev/null
then
/usr/bin/systemctl condrestart foundationdb >/dev/null 2>&1
else
/sbin/service foundationdb condrestart >/dev/null 2>&1
fi
/usr/bin/systemctl condrestart foundationdb >/dev/null 2>&1
fi
exit 0