summaryrefslogtreecommitdiff
blob: 2e41089189772f1ab249b441280d738c28ed4e54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/sbin/openrc-run
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

depend() {
	need net
	# In order to properly support this (need vs use), we would have to
	# parse ${MEDIATOMB_CONFIG} and see if mysql is enabled and if it is
	# pointing to the local system.  #368409
	use mysql
}

start() {
	ebegin "Starting MediaTomb"
	start-stop-daemon --start --quiet --exec /usr/bin/mediatomb \
		--pidfile ${MEDIATOMB_PIDFILE} -- --daemon \
		--pidfile ${MEDIATOMB_PIDFILE} --user ${MEDIATOMB_USER} \
		--group ${MEDIATOMB_GROUP} --logfile ${MEDIATOMB_LOGFILE} \
		--config ${MEDIATOMB_CONFIG} --port ${MEDIATOMB_PORT} \
		${MEDIATOMB_OPTIONS}
	eend $?
}

stop () {
	ebegin "Stopping MediaTomb"
	start-stop-daemon --stop --retry 10 --quiet --pidfile ${MEDIATOMB_PIDFILE}
	eend $?
}