diff --git a/gentoo/conf.d/mogilefsd b/gentoo/conf.d/mogilefsd new file mode 100644 index 0000000..b6968d1 --- /dev/null +++ b/gentoo/conf.d/mogilefsd @@ -0,0 +1,3 @@ +PIDFILE="/var/run/mogile/mogilefsd.pid" +MOGILEFSD_OPTS="--daemonize --pidfile=${PIDFILE}" +# vim: ft=gentoo-conf-d: diff --git a/gentoo/conf.d/mogstored b/gentoo/conf.d/mogstored new file mode 100644 index 0000000..aa3cb63 --- /dev/null +++ b/gentoo/conf.d/mogstored @@ -0,0 +1,3 @@ +PIDFILE="/var/run/mogile/mogstored.pid" +MOGSTORED_OPTS="" +# vim: ft=gentoo-conf-d: diff --git a/gentoo/conf/mogilefsd.conf b/gentoo/conf/mogilefsd.conf new file mode 100644 index 0000000..df50e23 --- /dev/null +++ b/gentoo/conf/mogilefsd.conf @@ -0,0 +1,34 @@ +# System user +user = mogile +# These are set inside the Gentoo conf.d/mogilefsd +#pidfile = /var/run/mogile/mogilefsd.pid +#daemonize = 1 + +# Database settings +db_dsn = DBI:mysql:mogilefs +db_user = mogile +# You must insert your password here! +db_pass = __PASSWORD__ + +# Network settings +#conf_port = 7001 +#listen = 10.0.0.1:7001, + +# Storage +#mog_root = /mnt/mogilefs + +# Plugins +#plugins = ... + +# Tuning knobs +#query_jobs = 20 +#delete_jobs = 1 +#replicate_jobs = 1 +#monitor_jobs = 1 +#reaper_jobs = 1 +#min_free_space = 100 +#max_disk_age = 5 +#node_timeout = 2 +#old_repl_compat = 1 +#default_mindevcount = 2 +#no_unreachable_tracking = 1 diff --git a/gentoo/conf/mogstored.conf b/gentoo/conf/mogstored.conf new file mode 100644 index 0000000..100a8c3 --- /dev/null +++ b/gentoo/conf/mogstored.conf @@ -0,0 +1,21 @@ +# These are set inside the Gentoo conf.d/mogilefsd +#pidfile = /var/run/mogile/mogstored.pid +#daemonize = 1 + +# Network settings +#httplisten = 0.0.0.0:7500 +#mgmtlisten = 0.0.0.0:7501 + +# Storage +#docroot = /var/mogdata + +# Server type +# Perlbal is the default +#server = perlbal +# But lighttpd is supported too +#server = lighttpd +#serverbin = /usr/sbin/lighttpd + +# Tuning knobs +#max_conns = 10000 +#opt_iostat 1 diff --git a/gentoo/init.d/mogautomount b/gentoo/init.d/mogautomount new file mode 100644 index 0000000..f287366 --- /dev/null +++ b/gentoo/init.d/mogautomount @@ -0,0 +1,21 @@ +#!/sbin/openrc-run + +NAME="mogautomount" +BINARY="/usr/bin/mogautomount" + +depend() { + use net + before mogstored +} + +start() { + ebegin "Mounting MogileFS disks" + ${BINARY} --chmod-mountpoints + eend $? +} + +stop() { + : +} + +# vim: ft=gentoo-init-d: diff --git a/gentoo/init.d/mogilefsd b/gentoo/init.d/mogilefsd new file mode 100644 index 0000000..062568e --- /dev/null +++ b/gentoo/init.d/mogilefsd @@ -0,0 +1,31 @@ +#!/sbin/openrc-run + +NAME="mogilefsd" +BINARY="/usr/bin/mogilefsd" +MOGILE_UID="mogile" +MOGILE_GID="mogile" + +depend() { + use net mysql postgresql + after mysql postgresql +} + +start() { + checkpath --directory \ + --owner "${MOGILE_UID}:${MOGILE_GID}" \ + --mode 700 \ + "$(dirname $PIDFILE)" + ebegin "Starting $NAME" + start-stop-daemon --chuid ${MOGILE_UID}:${MOGILE_GID} --start \ + --pidfile ${PIDFILE} --exec ${BINARY} \ + -- ${MOGILEFSD_OPTS} + eend $? +} + +stop() { + ebegin "Stopping $NAME" + start-stop-daemon --stop --quiet --pidfile="${PIDFILE}" + eend $? +} + +# vim: ft=gentoo-init-d noet: diff --git a/gentoo/init.d/mogstored b/gentoo/init.d/mogstored new file mode 100644 index 0000000..d28a853 --- /dev/null +++ b/gentoo/init.d/mogstored @@ -0,0 +1,29 @@ +#!/sbin/openrc-run + +NAME="mogstored" +BINARY="/usr/bin/mogstored" +MOGILE_UID="mogile" +MOGILE_GID="mogile" + +depend() { + use net logger + before mogilefsd + need mogautomount +} + +start() { + install -o $MOGILE_UID -g $MOGILE_GID -d $(dirname $PIDFILE) + ebegin "Starting $NAME" + start-stop-daemon --start --quiet \ + --pidfile=${PIDFILE} --exec ${BINARY} \ + -- --daemonize --pidfile=${PIDFILE} ${MOGSTORED_OPTS} + eend $? +} + +stop() { + ebegin "Stopping $NAME" + start-stop-daemon --stop --quiet --pidfile="${PIDFILE}" + eend $? +} + +# vim: ft=gentoo-init-d: