Lines 2-47
Link Here
|
2 |
# |
2 |
# |
3 |
# $FreeBSD: head/www/subsonic-standalone/files/subsonic.in 389352 2015-06-13 12:21:51Z jlh $ |
3 |
# $FreeBSD: head/www/subsonic-standalone/files/subsonic.in 389352 2015-06-13 12:21:51Z jlh $ |
4 |
# |
4 |
# |
5 |
|
|
|
6 |
# PROVIDE: subsonic |
5 |
# PROVIDE: subsonic |
7 |
|
6 |
# REQUIRE: LOGIN |
|
|
7 |
# KEYWORD: shutdown |
8 |
# |
8 |
# |
9 |
# Configuration settings for subsonic in /etc/rc.conf: |
9 |
# Configuration settings for subsonic in /etc/rc.conf: |
10 |
# |
10 |
# |
11 |
# subsonic_enable (bool): |
11 |
# subsonic_enable (bool): |
12 |
# Set to "NO" by default. |
12 |
# Set to "NO" by default. |
13 |
# Set it to "YES" to enable subsonic |
13 |
# Set it to "YES" to enable subsonic. |
14 |
# |
14 |
# |
15 |
# subsonic_home (str): |
15 |
# subsonic_home (str): |
16 |
# Set to "%%SUBSONIC_HOME%%" by default. |
16 |
# Set to "%%SUBSONIC_HOME%%" by default. |
17 |
# |
17 |
# |
18 |
# subsonic_music_folder (str): |
|
|
19 |
# Set to "%%SUBSONIC_HOME%%"/music by default. |
20 |
# |
21 |
# subsonic_playlist_folder (str): |
22 |
# Set to "%%SUBSONIC_HOME%%"/playlist by default. |
23 |
# |
24 |
# subsonic_pidfile (str): |
25 |
# Set to "${subsonic_home}/subsonic.pid" by default. |
26 |
# |
27 |
# subsonic_host (str): |
18 |
# subsonic_host (str): |
28 |
# Set to "0.0.0.0" by default. |
19 |
# Set to "0.0.0.0" by default. |
29 |
# Specify which IP address to listen to. |
20 |
# Specify which IP address to listen to. |
30 |
# |
21 |
# |
31 |
# subsonic_http_port (int): |
22 |
# subsonic_port (int): |
32 |
# Set to "4040" by default. |
23 |
# Set to "4040" by default. |
33 |
# Specify which port to listen on for HTTP. |
24 |
# Specify which port to listen on for HTTP(S). |
|
|
25 |
# |
26 |
# subsonic_ssl (bool): |
27 |
# Set to "OFF" by default. |
28 |
# Set it to "YES" to enable SSL. |
34 |
# |
29 |
# |
35 |
# subsonic_https_port (int): |
30 |
# subsonic_ssl_keystore (str): |
36 |
# Set to "0" by default. |
31 |
# Optionally set path to custom SSL keystore. |
37 |
# Specify which port to listen on for HTTPS. |
32 |
# |
|
|
33 |
# subsonic_ssl_password (str): |
34 |
# Optionally set password for custom SSL keystore. |
38 |
# |
35 |
# |
39 |
# subsonic_context_path (str): |
36 |
# subsonic_context_path (str): |
40 |
# Set to "/" by default. |
37 |
# Set to "/" by default. |
41 |
# Specify the last part of the Subsonic URL, typically "/" or "/subsonic". |
38 |
# Specify the last part of the Subsonic URL, typically "/" or "/subsonic". |
42 |
# |
39 |
# |
43 |
# subsonic_max_memory (int): |
40 |
# subsonic_max_memory (int): |
44 |
# Set to "100" by defaut. |
41 |
# Set to "100" by default. |
45 |
# Specify the memory limit (Java heap size) in megabytes. |
42 |
# Specify the memory limit (Java heap size) in megabytes. |
46 |
# |
43 |
# |
47 |
|
44 |
|
Lines 49-83
Link Here
|
49 |
|
46 |
|
50 |
name=subsonic |
47 |
name=subsonic |
51 |
rcvar=${name}_enable |
48 |
rcvar=${name}_enable |
52 |
procname="%%JAVA%%" |
|
|
53 |
|
49 |
|
54 |
load_rc_config "${name}" |
50 |
load_rc_config "${name}" |
55 |
|
51 |
|
56 |
eval "${rcvar}=\${${rcvar}:-'NO'}" |
52 |
: ${subsonic_enable:="NO"} |
57 |
eval "${name}_user=\${${name}_user:-'subsonic'}" |
53 |
: ${subsonic_user:="%%USER%%"} |
58 |
eval "${name}_group=\${${name}_group:-'subsonic'}" |
54 |
: ${subsonic_group:="%%GROUP%%"} |
59 |
eval "_subsonic_max_memory=\${${name}_max_memory:-'100'}" |
55 |
: ${subsonic_home:="%%SUBSONIC_HOME%%"} |
60 |
eval "_subsonic_home=\${${name}_home:-'%%SUBSONIC_HOME%%'}" |
56 |
: ${subsonic_host:="0.0.0.0"} |
61 |
eval "_subsonic_music_folder=\${${name}_music_folder:-'%%SUBSONIC_HOME%%/music'}" |
57 |
: ${subsonic_port:="4040"} |
62 |
eval "_subsonic_playlist_folder=\${${name}folder:-'%%SUBSONIC_HOME%%/playlist'}" |
58 |
: ${subsonic_ssl:="NO"} |
63 |
eval "_subsonic_host=\${${name}_host:-'0.0.0.0'}" |
59 |
: ${subsonic_context_path:="/"} |
64 |
eval "_subsonic_http_port=\${${name}_http_port:-'4040'}" |
60 |
: ${subsonic_max_memory:="100"} |
65 |
eval "_subsonic_https_port=\${${name}_https_port:-'0'}" |
61 |
|
66 |
eval "_subsonic_context_path=\${${name}_context_path:-'/'}" |
62 |
if checkyesno subsonic_ssl; then |
67 |
eval "_subsonic_pidfile=\${${name}_pidfile:-'%%SUBSONIC_HOME%%/subsonic.pid'}" |
63 |
SUBSONIC_SSL_FLAGS="-Dsubsonic.httpsPort=${subsonic_port}" && subsonic_port="0" |
68 |
pidfile="${_subsonic_pidfile}" |
64 |
if [ ! -z ${subsonic_ssl_keystore} ]; then |
69 |
|
65 |
SUBSONIC_SSL_FLAGS=${SUBSONIC_SSL_FLAGS}" -Dsubsonic.ssl.keystore=${subsonic_ssl_keystore} -Dsubsonic.ssl.password=${subsonic_ssl_password}" |
|
|
66 |
fi |
67 |
fi |
70 |
|
68 |
|
71 |
|
69 |
procname="%%JAVA%%" |
72 |
command="%%SUBSONIC_DIR%%/subsonic.sh" |
70 |
subsonic_chdir="%%DATADIR%%" |
73 |
command_args="--home=${_subsonic_home} \ |
71 |
start_precmd="export LC_CTYPE='UTF-8'" |
74 |
--host=${_subsonic_host} \ |
72 |
command="/usr/sbin/daemon" |
75 |
--port=${_subsonic_http_port} \ |
73 |
command_args="-f ${procname} \ |
76 |
--https-port=${_subsonic_https_port} \ |
74 |
-Dsubsonic.home=${subsonic_home} \ |
77 |
--context-path=${_subsonic_context_path} \ |
75 |
-Dsubsonic.host=${subsonic_host} \ |
78 |
--max-memory=${_subsonic_max_memory} \ |
76 |
-Dsubsonic.port=${subsonic_port} \ |
79 |
--pidfile=${_subsonic_pidfile} \ |
77 |
${SUBSONIC_SSL_FLAGS} \ |
80 |
--default-music-folder=${_subsonic_music_folder} \ |
78 |
-Dsubsonic.contextPath=${subsonic_context_path} \ |
81 |
--default-playlist-folder=${_subsonic_playlist_folder}" |
79 |
-Dsubsonic.defaultMusicFolder=${subsonic_home}/music \ |
|
|
80 |
-Dsubsonic.defaultPodcastFolder=${subsonic_home}/Podcast \ |
81 |
-Dsubsonic.defaultPlaylistFolder=${subsonic_home}/playlists \ |
82 |
-Xmx${subsonic_max_memory}m \ |
83 |
-Djava.awt.headless=true -jar \ |
84 |
${subsonic_chdir}/subsonic-booter-jar-with-dependencies.jar" |
82 |
|
85 |
|
83 |
run_rc_command "$1" |
86 |
run_rc_command "$1" |