Skip to content

Commit ec5681f

Browse files
jtruulidtko
authored andcommitted
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.
1 parent 5bbc112 commit ec5681f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

utils/install_server.sh

+10
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ if [ "$(id -u)" -ne 0 ] ; then
7373
exit 1
7474
fi
7575

76+
#bail if this system is managed by systemd
77+
_pid_1_exe="$(readlink -f /proc/1/exe)"
78+
if [ "${_pid_1_exe##*/}" = systemd ]
79+
then
80+
echo "This systems seems to use systemd."
81+
echo "Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!"
82+
exit 1
83+
fi
84+
unset _pid_1_exe
85+
7686
if ! echo $REDIS_PORT | egrep -q '^[0-9]+$' ; then
7787
_MANUAL_EXECUTION=true
7888
#Read the redis port

0 commit comments

Comments
 (0)