`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)
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() {
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"