systemd service file for Subsonic

General discussions.

Moderator: moderators

systemd service file for Subsonic

Postby Stormwind » Thu Apr 25, 2019 5:59 pm

For those of us running subsonic in a systemd based Linux distro (like Fedora in my instance), I created a systemd service file for subsonic.

It assumes it will run subsonic user/group subsonic, and the sysconfig file assumes /mnt/Audio for audio file location and a https port - customize to your own needs.

Hope it saves someone some time!

subsonic.service:
Code: Select all
[Unit]
Description=Subsonic media streame
Documentation=http://www.subsonic.org
After=network.target network-online.target
Wants=network-online.target

[Service]
Type=simple
User=subsonic
Group=subsonic
EnvironmentFile=/etc/sysconfig/subsonic
PIDFile=/run/subsonic/subsonic.pid
Environment=JAVA_HOME=/etc/alternatives/jre_1.8.0
PassEnvironment=JAVA_HOME
ExecStart=/usr/bin/subsonic --pidfile=/run/subsonic/subsonic.pid $SUBSONIC_ARGS

[Install]
WantedBy=multi-user.target


/etc/sysconfig/subsonic:
Code: Select all
#
# This is the configuration file for the Subsonic service
#
# To change the startup parameters of Subsonic, modify
# the SUBSONIC_ARGS variable below.
#
# Type "subsonic --help" on the command line to read an
# explanation of the different options.
#
# For example, to specify that Subsonic should use port 80 (for http)
# and 443 (for https), and use a Java memory heap size of 200 MB, use
# the following:
#
# SUBSONIC_ARGS="--port=80 --https-port=443 --max-memory=200"

SUBSONIC_ARGS=--port=8124 --https-port=8125 --max-memory=150 --home=/var/subsonic --default-music-folder=/mnt/Audio/Music --default-podcast-folder=/mnt/Audio/Podcasts --default-playlist-folder=/mnt/Audio/Playlists

Stormwind
 
Posts: 9
Joined: Sun Nov 22, 2015 9:52 pm

Return to General

Who is online

Users browsing this forum: No registered users and 4 guests