]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
init-radosgw: do not use systemd-run in sysvinit 9873/head
authorVladislav Odintsov <odivlad@gmail.com>
Mon, 4 Jul 2016 12:29:22 +0000 (15:29 +0300)
committerVladislav Odintsov <odivlad@gmail.com>
Wed, 2 Nov 2016 21:20:04 +0000 (00:20 +0300)
`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 <odivlad@gmail.com>
(cherry picked from commit 1fd4f92a025e80092b8d08d9b7da2e0b73a52f0f)

src/init-radosgw

index d320231d9362d45793d0b4e42c55ca4d172ed4f9..24e5f85f02085969e070d8d5c56e789c077020f6 100644 (file)
@@ -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
                 daemon --user="$user" "$RADOSGW -n $name"