diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /media-sound/subsonic-bin/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'media-sound/subsonic-bin/files')
-rw-r--r-- | media-sound/subsonic-bin/files/subsonic.confd | 20 | ||||
-rw-r--r-- | media-sound/subsonic-bin/files/subsonic.initd | 43 |
2 files changed, 63 insertions, 0 deletions
diff --git a/media-sound/subsonic-bin/files/subsonic.confd b/media-sound/subsonic-bin/files/subsonic.confd new file mode 100644 index 000000000000..63b303ae6a4e --- /dev/null +++ b/media-sound/subsonic-bin/files/subsonic.confd @@ -0,0 +1,20 @@ + +# Host and port to listen on +SUBSONIC_HOST=0.0.0.0 +SUBSONIC_PORT=4040 + +# To disable https, set to 0 +SUBSONIC_HTTPS_PORT=0 + +SUBSONIC_CONTEXT_PATH=/ +SUBSONIC_MAX_MEMORY=100 + +# Music directories +SUBSONIC_DEFAULT_MUSIC_FOLDER=/var/music +SUBSONIC_DEFAULT_PODCAST_FOLDER=/var/music/Podcast +SUBSONIC_DEFAULT_PLAYLIST_FOLDER=/var/playlists + +NICELEVEL=0 + +# Further subsonic start script options, if ever needed +SUBSONIC_OPTS="" diff --git a/media-sound/subsonic-bin/files/subsonic.initd b/media-sound/subsonic-bin/files/subsonic.initd new file mode 100644 index 000000000000..cabd3604ac0f --- /dev/null +++ b/media-sound/subsonic-bin/files/subsonic.initd @@ -0,0 +1,43 @@ +#!/sbin/openrc-run +# Distributed under the terms of the GNU General Public License, v2 or later + +SUBSONIC_HOME=${SUBSONIC_HOME:-/var/lib/${SVCNAME}} +SUBSONIC_USER=${SUBSONIC_USER:-${SVCNAME}} +PIDFILE=/run/subsonic/subsonic.pid + +depend() { + after net +} + +start() { + checkpath -dq -o subsonic:subsonic -m 755 /run/subsonic/ + + ebegin "Starting ${SVCNAME}" + start-stop-daemon \ + --start --user "${SUBSONIC_USER}" --name subsonic \ + --env HOME="${SUBSONIC_HOME}" --exec /usr/bin/subsonic \ + --pidfile="${PIDFILE}" \ + --nicelevel "${NICELEVEL}" \ + -- \ + --home="${SUBSONIC_HOME}" \ + --host="${SUBSONIC_HOST}" \ + --port="${SUBSONIC_PORT}" \ + --https-port="${SUBSONIC_HTTPS_PORT}" \ + --context-path="${SUBSONIC_CONTEXT_PATH}" \ + --max-memory="${SUBSONIC_MAX_MEMORY}" \ + --default-music-folder="${SUBSONIC_DEFAULT_MUSIC_FOLDER}" \ + --default-podcast-folder="${SUBSONIC_DEFAULT_PODCAST_FOLDER}" \ + --default-playlist-folder="${SUBSONIC_DEFAULT_PLAYLIST_FOLDER}" \ + --pidfile="${PIDFILE}" --quiet \ + ${SUBSONIC_OPTS} + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --user "${SUBSONIC_USER}" \ + --pidfile "${PIDFILE}" \ + --wait 15000 \ + --progress + eend $? +} |