pinkbyte-overlay/net-misc/utm5/files/utm5_core

38 lines
1.0 KiB
Plaintext
Raw Permalink Normal View History

#!/sbin/openrc-run
2013-12-25 10:22:08 +04:00
# Copyright 1999-2013 Gentoo Foundation
2011-10-28 17:13:27 +04:00
# Distributed under the terms of the GNU General Public License v2
# $Header: $
check_db_is_running() {
if ! `/etc/init.d/mysql status 2>/dev/null | grep "started" > /dev/null 2>&1 ` ; then
if ! `/etc/init.d/postgresql status 2>/dev/null | grep "started" > /dev/null 2>&1` ; then
ewarn "You have not started neither mysql nor postgresql!"
eerror "Please start anything."
return 1
fi
fi
}
depend() {
after mysql postgresql
}
start() {
check_db_is_running || return 1
ebegin "Starting utm5_core"
2013-12-25 10:22:08 +04:00
export LD_LIBRARY_PATH="/netup/utm5/lib"
start-stop-daemon --start --quiet --make-pidfile --pidfile /run/safe_utm5_core.pid \
2011-10-28 17:13:27 +04:00
--background --exec /netup/utm5/bin/safe_utm5_core -- start
eend $?
}
stop() {
ebegin "Stopping safe_utm5_core"
2013-12-25 10:22:08 +04:00
start-stop-daemon --stop --quiet --signal 9 --pidfile /run/safe_utm5_core.pid
2011-10-28 17:13:27 +04:00
eend $?
ebegin "Stopping utm5_core"
2013-12-25 10:22:08 +04:00
start-stop-daemon --stop --quiet --signal USR1 --pidfile /run/utm5_core.pid
eend $?
2011-10-28 17:13:27 +04:00
}