Startup from Command line possible?

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1942
    Anonymous
    Inactive

    I’m trying to start the server from the command line on a Mac.

    When this:

    # mt-daapd -f -x -c /etc/mt-daapd.conf

    I get this:

    Firefly Version svn-1586: Starting with debuglevel 2
    Plugin loaded: rsp/svn-1586
    Plugin loaded: daap/svn-1586
    Starting signal handler
    Initializing database
    Starting web server from /usr/local/share/mt-daapd/admin-root on port 3689
    Listening to socket on stdin file descriptor
    Serving 414 songs. Startup complete in 0 seconds
    Dispatcher: accept failed: Socket operation on non-socket
    Rescanning database
    Dispatcher: Aborting
    Aborting

    Any help would be…well…helpful.

    Thanks

    Greg

    #14417
    Anonymous
    Inactive

    Nice, you asked the exact question I’m dying to know the answer to. Thanks man.

    #14418
    rpedde
    Participant

    @punkassjim wrote:

    Nice, you asked the exact question I’m dying to know the answer to. Thanks man.

    ??

    What kinda mac is this? Is this leopard?

    It shouldn’t start, as -x is an invalid command line argument.

    #14419
    Anonymous
    Inactive

    He’s running it on the iPhone, like the thread of mine that you just answered (thank you!).

    The -x argument is included in the iPhone port’s .plist file, which is loaded into launchctl on machine startup.

    	ProgramArguments

    /sbin/mt-daapd
    -f
    -x
    -c
    /etc/mt-daapd.conf

    Sadly, the guy who ported it doesn’t seem to have published any documentation. Could you point us to some documentation for what arguments are valid? Sorry, I’m semi-novice at open-source software.

    #14420
    rpedde
    Participant

    @punkassjim wrote:

    He’s running it on the iPhone, like the thread of mine that you just answered (thank you!).

    The -x argument is included in the iPhone port’s .plist file, which is loaded into launchctl on machine startup.

    	ProgramArguments

    /sbin/mt-daapd
    -f
    -x
    -c
    /etc/mt-daapd.conf

    Sadly, the guy who ported it doesn’t seem to have published any documentation. Could you point us to some documentation for what arguments are valid? Sorry, I’m semi-novice at open-source software.


    printf("Usage: %s [options]nn",program);
    printf("Options:n");
    printf(" -a Set cwd to app dir before startingn");
    printf(" -d Debuglevel (0-9)n");
    printf(" -D Debug modulesn");
    printf(" -m Disable mDNSn");
    printf(" -c Use configfile specifiedn");
    printf(" -P Write the PID ot specified filen");
    printf(" -f Run in foregroundn");
    printf(" -y Yes, go ahead and run as non-root usern");
    printf(" -b ffid to be broadcastn");
    printf(" -V Display version informationn");
    printf(" -k Kill a running daemon (based on pidfile)n");
    printf("nn");
    printf("Valid debug modules:n");
    printf(" config,webserver,database,scan,query,index,browsen");
    printf(" playlist,art,daap,main,rend,miscn");
    printf("nn");

    It should start like the launchd plist says.

    As far as the listening socket error, that isn’t in my code. That’s something added or changed by the porter.

    The porter is required to publish at least diffs of what he changed though, if he’s offering it for distribution. Ask him if he can send you the diffs.

    That might be enlightening.

    Try without the -x. I don’t know what that does, anyway. 🙂

    #14421
    Anonymous
    Inactive

    punkassjim –

    I think you and I are working on the same problem – namely using Firefly ported to the iPhone and then attempting to use iToggle (or similar services app) to turn music sharing on & off.

    Here’s the trouble –

    iToggle basically runs & kill processes rather than loads & unloads plists.
    The Firefly server doesn’t seem to run the mt-daapd process exept when the music is actually streaming. Turning it on ahead of time (as I’m sure you’re finding out) does nothing. If iToggle would allow users to define ON process & an OFF process separately we’d be fine since iToggle can point to a shell script if needed.

    I altered Erica’s doShell app to load & unload the Firefly server. It’s not as elegant as having it attached to iToggle or Services but it works as a one button app. I’d be happy to send it to you if you want.

    Let me know – along with ANY progress please!

    Greg

    #14422
    Anonymous
    Inactive

    rpedde,

    I am indeed running the server ported to the iPhone – sorry I wasn’t clear on that earlier.

    Here’s the terminal read-out (including -x info):

    Usage: mt-daapd [options]

    Options:
    -a Set cwd to app dir before starting
    -d Debuglevel (0-9)
    -D Debug modules
    -m Disable mDNS
    -c Use configfile specified
    -P Write the PID to specified file
    -f Run in foreground
    -y Yes, go ahead and run as non-root user
    -b ffid to be broadcast
    -V Display version information
    -k Kill a running daemon (based on pidfile)
    -x Receive listening socket from (x)inetd
    -n Perform the initial scan and terminate

    Valid debug modules:
    config,webserver,database,scan,query,index,browse
    playlist,art,daap,main,rend,misc

    —-

    The whole plist shows sockets, but how to define?

    Disabled

    Label
    org.fireflymediaserver.mt-daapd
    Nice
    19
    OnDemand

    ProgramArguments

    /sbin/mt-daapd
    -f
    -x
    -c
    /etc/mt-daapd.conf

    RunAtLoad

    ServiceDescription
    Streams music to iTunes and other DAAP clients
    Sockets

    Listeners

    Bonjour

    SockServiceName
    daap

    StandardErrorPath
    /dev/null
    StandardOutPath
    /dev/null
    inetdCompatibility

    Wait

    —-

    Is there a way to load the server and run & kill a single process that would enable & disable sharing? mt-daapd only seems to run when music is actually streaming. What process is used to signal iTunes in the first place?

    Thanks for your help,

    Greg

    #14423
    Anonymous
    Inactive

    y’know, now I’m starting to think the problem we’re having is because launchd (which is controlling mt-daapd) knows where inetd is, but somehow our default shell doesn’t. Could it be that you and I are missing something from our PATH? Gonna check into that when I get a sec.

    #14424
    rpedde
    Participant

    @punkassjim wrote:

    y’know, now I’m starting to think the problem we’re having is because launchd (which is controlling mt-daapd) knows where inetd is, but somehow our default shell doesn’t. Could it be that you and I are missing something from our PATH? Gonna check into that when I get a sec.

    Aaah… I see.

    If you just want to enable and disable it from launchd, use launchctl.

    launchctl unload /path/to/plist

    launchctl load /path/to/plist

    that should work.

    — Ron

    #14425
    Anonymous
    Inactive

    Yeah, that’s what I thought you’d say. Here’s the thing:

    On the iPhone, as with anything, we’re trying to get a nice GUI solution together for enabling and disabling services on the fly, just so we’re not walking around with ssh and firefly enabled all the time, serving from our pockets. I’m not a programmer, and I don’t think Greg is either (I may be wrong), so we’re relying on the software of others.

    http://web.newsguy.com/marcio/iphone/itoggle/
    Enter iToggle. Nice little app for switching things on and off, but it doesn’t use launchd to do its thing, it addresses the daemon directly, with arguments. For one reason or another, Firefly doesn’t seem to work at all when enabling it via iToggle (which simply issues the command Greg posted up in his first post).

    I’m beginning to get the feeling we need to track down the developer of iToggle and ask him to change the app so that it does everything through launchd (since we know that works).

    #14426
    rpedde
    Participant

    @punkassjim wrote:

    Yeah, that’s what I thought you’d say. Here’s the thing:

    On the iPhone, as with anything, we’re trying to get a nice GUI solution together for enabling and disabling services on the fly, just so we’re not walking around with ssh and firefly enabled all the time, serving from our pockets. I’m not a programmer, and I don’t think Greg is either (I may be wrong), so we’re relying on the software of others.

    http://web.newsguy.com/marcio/iphone/itoggle/
    Enter iToggle. Nice little app for switching things on and off, but it doesn’t use launchd to do its thing, it addresses the daemon directly, with arguments. For one reason or another, Firefly doesn’t seem to work at all when enabling it via iToggle (which simply issues the command Greg posted up in his first post).

    I’m beginning to get the feeling we need to track down the developer of iToggle and ask him to change the app so that it does everything through launchd (since we know that works).

    If you don’t want to run it via launchd, you can run it without the -x argument. The only issue with that is that then it’s running all the time, rather than only when someone connects.

    Which is less useful than running it from launchd, imho — less memory requirements. Running it from launchd is definitely the Right Thing, imho.

    So I think that having iToggle work with launchd profiles is probably the win. Or at least give it the option to run an arbitrary command to start and stop services.

Viewing 11 posts - 1 through 11 (of 11 total)
  • The forum ‘Setup Issues’ is closed to new topics and replies.