# Mopidy will not run in background

**URL:** <https://discourse.mopidy.com/t/mopidy-will-not-run-in-background/174>\
**Category:** Misc\
**Created:** [September 14, 2014, 3:07pm UTC](https://discourse.mopidy.com/t/mopidy-will-not-run-in-background/174 "2014-09-14T15:07:47Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sep14](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Sep14](https://discourse.mopidy.com/u/Sep14)\
**Post date:** [September 14, 2014, 3:07pm UTC](https://discourse.mopidy.com/t/mopidy-will-not-run-in-background/174/1 "2014-09-14T15:07:47Z")

</div>

Hello, I’ve been a long time MPD user, but since I started using Spotify more, I wanted to try Mopidy. I’m having a few issues with the installation though. The main one is it is not working in the background.

First I’ve removed MPD and then installed mopidy so there wouldn’t be any conflicts. I also activated the init script using `sudo dpkg-reconfigure mopidy`. But after rebooting, my mpd clients (mpad and mpod) don’t seem to find it. `top` doesn’t seem to find it either. When I deactivate the init script, reboot, and try just using the `mopidy` command, The mpd clients will work, but if i close the terminal window I started mopidy in, it stops working again. I’ve also tried `mopidy &` in the rc.local script, but that doesn’t work for me either.

Any help would be appreciated!!

---

<div class="post-metadata">

**Author:** ![woutervanwijk](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/woutervanwijk/32/15_2.png) [@woutervanwijk](https://discourse.mopidy.com/u/woutervanwijk)\
**Post date:** [September 14, 2014, 4:27pm UTC](https://discourse.mopidy.com/t/mopidy-will-not-run-in-background/174/2 "2014-09-14T16:27:28Z")

</div>

Did you check /etc/mopidy and /etc/default/mopidy? It uses a different config file if it’s a background service, maybe that’s the problem

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [September 15, 2014, 2:20pm UTC](https://discourse.mopidy.com/t/mopidy-will-not-run-in-background/174/3 "2014-09-15T14:20:34Z")

</div>

As @woutervanwijk says, when running Mopidy as a service it will use a different config file. There is plenty of information on this at [http://docs.mopidy.com/en/latest/debian/#differences-when-running-as-a-system-service](http://docs.mopidy.com/en/latest/debian/#differences-when-running-as-a-system-service)

You can view the config for the service by running `sudo service mopidy run config`.

---

<div class="post-metadata">

**Author:** ![Sep14](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Sep14](https://discourse.mopidy.com/u/Sep14)\
**Post date:** [September 15, 2014, 2:32pm UTC](https://discourse.mopidy.com/t/mopidy-will-not-run-in-background/174/4 "2014-09-15T14:32:41Z")

</div>

Thank you for that! Editing `/etc/mopidy/mopidy.conf` with the bare minimum configuration allowed mopidy to now pop up in both my mpd clients and top. The `/etc/default/mopidy` folder doesn’t exist though.

So to confirm, when mopidy runs as a background service, `~/.config/mopidy/mopidy.conf` is completely ignored? This leads to two other questions. How do I check the actual configuration that the background service of mopidy is using? When I run `mopidy config`, it shows the configuration of `~/.config/mopidy/mopidy.conf` instead of `/etc/mopidy/mopidy.conf`. And finally, how did everyone else figure this out? I couldn’t find this in the documentation.

Thank you!

---

<div class="post-metadata">

**Author:** ![Sep14](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Sep14](https://discourse.mopidy.com/u/Sep14)\
**Post date:** [September 15, 2014, 3:19pm UTC](https://discourse.mopidy.com/t/mopidy-will-not-run-in-background/174/5 "2014-09-15T15:19:26Z")

</div>

@kingosticks Ooh, there it is. How embarassing! You answered all of my questions before I even published my follow up questions. Thank you!

As an aside, I tried searching for `/etc/mopidy/mopidy.conf` in the doc search engine before I saw your post, but the page you linked didn’t show up. I thought that was strange.

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [September 15, 2014, 3:40pm UTC](https://discourse.mopidy.com/t/mopidy-will-not-run-in-background/174/6 "2014-09-15T15:40:18Z")

</div>

Weird, it doesn’t appear, maybe it hates slashes.  
But something like `site:docs.mopidy.com /etc/mopidy/mopidy.conf` in google (or whatever) is always worth a try.

---

<div class="post-metadata">

**Author:** ![Sep14](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Sep14](https://discourse.mopidy.com/u/Sep14)\
**Post date:** [September 15, 2014, 5:53pm UTC](https://discourse.mopidy.com/t/mopidy-will-not-run-in-background/174/7 "2014-09-15T17:53:34Z")

</div>

I think it does hate slashes.

Another question sort of related to the original topic of the background service.

When I ran mopidy in the foreground (?), my spotify playlists would populate in my mpd clients saved playlist section, but now after I have it running in the background, the playlists don’t show. I’m not sure what could be causing this. I originally thought it was a permissions issue, (like i was having with my local files), but the folder is owned by “mopidy” user.

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [September 15, 2014, 6:23pm UTC](https://discourse.mopidy.com/t/mopidy-will-not-run-in-background/174/8 "2014-09-15T18:23:44Z")

</div>

Spotify playlists won’t have any sort of permission issue like that, the playlists should populate the section in your client. Does the config contain your spotify credentials? Are you able to search and play spotify songs otherwise?

On the client I use (gmpc) I have to wait for Mopidy to load the playlists before connecting else they don’t show up. It just requires you to disconnect and reconnect in the client, could it be that?

---

<div class="post-metadata">

**Author:** ![Sep14](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Sep14](https://discourse.mopidy.com/u/Sep14)\
**Post date:** [September 15, 2014, 6:54pm UTC](https://discourse.mopidy.com/t/mopidy-will-not-run-in-background/174/9 "2014-09-15T18:54:47Z")

</div>

Yes, the credentials have been entered. I’m able to search for and play spotify music ok. It’s just not populating the spotify playlists.

Ok, I lied about it working when running mopidy in the foreground. It doesn’t work that way either now. What I do notice that is different from yesterday, is previously it used to say something like “Loaded 12 playlists from Spotify” after the “connected to spotify” line. It does not say that anymore.

---

<div class="post-metadata">

**Author:** ![Sep14](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Sep14](https://discourse.mopidy.com/u/Sep14)\
**Post date:** [September 15, 2014, 9:13pm UTC](https://discourse.mopidy.com/t/mopidy-will-not-run-in-background/174/10 "2014-09-15T21:13:52Z")

</div>

Out of the blue, it started working. So strange.

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [September 16, 2014, 9:15am UTC](https://discourse.mopidy.com/t/mopidy-will-not-run-in-background/174/11 "2014-09-16T09:15:49Z")

</div>

It has to load the playlist metadata from Spotif. Initially this will take a bit of time but then it’s cached in the `cache_dir` and subsequently much quicker. Perhaps this was the case here.

---

<div class="post-metadata">

**Author:** ![Sep14](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@Sep14](https://discourse.mopidy.com/u/Sep14)\
**Post date:** [September 16, 2014, 1:42pm UTC](https://discourse.mopidy.com/t/mopidy-will-not-run-in-background/174/12 "2014-09-16T13:42:16Z")

</div>

On another thread, in a google group, a person tried deleting all of his playlists and started all over which seemed to work for him. I tried this also, deleted the cache, then created a playlist with one song. Waited a while, and nothing. I gave up for a bit, added some more playlists. While I was playing around with Moped web client, the playlists popped up. Then they disappeared! Then they came back. Playlists I added, would take a while before they would update in mopidy. This morning though, they seem to update instantly.
