1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-10-29 23:12:39 +01:00

Moved from /opt back to /usr/lib based on debian policy.

This commit is contained in:
Taloth Saldono 2018-11-10 01:07:41 +01:00
parent 40a7cf32c5
commit 975fe98cbf
3 changed files with 16 additions and 5 deletions

View File

@ -1 +1 @@
sonarr_bin/* /opt/sonarr/bin sonarr_bin/* /usr/lib/sonarr/bin

View File

@ -20,17 +20,28 @@ if ! getent passwd "$USER" >/dev/null; then
adduser --system --no-create-home --ingroup "$GROUP" "$USER" adduser --system --no-create-home --ingroup "$GROUP" "$USER"
fi fi
# Migrate old data dir (Sonarr v3 alpha)
if [ -d "/var/opt/sonarr" ] && [ "$CONFDIR" != "/var/opt/sonarr" ]; then
if [ ! -f "/var/opt/sonarr/sonarr.db" ] && [ -f "/var/opt/sonarr/.config/Sonarr/sonarr.db" ]; then
mv "/var/opt/sonarr/.config/Sonarr" "$CONFDIR"
rm -rf "/var/opt/sonarr"
else
mv "/var/opt/sonarr" "$CONFDIR"
fi
chown -R $USER:$GROUP "$CONFDIR"
fi
# Create data directory # Create data directory
if [ ! -d "$CONFDIR" ]; then if [ ! -d "$CONFDIR" ]; then
mkdir -p "$CONFDIR" mkdir -p "$CONFDIR"
chown -R $USER:$GROUP "$CONFDIR" chown -R $USER:$GROUP "$CONFDIR"
fi fi
# Set permissions on /opt/sonarr # Set permissions on /usr/lib/sonarr
chown -R $USER:$GROUP /opt/sonarr chown -R $USER:$GROUP /usr/lib/sonarr
# Update sonarr.service file # Update sonarr.service file
sed -i "s:User=sonarr:User=$USER:g; s:Group=sonarr:Group=$GROUP:g; s:-data=/var/opt/sonarr:-data=$CONFDIR:g" $SYSTEMD_UNIT sed -i "s:User=sonarr:User=$USER:g; s:Group=sonarr:Group=$GROUP:g; s:-data=/var/lib/sonarr:-data=$CONFDIR:g" $SYSTEMD_UNIT
#DEBHELPER# #DEBHELPER#

View File

@ -8,7 +8,7 @@ Group=sonarr
UMask=002 UMask=002
Type=simple Type=simple
ExecStart=/usr/bin/mono --debug /opt/sonarr/bin/Sonarr.exe -nobrowser -data=/var/opt/sonarr ExecStart=/usr/bin/mono --debug /usr/lib/sonarr/bin/Sonarr.exe -nobrowser -data=/var/lib/sonarr
TimeoutStopSec=20 TimeoutStopSec=20
KillMode=process KillMode=process
Restart=on-failure Restart=on-failure