pirate-audio: Mopidy config may contain wrong settings
Your install procedures suggests running:
mopidy config | sudo tee /etc/mopidy/mopidy.conf
but this isn’t ideal for two reasons:
- The default config values for some settings depend on the user running Mopidy. i.e. running
mopidy config
gives different settings compared to runningsudo mopidyctl config
. Below shows the differences for thecore
section but other sections (e.g.logging
,m3u
,local
) may be different also.
$ mopidy config
[core]
cache_dir = $XDG_CACHE_DIR/mopidy
config_dir = $XDG_CONFIG_DIR/mopidy
data_dir = $XDG_DATA_DIR/mopidy
$ sudo mopidyctl config
[sudo] password for pi:
Running "/usr/bin/mopidy --config /usr/share/mopidy/conf.d:/etc/mopidy/mopidy.conf config" as user mopidy
[core]
cache_dir = /var/cache/mopidy
config_dir = /etc/mopidy
data_dir = /var/lib/mopidy
If you really must do this (see #2 for why not) then instead use:
sudo mopidyctl config | sudo tee /etc/mopidy/mopidy.conf
- You’ll need to be more careful when updating Mopidy and check the old default values you’ve specified are still suitable with the new version you just upgrade to.
The Mopidy documentation suggests:
When you have created the configuration file, open it in a text editor, and add the config values you want to change. If you want to keep the default for a config value, you should not add it to the config file, but leave it out so that when we change the default value in a future version, you won’t have to change your configuration accordingly.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 23 (17 by maintainers)
Commits related to this issue
- Fix mopidy.conf settings creation for #1 — committed to pimoroni/pirate-audio by Gadgetoid 5 years ago
- Update readme for #1 and #3 — committed to pimoroni/pirate-audio by Gadgetoid 5 years ago
- Additional tweaks for #1 — committed to pimoroni/pirate-audio by Gadgetoid 5 years ago
I wanted to use that folder a while back for pimusicbox but I think I was talked out of it. Sadly I can’t remember the exact reason but I think we might have been considering removing it at the time - people already struggle with the different config files (service vs user) so having more isn’t helpful. Maybe @jodal remembers.
In general, /etc/mopidy/mopidy.conf is the right place for a user’s specific config overrides, we just like to avoid redefining the entire config again. I think having those 3-4 specific settings you want to change there would be fine, and a bit clearer when people come to upgrade.
Ha…was just coming to post that an update fixed it. Thanks @Gadgetoid!
Awesome! That worked, thank you @Gadgetoid
FWIW, I just got one in the mail today and am having the exact same issue as @Ennneerrrgggyyy so there’s definitely something wrong. Region is defaulting to NZ, mpd config is missing, I’m seeing some python websocket exceptions in the logs, etc. I’m going to dig into the code a bit before logging an issue, but something is definitely off.
@jodal Pop an email to sandy at pimoroni dot com and I’ll sort it 🙂
If you ship to Norway, I’d love one! My 7 year old has already begged me to get him one of these music devices running the software dad spends his nights hacking on for Christmas 😉
Thanks but mine came in the post this morning! Will play with it this weekend.
On Thu, 21 Nov 2019, 12:48 Sandy Macdonald, notifications@github.com wrote:
/usr/share/mopidy/conf.d
is a directory created by themopidy
Debian package for extension Debian packages to install defaults into, in case they need different defaults when installed as a Debian package than what they ship on PyPI. I think it is used very little, if at all, as most extensions these days use thecore.{cache,config,data}_dir
paths, that are set correctly by themopidy
Debian package, and create their own subdirs inside those three directories./etc/mopidy/mopidy.conf
is for the user’s specific config overrides. The less you put in here, the easier it becomes to upgrade Mopidy in the future as you automatically get updated sane default values for all config values you don’t specify.So, use
/etc/mopidy/mopidy.conf
for your changes and usesudo mopidyctl config
to see the total picture from the perspective of the Mopidy system service.Update: Ref. https://github.com/mopidy/mopidy-spotify/blob/debian/debian/changelog#L53-L54 it looks like the last package that used
/usr/share/mopidy/conf.d
stopped using it in 2015. It was replaced by thecore.{cache,config,data}_dir
paths mentioned above.