summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Truschnigg <johannes@truschnigg.info>2019-04-27 18:13:44 +0200
committermax ulidtko <ulidtko@gmail.com>2019-11-19 18:55:44 +0200
commitec5681f0f1e6df237c6b5e650317d52183bc19b7 (patch)
tree7298598e98cbaccca864ee48f4cdc041c78f721b
parent5bbc112fb183a4e9b38ebf86535a52784d5b03ff (diff)
downloadredis-ec5681f0f1e6df237c6b5e650317d52183bc19b7.tar.gz
Do not install SysV init-scripts on systemd-enabled hosts
Also, hint at example service unit files if systemd is detected. Thanks to @mika for spotting a bug in the original iteration of this patch.
-rwxr-xr-xutils/install_server.sh10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils/install_server.sh b/utils/install_server.sh
index 8e5753bc6..efda7da1c 100755
--- a/utils/install_server.sh
+++ b/utils/install_server.sh
@@ -73,6 +73,16 @@ if [ "$(id -u)" -ne 0 ] ; then
exit 1
fi
+#bail if this system is managed by systemd
+_pid_1_exe="$(readlink -f /proc/1/exe)"
+if [ "${_pid_1_exe##*/}" = systemd ]
+then
+ echo "This systems seems to use systemd."
+ echo "Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!"
+ exit 1
+fi
+unset _pid_1_exe
+
if ! echo $REDIS_PORT | egrep -q '^[0-9]+$' ; then
_MANUAL_EXECUTION=true
#Read the redis port