From: Vladislav Odintsov Date: Mon, 4 Jul 2016 12:29:22 +0000 (+0300) Subject: init-radosgw: do not use systemd-run in sysvinit X-Git-Tag: v10.2.4~80^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cca589fdb18147ea61e79b8d98b886ef30cd65d5;p=ceph.git init-radosgw: do not use systemd-run in sysvinit `systemd-run` logic in initscripts was introduced because of ticket http://tracker.ceph.com/issues/7627. If we have systemd-based operating system, we should use systemd unit files from systemd directory to start/stop ceph daemons. Otherwise, `daemon()` from `/etc/init.d/functions` on systemd distro starts service in `system.slice` and everything works well. `systemd-run` can not be run on non-systemd distros, so it's not needed on SysV systems. also, ceph-disk is now able to run the "systemctl" to enable and start the ceph-osd, and ceph-deploy is also now playing well with systemd when it comes to ceph-mon and ceph-mds Fixes: http://tracker.ceph.com/issues/16440 Signed-off-by: Vladislav Odintsov (cherry picked from commit 1fd4f92a025e80092b8d08d9b7da2e0b73a52f0f) --- diff --git a/src/init-radosgw b/src/init-radosgw index 0c3782472252..fbb99081753b 100644 --- a/src/init-radosgw +++ b/src/init-radosgw @@ -17,10 +17,6 @@ if [ -x /sbin/start-stop-daemon ]; then else . /etc/rc.d/init.d/functions DEBIAN=0 - - # detect systemd, also check whether the systemd-run binary exists - SYSTEMD_RUN=$(which systemd-run 2>/dev/null) - grep -qs systemd /proc/1/comm || SYSTEMD_RUN="" fi daemon_is_running() { @@ -99,10 +95,8 @@ case "$1" in fi echo "Starting $name..." - if [ $DEBIAN -eq 1 ]; then - start-stop-daemon --start -u $user -x $RADOSGW -p /var/run/ceph/client-$name.pid -- -n $name - elif [ -n "$SYSTEMD_RUN" ]; then - $SYSTEMD_RUN -r su "$user" -c "ulimit -n 32768; $RADOSGW -n $name" + if [ $DEBIAN -eq 1 ]; then + start-stop-daemon --start -u $user -x $RADOSGW -p /var/run/ceph/client-$name.pid -- -n $name else ulimit -n 32768 core_limit=`ceph-conf -n $name 'core file limit'`