Automatically start mopidy on Raspbian Jessie

Hi

I already install the latest mopidy 1.1.1. And I would like to run mopidy when system starts.
what I should modify in the

sudo vi /etc/init.d/mopidy

file?

after that If I run this command

sudo update-rc.d mopidy defaults

I get this warning:

insserv: warning: current start runlevel(s) (empty) of script mopidy' overrides LSB defaults (2 3 4 5). insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of scriptmopidy’ overrides LSB defaults (0 1 6).

How to run mopidy automatically when system starts?

Here is my /etc/init.d/mopidy file:

http://pastebin.com/c3NQt14G

You shouldn’t edit /etc/init.d/mopidy at all. Please read https://docs.mopidy.com/en/latest/debian/#running-as-a-system-service from the “Running as a system service” header to the end of the page. That should get you going :slight_smile:

Hello,

I was getting same errors both during installation of deb package and while playing with

sudo dpkg-reconfigure mopidy

This is probably caused by Jessies new way of loading services, so

sudo systemctl enable mopidy

should do the trick - it worked for me.

It’s just a warning which shouldn’t have any effect on this. dpkg-reconfigure mopidy should work on systems with either SysV, upstart or systemd as the init system.

1 Like

Hello,

Mopidy was not starting on boot so I guess it was something more than a warning in this case :wink:

The default behavior of the Mopidy Debian package is to not start Mopidy at boot.

The Debian package is able to ask you if you want to run it as a service, but since it has the reasonable default of not doing so, you’re usually not presented with the question when installing the package. This of course depends on the debconf configuration on your system.

After you have installed the package, you can run dpkg-reconfigure mopidy to enable or disable the service. This will work both with SysV, upstart and systemd as init system, as Debian tools bridge the differences for you.

If you’re running systemd, you might also enable the service by simply running systemctl enable mopidy.

As to the insserv warnings: They simply mean that Mopidy’s SysV init script (that is, /etc/init.d/mopidy) is currently started at no ("(empty)") runlevels and are stopped at all ("(0 1 2 3 4 5 6)") runlevels. This is insserv’s backwards way of warning you that the init script is disabled. Thus, this is normal and not an error. I agree that the warning may be confusing, but there’s not much I can do about it.

Lastly, with the 1.1.2 release a couple of days ago we updated the docs to include a bit more straight forward information about running Mopidy as a service. Please see https://docs.mopidy.com/en/latest/service/ for more information.

1 Like

That was also good for me. Thanks.

Added: sudo systemctl enable mopidy