I’m using Sonarr on FreeBSD 10.2 with Mono 4.0.3. When I restart it in terminal, everything works fine, but when I restart it from web interface, Sonarr creates NzbDrone folder in current AppData location and starts from zero. AppData folder is set in startup script to /var/db/sonarr, but after restart, system status shows /var/db/sonarr/NzbDrone. It gets even more interesting after another restart from web interface. AppData folder now points to /var/db/sonarr/NzbDrone/NzbDrone. It looks to me that Sonarr restart function has hardcoded NzbDrone folder creation.
Sonarr runs as a regular user with full access to that location, so permissions are unlikely to be the cause here.
--data
is not currently a support parameter and it is not persisted during reboot. It should be working in the latest develop builds, but hasn’t been extensively tested.
Ok, but why Sonarr keeps creating NzbDrone folder, each time one level deeper?
Is the --data
argument being past to Sonarr by a startup script?
Sonarr typically uses ~/.config/NzbDrone
to store the AppData, if it doesn’t exist its created, or it uses the value passed to --data
at startup. It wouldn’t create ~/.config/NzbDrone/NzbDrone
because ~/.config/NzbDrone
already existed, it would just use ~/.config/NzbDrone
.
Please hastebin logs of a restart so we can see how which options are being passed to Sonarr. We also need to know which version of Sonarr is being used.
There’s no .config folder in sonarr’s user home dir. --data
argument gets passed by a startup script. Here’s the entire script:
root@storage:/etc # cat /usr/local/etc/rc.d/sonarr
#!/bin/sh
# $FreeBSD$
#
# PROVIDE: sonarr
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
# to enable this service:
#
# sonarr_enable: Set to YES to enable sonarr
# Default: NO
# sonarr_user: The user account used to run the sonarr daemon.
# This is optional, however do not specifically set this to an
# empty string as this will cause the daemon to run as root.
# Default: media
# sonarr_group: The group account used to run the sonarr daemon.
# This is optional, however do not specifically set this to an
# empty string as this will cause the daemon to run with group wheel.
# Default: media
# sonarr_data_dir: Directory where sonarr configuration
# data is stored.
# Default: /var/db/sonarr
. /etc/rc.subr
name=sonarr
rcvar=${name}_enable
load_rc_config $name
: ${sonarr_enable:="NO"}
: ${sonarr_user:="sonarr"}
: ${sonarr_group:="media"}
: ${sonarr_data_dir:="/var/db/sonarr/NzbDrone"}
pidfile="${sonarr_data_dir}/nzbdrone.pid"
command="/usr/sbin/daemon"
procname="/usr/local/bin/mono"
command_args="-f ${procname} /usr/local/NzbDrone/NzbDrone.exe --data=${sonarr_data_dir} --nobrowser"
start_precmd=sonarr_precmd
sonarr_precmd() {
if [ ! -d ${sonarr_data_dir} ]; then
install -d -o ${sonarr_user} -g ${sonarr_group} ${sonarr_data_dir}
fi
export XDG_CONFIG_HOME=${sonarr_data_dir}
}
run_rc_command "$1"
Originally sonarr_data_dir
variable was pointing to /var/db/sonarr, but upon my discovery, I changed it to include NzbDrone, hoping that would solve the problems, but instead, Sonarr creates that folder one level deeper.
I’m running Sonarr version 2.0.0.3357. I’ll get the logs shortly.
Here’s a log from /var/db/sonarr/NzbDrone/logs folder
root@storage:/var/db/sonarr/NzbDrone/logs # cat nzbdrone.txt
15-10-10 20:43:48.3|Info|BackupService|Starting Backup
15-10-10 20:43:57.8|Info|LifecycleService|Restart requested.
And here’s log from /var/db/sonarr/NzbDrone/NzbDrone/logs
Please edit your posts instead of triple posting.
Thats the typical config location, if you didn’t pass a config location Soanrr would base it off of that.
That fact that --data
is not preserved on reboot is part of your problem, which the script tries to correct with this line:
export XDG_CONFIG_HOME=${sonarr_data_dir}
Which changes the config location that Sonarr would automatically discover and appears to be persisted through reboots, the problem is as soon as you appended NzbDrone
to the config path on reboot is causes Sonarr to see the config directory as /var/db/sonarr/NzbDrone
and then it creates the NzbDrone
folder underneath it (as it would on any other system to avoid putting all its data in the root of the config directory).
So on first boot, passing in /var/db/sonarr/NzbDrone
works because --data
overrides the directory that Sonarr would have otherwise created if that parameter wasn’t passed in, on next boot when --data
is not passed in Sonarr creates the directory based on the path.
The solution is to stop passing in the --data
argument and set drop the NzbDrone from
sonarr_data_dir`.
Ok, I got it to work, I changed the sonarr_data_dir
to point to /home/sonarr/.config
and added NzbDrone to pidfile line. Now restarting it from web interface and from CLI works. I guess pointing it back to /var/db/sonarr
should work as well.
Thanks for the help with this.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.