gentoo gluster startup script

If you’re missing the init script for Gluster, on Gentoo, here’s one.


PIDFILE=/var/run/glusterd.pid

depend() {
need net
before netmount
}

start() {
ebegin "Starting glusterd"
start-stop-daemon --start -q --exec /usr/sbin/glusterd \
--pidfile "${PIDFILE}" --make-pidfile --background \
-- -N
eend $?
}

stop() {
ebegin "Stopping glusterd"
start-stop-daemon --stop -q --pidfile "${PIDFILE}"
eindent

einfo "Unmounting GlusterFS filesystems"
umount -t fuse.glusterfs -a

einfo "Killing remaining GlusterFS processes"
for PID in $(find /var/lib/glusterd/ -type f -name "*.pid" -exec cat {} \;); do
kill "${PID}"
done

eoutdent
eend $?