Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add possibility to start multiple instances of mopidy on the same computer #329

Closed
SoundTentacle opened this Issue · 4 comments

3 participants

@SoundTentacle

It would be nice to be able to start multiple instances of mopidy.
Every instance get its own settings.py-file which you has to specify as start parameter

@jodal
Owner

I agree.

Being able to specify the config file is a part of #280.

@SoundTentacle

For everyone who need this at the moment:
I've made a "quick and dirty" hack to use mopidy multiple times (this have to be done on every update of mopidy).
a first quick test was successful ...

OS: Linux Mint 14

edit "/usr/lib/pymodules/python2.7/mopidy/utils/path.py"

insert into the "import ..." - Section:
import optparse

insert before the line:

logger = logging.getLogger('mopidy.utils.path')

the following:

def is_gst_arg(argument):
    return argument.startswith('--gst') or argument == '--help-gst'

gstreamer_args = [arg for arg in sys.argv[1:] if is_gst_arg(arg)]
mopidy_args = [arg for arg in sys.argv[1:] if not is_gst_arg(arg)]
sys.argv[1:] = gstreamer_args

parser = optparse.OptionParser()
parser.add_option(
        '-c', '--config',
        dest='config_file',
        help='path of the settings.py file')
options = parser.parse_args(args=mopidy_args)[0]

replace the line

XDG_CONFIG_DIR = glib.get_user_config_dir().decode('utf-8')

with

if options.config_file:
        XDG_CONFIG_DIR = options.config_file.decode('utf-8')
else:
        XDG_CONFIG_DIR = glib.get_user_config_dir().decode('utf-8')

Now you can start mopidy with "-c PATH/TO/CONFIG/"
For every new mopidy instance you have to create a new directory and place your settings.py-file there.
In this case: "PATH/TO/CONFIG/mopidy/settings.py"
The port-configs have to be different

@adamcik
Owner

Develop now supports --config=/etc/mopidy/mopidy.conf:$XDG_CONFIG_DIF/mopidy/mopidy.conf as of PR #385.

@adamcik adamcik closed this
@jodal
Owner

Changed milestone from v1.0 to v0.14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.