Lines 2-51
Link Here
|
2 |
# |
2 |
# |
3 |
# $FreeBSD: head/www/madsonic-standalone/files/madsonic.in 389352 2015-06-13 12:21:51Z jlh $ |
3 |
# $FreeBSD: head/www/madsonic-standalone/files/madsonic.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 madsonic in /etc/rc.conf: |
9 |
# Configuration settings for madsonic in /etc/rc.conf: |
10 |
# |
10 |
# |
11 |
# madsonic_enable (bool): |
11 |
# madsonic_enable (bool): |
12 |
# Set to "NO" by default. |
12 |
# Set to "NO" by default. |
13 |
# Set it to "YES" to enable madsonic |
13 |
# Set it to "YES" to enable madsonic. |
14 |
# |
14 |
# |
15 |
# madsonic_home (str): |
15 |
# madsonic_home (str): |
16 |
# Set to "%%SUBSONIC_HOME%%" by default. |
16 |
# Set to "%%SUBSONIC_HOME%%" by default. |
17 |
# |
17 |
# |
18 |
# madsonic_music_folder (str): |
|
|
19 |
# Set to "%%SUBSONIC_HOME%%"/music by default. |
20 |
# |
21 |
# madsonic_playlist_folder (str): |
22 |
# Set to "%%SUBSONIC_HOME%%"/playlist by default. |
23 |
# |
24 |
# madsonic_pidfile (str): |
25 |
# Set to "${madsonic_home}/madsonic.pid" by default. |
26 |
# |
27 |
# madsonic_host (str): |
18 |
# madsonic_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 |
# madsonic_http_port (int): |
22 |
# madsonic_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). |
34 |
# |
25 |
# |
35 |
# madsonic_https_port (int): |
26 |
# madsonic_ssl (bool): |
36 |
# Set to "0" by default. |
27 |
# Set to "OFF" by default. |
37 |
# Specify which port to listen on for HTTPS. |
28 |
# Set it to "YES" to enable SSL. |
|
|
29 |
# |
30 |
# madsonic_ssl_keystore (str): |
31 |
# Optionally set path to custom SSL keystore. |
32 |
# |
33 |
# madsonic_ssl_password (str): |
34 |
# Optionally set password for custom SSL keystore. |
38 |
# |
35 |
# |
39 |
# madsonic_context_path (str): |
36 |
# madsonic_context_path (str): |
40 |
# Set to "/" by default. |
37 |
# Set to "/" by default. |
41 |
# Specify the last part of the Subsonic URL, typically "/" or "/madsonic". |
38 |
# Specify the last part of the Subsonic URL, typically "/" or "/madsonic". |
42 |
# |
39 |
# |
43 |
# madsonic_init_memory (int): |
40 |
# madsonic_init_memory (int): |
44 |
# Set to "192" by defaut. |
41 |
# Set to "192" by default. |
45 |
# Specify the memory initial size (Java heap size) in megabytes. |
42 |
# Specify the memory initial size (Java heap size) in megabytes. |
46 |
# |
43 |
# |
47 |
# madsonic_max_memory (int): |
44 |
# madsonic_max_memory (int): |
48 |
# Set to "384" by defaut. |
45 |
# Set to "384" by default. |
49 |
# Specify the memory limit (Java heap size) in megabytes. |
46 |
# Specify the memory limit (Java heap size) in megabytes. |
50 |
# |
47 |
# |
51 |
|
48 |
|
Lines 57-92
Link Here
|
57 |
|
54 |
|
58 |
load_rc_config "${name}" |
55 |
load_rc_config "${name}" |
59 |
|
56 |
|
60 |
eval "${rcvar}=\${${rcvar}:-'NO'}" |
57 |
: ${madsonic_enable:="NO"} |
61 |
eval "${name}_user=\${${name}_user:-'subsonic'}" |
58 |
: ${madsonic_user:="%%USER%%"} |
62 |
eval "${name}_group=\${${name}_group:-'subsonic'}" |
59 |
: ${madsonic_group:="%%GROUP%%"} |
63 |
# Keep the same variable names as subsonic to minimize diffs. |
60 |
: ${madsonic_home:="%%SUBSONIC_HOME%%"} |
64 |
eval "_subsonic_init_memory=\${${name}_init_memory:-'192'}" |
61 |
: ${madsonic_host:="0.0.0.0"} |
65 |
eval "_subsonic_max_memory=\${${name}_max_memory:-'384'}" |
62 |
: ${madsonic_port:="4040"} |
66 |
eval "_subsonic_home=\${${name}_home:-'%%SUBSONIC_HOME%%'}" |
63 |
: ${madsonic_ssl:="NO"} |
67 |
eval "_subsonic_music_folder=\${${name}_music_folder:-'%%SUBSONIC_HOME%%/music'}" |
64 |
: ${madsonic_context_path:="/"} |
68 |
eval "_subsonic_playlist_folder=\${${name}folder:-'%%SUBSONIC_HOME%%/playlist'}" |
65 |
: ${madsonic_init_memory:="192"} |
69 |
eval "_subsonic_host=\${${name}_host:-'0.0.0.0'}" |
66 |
: ${madsonic_max_memory:="384"} |
70 |
eval "_subsonic_http_port=\${${name}_http_port:-'4040'}" |
67 |
|
71 |
eval "_subsonic_https_port=\${${name}_https_port:-'0'}" |
68 |
if checkyesno madsonic_ssl; then |
72 |
eval "_subsonic_context_path=\${${name}_context_path:-'/'}" |
69 |
MADSONIC_SSL_FLAGS="-Dmadsonic.httpsPort=${madsonic_port}" && madsonic_port="0" |
73 |
eval "_subsonic_pidfile=\${${name}_pidfile:-'%%SUBSONIC_HOME%%/subsonic.pid'}" |
70 |
if [ ! -z ${madsonic_ssl_keystore} ]; then |
74 |
pidfile="${_subsonic_pidfile}" |
71 |
MADSONIC_SSL_FLAGS=${MADSONIC_SSL_FLAGS}" -Dmadsonic.ssl.keystore=${madsonic_ssl_keystore} -Dmadsonic.ssl.password=${madsonic_ssl_password}" |
75 |
|
72 |
fi |
76 |
|
73 |
fi |
77 |
|
74 |
|
78 |
command="%%SUBSONIC_DIR%%/madsonic.sh" |
75 |
start_precmd="export LC_CTYPE='UTF-8'" |
79 |
command_args="--home=${_subsonic_home} \ |
76 |
madsonic_chdir="%%DATADIR%%" |
80 |
--host=${_subsonic_host} \ |
77 |
command="/usr/sbin/daemon" |
81 |
--port=${_subsonic_http_port} \ |
78 |
command_args="-f ${procname} \ |
82 |
--https-port=${_subsonic_https_port} \ |
79 |
-Dmadsonic.home=${madsonic_home} \ |
83 |
--context-path=${_subsonic_context_path} \ |
80 |
-Dmadsonic.host=${madsonic_host} \ |
84 |
--init-memory=${_subsonic_init_memory} \ |
81 |
-Dmadsonic.port=${madsonic_port} \ |
85 |
--max-memory=${_subsonic_max_memory} \ |
82 |
${MADSONIC_SSL_FLAGS} \ |
86 |
--pidfile=${_subsonic_pidfile} \ |
83 |
-Dmadsonic.contextPath=${madsonic_context_path} \ |
87 |
--default-music-folder=${_subsonic_music_folder} \ |
84 |
-Dmadsonic.defaultMusicFolder=${madsonic_home}/artists \ |
88 |
--default-playlist-import-folder=${_subsonic_playlist_folder}/import \ |
85 |
-Dmadsonic.defaultUploadFolder=${madsonic_home}/incoming \ |
89 |
--default-playlist-export-folder=${_subsonic_playlist_folder}/export \ |
86 |
-Dmadsonic.defaultPodcastFolder=${madsonic_home}/podcasts \ |
90 |
--default-playlist-backup-folder=${_subsonic_playlist_folder}/backup" |
87 |
-Dmadsonic.defaultPlaylistImportFolder=${madsonic_home}/playlists/import \ |
|
|
88 |
-Dmadsonic.defaultPlaylistExportFolder=${madsonic_home}/playlists/export \ |
89 |
-Dmadsonic.defaultPlaylistBackupFolder=${madsonic_home}/playlists/backup \ |
90 |
-Xms${madsonic_init_memory}m \ |
91 |
-Xmx${madsonic_max_memory}m \ |
92 |
-Djava.awt.headless=true \ |
93 |
-jar ${madsonic_chdir}/madsonic-booter.jar" |
91 |
|
94 |
|
92 |
run_rc_command "$1" |
95 |
run_rc_command "$1" |