Index: multimedia/mediabrowser/files/mediabrowser.in =================================================================== --- multimedia/mediabrowser/files/mediabrowser.in (revision 372524) +++ multimedia/mediabrowser/files/mediabrowser.in (working copy) @@ -11,6 +11,14 @@ # # %%PORTNAME%%_enable: Set to YES to enable %%PORTNAME%% # Default: NO +# %%PORTNAME%%_user: The user account used to run the %%PORTNAME%% daemon. +# This is optional, however do not specifically set this to an +# empty string as this will cause the daemon to run as root. +# Default: %%USER%% +# %%PORTNAME%%_group: The group account used to run the %%PORTNAME%% daemon. +# This is optional, however do not specifically set this to an +# empty string as this will cause the daemon to run with group wheel. +# Default: %%GROUP%% # %%PORTNAME%%_data_dir: Directory where %%PORTNAME%% configuration # data is stored. # Default: /var/db/%%PORTNAME%% @@ -21,22 +29,36 @@ load_rc_config $name : ${%%PORTNAME%%_enable:="NO"} +: ${%%PORTNAME%%_user:="%%USER%%"} +: ${%%PORTNAME%%_group:="%%GROUP%%"} : ${%%PORTNAME%%_data_dir:="/var/db/%%PORTNAME%%"} pidfile="/var/run/%%PORTNAME%%.pid" command="/usr/sbin/daemon" procname="%%LOCALBASE%%/bin/mono" -command_args="-f -u %%USER%% -p ${pidfile} ${procname} %%PREFIX%%/lib/mediabrowser/MediaBrowser.Server.Mono.exe -ffmpeg %%LOCALBASE%%/bin/ffmpeg -ffprobe %%LOCALBASE%%/bin/ffprobe -programdata ${%%PORTNAME%%_data_dir}" +command_args="-f -p ${pidfile} ${procname} %%PREFIX%%/lib/mediabrowser/MediaBrowser.Server.Mono.exe -ffmpeg %%LOCALBASE%%/bin/ffmpeg -ffprobe %%LOCALBASE%%/bin/ffprobe -programdata ${%%PORTNAME%%_data_dir}" -start_precmd=mediabrowser_precmd -mediabrowser_precmd() +start_precmd=%%PORTNAME%%_precmd +%%PORTNAME%%_precmd() { - export LC_ALL="C" - export LANG="C" + : ${LC_ALL:="C"} + : ${LANG:="C"} + export LC_ALL + export LANG + if [ ! -e "${pidfile}" ]; then + install -g ${%%PORTNAME%%_group} -o ${%%PORTNAME%%_user} -- /dev/null "${pidfile}"; + fi + if [ ! -d "${%%PORTNAME%%_data_dir}" ]; then - install -d -g %%GROUP%% -o %%GROUP%% "${%%PORTNAME%%_data_dir}"; + install -d -g ${%%PORTNAME%%_group} -o ${%%PORTNAME%%_user} -- "${%%PORTNAME%%_data_dir}"; fi } +stop_postcmd=%%PORTNAME%%_postcmd +%%PORTNAME%%_postcmd() +{ + rm -f -- "${pidfile}" +} + run_rc_command "$1" Index: multimedia/mediabrowser/pkg-deinstall =================================================================== --- multimedia/mediabrowser/pkg-deinstall (revision 0) +++ multimedia/mediabrowser/pkg-deinstall (working copy) @@ -0,0 +1,12 @@ +#!/bin/sh +# $FreeBSD$ +# + +case $2 in + DEINSTALL) + echo "==> If you are uninstalling mediabrowser permanently," + echo " and you do *NOT* want to retain the database, logs" + echo " configuration and media metadata, you should" + echo " manually delete directory /var/db/mediabrowser." + ;; +esac Property changes on: multimedia/mediabrowser/pkg-deinstall ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Index: multimedia/mediabrowser/pkg-message =================================================================== --- multimedia/mediabrowser/pkg-message (revision 372524) +++ multimedia/mediabrowser/pkg-message (working copy) @@ -4,7 +4,7 @@ from ports with the lame support option enabled. To automatically start MediaBrowser at boot time: -# echo 'mediabrowser_enable="YES"' >> /etc/rc.conf +# sysrc mediabrowser_enable="YES" To then manually start MediaBrowser without rebooting: # service mediabrowser start