mirror of
https://github.com/apple/foundationdb.git
synced 2025-05-14 09:58:50 +08:00
Remove pidof hack as it was not stable
This commit is contained in:
parent
da72306642
commit
51ccdb1c9b
@ -1,3 +1,3 @@
|
||||
FROM centos:7
|
||||
|
||||
RUN yum install -y yum-utils systemd
|
||||
RUN yum install -y yum-utils systemd sysvinit-tools
|
||||
|
@ -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)
|
||||
|
||||
|
20
packaging/rpm/scripts/postserver-el6.sh
Normal file
20
packaging/rpm/scripts/postserver-el6.sh
Normal 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
|
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user