You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/sys-cluster/ceph/files/ceph.initd-r1

49 lines
901 B

#!/sbin/runscript
ceph_conf="${ceph_conf:-/etc/ceph/ceph.conf}"
extra_commands="reload"
type=${RC_SVCNAME:5:3}
id=${RC_SVCNAME:9}
id=${id:-"0"}
command="/usr/bin/ceph-${type}"
pidfile="/run/ceph/${type}.${id}.pid"
command_args="-i ${id} --pid-file ${pidfile} -c ${ceph_conf}"
depend() {
after net ntpd ntp-client chronyd
before netmount
}
is_type_valid() {
case ${type} in
mon|mds|osd) return 0;;
*) return 1;;
esac
}
start_pre() {
checkpath -d -q $(dirname ${pidfile})
}
start() {
ebegin "Starting Ceph ${type}.${id}"
if ! is_type_valid ;then
eerror "Please give valid Ceph Server Type: mds, mon, osd"
return 1
fi
${command} ${command_args}
eend $?
}
stop() {
ebegin "Stopping Ceph ${type}.${id}"
start-stop-daemon --stop --pidfile ${pidfile}
eend $?
}
reload() {
ebegin "Reloading Ceph ${type}.${id}"
start-stop-daemon --signal 1 --pidfile ${pidfile}
eend $?
}