Hey Forum!
Nun nochmal ne neue Frage
Ich habe ja in meiner letztenFrage nach einem Musikserver gesucht. Den habe ich nun mit "airsonic" gefunden. Funktioniert auch super. Doch bisher konnte ich den Service immer nur mit tmux im Hintergrund laufen lassen. Dazu musste ich per Hand eine neue tmux session aufmachen und dort dann "java -jar airsonic.war" eingegeben. Dann habe ich halt die Sitzung detached. Aber nach einem Neustart halt alles nochmal machen zu müssen ist auch lästig. Also wollte ich wie in der offiziellen Anleitung beschrieben, den Dienst durch "systemd" automatisch starten lassen.
Also habe ich die dort aufgeführten Schritte
wget https://raw.githubusercontent.com/airsonic/airsonic/master/contrib/airsonic.service -O /etc/systemd/system/airsonic.service
systemctl daemon-reload
systemctl start airsonic.service
systemctl enable airsonic.service
wget https://raw.githubusercontent.com/airsonic/airsonic/master/contrib/airsonic-systemd-env -O /etc/default/airsonic
ausgeführt.
Da mein airsonic im Ordner /home/pi/airsonic läuft habe ich die Pfade dann halt so angepasst. Dann habe ich nochmal "systemctl daemon-reload und systemctl restart airsonic.service" gemacht. Wenn ich "systemctl status airsonic.service" mache kommt dann
root@Elias-Data-Transfer-Platform:/media/Mediaserver/MediaPortal/Hörspiele# systemctl status airsonic
● airsonic.service - Airsonic Media Server
Loaded: loaded (/etc/systemd/system/airsonic.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2021-02-14 12:24:53 CET; 17min ago
Main PID: 27313 (java)
Tasks: 32 (limit: 2062)
CGroup: /system.slice/airsonic.service
└─27313 /usr/bin/java -Xmx700m -Dairsonic.home=/home/pi/airsonic -Dserver.servlet.contextPath=/airsonic -Dserver.port=8080 -jar /home/pi/airsonic/airsonic.war --server.address=127.0.0.1
Feb 14 12:26:51 Elias-Data-Transfer-Platform java[27313]: 2021-02-14 12:26:51.830 INFO --- o.a.p.s.MediaScannerService : Scanned media library with 0 entries.
Feb 14 12:26:51 Elias-Data-Transfer-Platform java[27313]: 2021-02-14 12:26:51.831 INFO --- o.a.p.s.MediaScannerService : Marking non-present files.
Feb 14 12:26:51 Elias-Data-Transfer-Platform java[27313]: 2021-02-14 12:26:51.939 INFO --- o.a.p.s.MediaScannerService : Marking non-present artists.
Feb 14 12:26:52 Elias-Data-Transfer-Platform java[27313]: 2021-02-14 12:26:52.034 INFO --- o.a.p.s.MediaScannerService : Marking non-present albums.
Feb 14 12:26:52 Elias-Data-Transfer-Platform java[27313]: 2021-02-14 12:26:52.105 INFO --- o.a.p.s.MediaScannerService : Completed media library scan.
Feb 14 12:26:52 Elias-Data-Transfer-Platform java[27313]: 2021-02-14 12:26:52.887 INFO --- o.a.p.service.PlaylistService : Starting playlist import.
Feb 14 12:26:52 Elias-Data-Transfer-Platform java[27313]: 2021-02-14 12:26:52.888 INFO --- o.a.p.service.PlaylistService : Completed playlist import.
Feb 14 12:27:18 Elias-Data-Transfer-Platform java[27313]: 2021-02-14 12:27:18.376 INFO --- org.airsonic.player.Application : Started Application in 141.089 seconds (JVM running for 144.521)
Feb 14 12:31:46 Elias-Data-Transfer-Platform java[27313]: 2021-02-14 12:31:46.805 INFO --- o.a.p.service.PodcastService : Starting scheduled Podcast refresh.
Feb 14 12:31:46 Elias-Data-Transfer-Platform java[27313]: 2021-02-14 12:31:46.816 INFO --- o.a.p.service.PodcastService : Completed scheduled Podcast refresh.
Alles anzeigen
Wenn ich aber nun unter meinedomain.de:8080 gehe kommt nun
Hmmm...diese Seite ist leider nicht erreichbar
192.168.178.44 hat eine Verbindung verweigert.
Durchsuchen Sie das Web nach 192 168 178 44
ERR_CONNECTION_REFUSED
Fehlermeldung von Microsoft Edge. Ich poste dann hier mal die Einträge von /etc/systemd/system/airsonic.service und /etc/default/airsonic.
airsonic.service:
[Unit]
Description=Airsonic Media Server
After=remote-fs.target network.target
AssertPathExists=/home/pi/airsonic
[Service]
Type=simple
Environment="JAVA_JAR=/home/pi/airsonic/airsonic.war"
Environment="JAVA_OPTS=-Xmx700m"
Environment="AIRSONIC_HOME=/home/pi/airsonic"
Environment="PORT=8080"
Environment="CONTEXT_PATH=/airsonic"
Environment="JAVA_ARGS="
EnvironmentFile=-/etc/default/airsonic
ExecStart=/usr/bin/java \
$JAVA_OPTS \
-Dairsonic.home=${AIRSONIC_HOME} \
-Dserver.servlet.contextPath=${CONTEXT_PATH} \
-Dserver.port=${PORT} \
-jar ${JAVA_JAR} $JAVA_ARGS
User=root
Group=root
# See https://www.freedesktop.org/software/systemd/man/systemd.exec.html
# for details
DevicePolicy=closed
DeviceAllow=char-alsa rw
NoNewPrivileges=yes
PrivateTmp=yes
PrivateUsers=yes
ProtectControlGroups=yes
ProtectKernelModules=yes
ProtectKernelTunables=yes
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
RestrictNamespaces=yes
RestrictRealtime=yes
SystemCallFilter=~@clock @debug @module @mount @obsolete @privileged @reboot @setuid @swap
ReadWritePaths=/home/pi/airsonic
# You can uncomment the following line if you're not using the jukebox
# This will prevent airsonic from accessing any real (physical) devices
#PrivateDevices=yes
# You can change the following line to `strict` instead of `full`
# if you don't want airsonic to be able to
# write anything on your filesystem outside of AIRSONIC_HOME.
ProtectSystem=full
# You can uncomment the following line if you don't have any media
# in /home/…. This will prevent airsonic from ever reading/writing anything there.
#ProtectHome=true
# You can uncomment the following line if you're not using the OpenJDK.
# This will prevent processes from having a memory zone that is both writeable
# and executeable, making hacker's lifes a bit harder.
#MemoryDenyWriteExecute=yes
[Install]
WantedBy=multi-user.target
Alles anzeigen
So und jetzt die /etc/default/airsonic:
# Set the location of the standalone war to use
JAVA_JAR=/home/pi/airsonic/airsonic.war
# Set any java opts separated by spaces
JAVA_OPTS=-Xmx700m
# Set a different location for airsonic home.
# If this path is /var/libresonic or even contains "libresonic",
# the data from a previous libresonic can be used as is (i.e. without
# renaming libresonic.properties,db/libresonic*,etc
AIRSONIC_HOME=/home/pi/airsonic
# Change the port to listen on
PORT=8080
# Change the path that is listened on
CONTEXT_PATH=/airsonic
# Add any java args. These are different than JAVA_OPTS in that
# they are passed directly to the program. The default is empty:
#JAVA_ARGS=
# Note that there are several settings for spring boot, not explicitly listed
# here, but can be used in either JAVA_OPTS or JAVA_ARGS. The full list
# can be found here:
# https://docs.spring.io/spring-boot/docs/1.4.5.RELEASE/reference/htmlsingle/#common-application-properties
# For example to set debug across the board:
#JAVA_ARGS=--debug
# Or to change the ip address that is listened on:
JAVA_ARGS=--server.address=127.0.0.1
Alles anzeigen
Wenn ich den Service einfach im tmux mit "java -jar airsonic.war" starte geht es. Ich kann auf die Kontrollseite zugreifen. Aber per systemd nicht.
Bitte um Hilfe!
LG, Nycrofox