mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-29 05:38:00 +00:00
d5fc145b80
- uodate to 2.3 - add possibility to modify heap and stack size
47 lines
951 B
Bash
47 lines
951 B
Bash
#!/bin/sh
|
|
|
|
# PROVIDE: serviio
|
|
# REQUIRE: LOGIN
|
|
# KEYWORD: shutdown
|
|
#
|
|
# Add the following line to /etc/rc.conf[.local] to enable serviio:
|
|
#
|
|
# serviio_enable="YES"
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=serviio
|
|
rcvar=serviio_enable
|
|
command=%%PREFIX%%/sbin/serviiod
|
|
|
|
load_rc_config $name
|
|
|
|
: ${serviio_user="dlna"}
|
|
: ${serviio_heap="512M"}
|
|
: ${serviio_stack="20M"}
|
|
|
|
if [ -n "${serviio_lang}" ]; then
|
|
export LANG=${serviio_lang}
|
|
fi
|
|
|
|
export SERVIIO_MEM="-Xmx${serviio_heap} -Xms${serviio_stack}"
|
|
|
|
_dirs="/var/db/serviio /var/db/serviio/home /var/log/serviio"
|
|
start_precmd="mkdir -p $_dirs; chown $serviio_user $_dirs"
|
|
command_args="$serviio_args &"
|
|
|
|
stop_cmd="$command -stop"
|
|
|
|
status_cmd=${name}_status
|
|
serviio_status() {
|
|
serviio_pid=$(ps -wwwaU ${serviio_user} | awk '/java.*org.serviio.MediaServer/ {print $1}')
|
|
if [ -n "${serviio_pid}" ]; then
|
|
echo "${name} is running as pid ${serviio_pid}"
|
|
else
|
|
echo "${name} is not running"
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
run_rc_command $1
|