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.
21 lines
715 B
21 lines
715 B
#!/sbin/openrc-run
|
|
# Copyright 1999-2014 Gentoo Foundation
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
command=/usr/bin/groonga
|
|
command_args="-d --pid-path ${GROONGA_PID:-/run/groonga/groonga.pid} --config-path=${CONFIG_FILE:-/etc/groonga/groonga.conf} ${DATABASE}"
|
|
pidfile="${GROONGA_PID:-/run/groonga/groonga.pid}"
|
|
start_stop_daemon_args="--quiet --user ${GROONGA_USER:-groonga}:${GROONGA_GROUP:-groonga}"
|
|
|
|
depend() {
|
|
use net
|
|
}
|
|
|
|
start_pre() {
|
|
checkpath -d /run/groonga -o ${GROONGA_USER:-groonga}:${GROONGA_GROUP:-groonga}
|
|
if [ ! -e "${DATABASE}" ] ; then
|
|
einfo "Creating database ${DATABASE}"
|
|
su -s /bin/sh -c "/usr/bin/groonga -n ${DATABASE} quit" ${GROONGA_USER:-groonga}
|
|
fi
|
|
}
|