Lines 11-16
Link Here
|
11 |
# |
11 |
# |
12 |
# %%PORTNAME%%_enable: Set to YES to enable %%PORTNAME%% |
12 |
# %%PORTNAME%%_enable: Set to YES to enable %%PORTNAME%% |
13 |
# Default: NO |
13 |
# Default: NO |
|
|
14 |
# %%PORTNAME%%_user: The user account %%PORTNAME%% daemon runs as. |
15 |
# It uses '%%USER%%' user by default. |
16 |
# Do not sets it as empty or it will run as root. |
17 |
# %%PORTNAME%%_group: The group account %%PORTNAME%% daemon runs as. |
18 |
# It uses '%%GROUP%%' group by default. |
19 |
# Do not sets it as empty or it will run as wheel. |
14 |
# %%PORTNAME%%_data_dir: Directory where %%PORTNAME%% configuration |
20 |
# %%PORTNAME%%_data_dir: Directory where %%PORTNAME%% configuration |
15 |
# data is stored. |
21 |
# data is stored. |
16 |
# Default: /var/db/%%PORTNAME%% |
22 |
# Default: /var/db/%%PORTNAME%% |
Lines 21-41
Link Here
|
21 |
load_rc_config $name |
27 |
load_rc_config $name |
22 |
|
28 |
|
23 |
: ${%%PORTNAME%%_enable:="NO"} |
29 |
: ${%%PORTNAME%%_enable:="NO"} |
|
|
30 |
: ${%%PORTNAME%%_user:="%%USER%%"} |
31 |
: ${%%PORTNAME%%_group:="%%GROUP%%"} |
24 |
: ${%%PORTNAME%%_data_dir:="/var/db/%%PORTNAME%%"} |
32 |
: ${%%PORTNAME%%_data_dir:="/var/db/%%PORTNAME%%"} |
25 |
|
33 |
|
26 |
pidfile="/var/run/%%PORTNAME%%.pid" |
34 |
pidfile="/var/run/%%PORTNAME%%.pid" |
27 |
command="/usr/sbin/daemon" |
35 |
command="/usr/sbin/daemon" |
28 |
procname="%%LOCALBASE%%/bin/mono" |
36 |
procname="%%LOCALBASE%%/bin/mono" |
29 |
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}" |
37 |
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}" |
30 |
|
38 |
|
31 |
start_precmd=mediabrowser_precmd |
39 |
start_precmd=mediabrowser_precmd |
32 |
mediabrowser_precmd() |
40 |
mediabrowser_precmd() |
33 |
{ |
41 |
{ |
34 |
export LC_ALL="C" |
42 |
if [ ! -e ${pidfile} ]; then |
35 |
export LANG="C" |
43 |
install -g ${%%PORTNAME%%_group} -o ${%%PORTNAME%%_user} /dev/null ${pidfile}; |
|
|
44 |
fi |
36 |
|
45 |
|
37 |
if [ ! -d "${%%PORTNAME%%_data_dir}" ]; then |
46 |
if [ ! -d "${%%PORTNAME%%_data_dir}" ]; then |
38 |
install -d -g %%GROUP%% -o %%GROUP%% "${%%PORTNAME%%_data_dir}"; |
47 |
install -d -g ${%%PORTNAME%%_group} -o ${%%PORTNAME%%_user} "${%%PORTNAME%%_data_dir}"; |
39 |
fi |
48 |
fi |
40 |
} |
49 |
} |
41 |
|
50 |
|