You are not logged in.

#1 2007-10-05 00:20:11

synthead
Member
Registered: 2006-05-09
Posts: 1,337

sonata: Cannot connect to MPD: (111, 'Connection refused')

I am setting up an audio streaming server/client at the moment.  My server is running sshd and mpd.  I can connect to it via ssh without any problems at all, but when I try to connect to mpd with sonata, the shell output of sonata is:

Cannot connect to MPD: (111, 'Connection refused')

Here is my /etc/hosts.allow:

#
# /etc/hosts.allow
#

sshd:192.168.1.211:22
mpd:192.168.1.211:6600

# End of file

I would post my /etc/mpd.conf, but I'm just copying stuff from the ssh shell.  It's real plain anyway, just a copy of the template with the home folder stuff uncommented.

What can I do to connect to the server?

Offline

#2 2007-10-05 00:21:49

tam1138
Member
Registered: 2007-09-10
Posts: 238

Re: sonata: Cannot connect to MPD: (111, 'Connection refused')

Potentially stupid question: is mpd running?

Offline

#3 2007-10-05 00:31:01

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: sonata: Cannot connect to MPD: (111, 'Connection refused')

Yeah.  But always good to check! smile

[root@radio ~]# ps -A
  PID TTY          TIME CMD
    1 ?        00:00:01 init
    2 ?        00:00:00 kthreadd
    3 ?        00:00:00 migration/0
    4 ?        00:00:00 ksoftirqd/0
    5 ?        00:00:00 watchdog/0
    6 ?        00:00:00 events/0
    7 ?        00:00:00 khelper
   31 ?        00:00:00 kblockd/0
   32 ?        00:00:00 kseriod
   56 ?        00:00:00 kapmd
   61 ?        00:00:00 pdflush
   62 ?        00:00:00 pdflush
   63 ?        00:00:00 kswapd0
   64 ?        00:00:00 aio/0
  192 ?        00:00:00 ata/0
  193 ?        00:00:00 ata_aux
  201 ?        00:00:00 scsi_eh_0
  203 ?        00:00:00 scsi_eh_1
  507 ?        00:00:00 ksuspend_usbd
  510 ?        00:00:00 khubd
  704 ?        00:00:00 kjournald
  749 ?        00:00:00 udevd
 1640 ?        00:00:00 kgameportd
 2154 ?        00:00:00 syslog-ng
 2187 ?        00:00:00 crond
 2196 ?        00:00:00 sshd
 2207 ?        00:00:00 mpd
 2210 tty1     00:00:00 login
 2211 tty2     00:00:00 agetty
 2212 tty3     00:00:00 agetty
 2213 tty4     00:00:00 agetty
 2214 tty5     00:00:00 agetty
 2215 tty6     00:00:00 agetty
 2230 tty1     00:00:00 bash
 2244 ?        00:00:00 dhcpcd
 2250 ?        00:00:00 sshd
 2253 pts/0    00:00:00 bash
 2265 pts/0    00:00:00 ps

Offline

#4 2007-10-05 03:56:55

tam1138
Member
Registered: 2007-09-10
Posts: 238

Re: sonata: Cannot connect to MPD: (111, 'Connection refused')

Okay, now let's see what port it's listening on:

sudo netstat -nlp | grep mpd

Offline

#5 2007-10-05 17:58:58

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: sonata: Cannot connect to MPD: (111, 'Connection refused')

Uh oh ... I see what you're getting at!

[root@radio ~]# netstat -nlp | grep mpd
tcp        0      0 127.0.0.1:6600          0.0.0.0:*               LISTEN      2212/mpd

Offline

#6 2007-10-05 18:34:41

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: sonata: Cannot connect to MPD: (111, 'Connection refused')

It only listens on localhost. Make it listen on your external IP, and change the Sonata settings too.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#7 2007-10-05 18:45:05

tam1138
Member
Registered: 2007-09-10
Posts: 238

Re: sonata: Cannot connect to MPD: (111, 'Connection refused')

B wrote:

Make it listen on your external IP, and change the Sonata settings too.

You could, but it's nominally less secure (I trust ssh security more than mpd security, and the former can be set up to run with keys, which is a Good Thing(tm)).  If you care about that, keep the mpd config as it is, and instead create your ssh tunnel thusly:

ssh -L 6600:localhost:6600 host.running.mpd

and point sonata to localhost:6600.

Offline

#8 2007-10-05 18:46:47

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: sonata: Cannot connect to MPD: (111, 'Connection refused')

Tunneling it over SSH makes it indeed more secure, however, this is a LAN interface, so it's not that easy to get to wink.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#9 2007-10-05 19:26:39

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: sonata: Cannot connect to MPD: (111, 'Connection refused')

Ahh ... coming together smile

Here's an easy one: how would one find the full name of the host, i.e. host.running.mpd?

Offline

#10 2007-10-05 19:32:56

tam1138
Member
Registered: 2007-09-10
Posts: 238

Re: sonata: Cannot connect to MPD: (111, 'Connection refused')

The IP address will suffice. smile

Offline

#11 2007-10-06 08:06:16

synthead
Member
Registered: 2006-05-09
Posts: 1,337

Re: sonata: Cannot connect to MPD: (111, 'Connection refused')

Bam!

I'm at home now, but I walked out of the office earlier today hearing the sweet, sweet sounds of mpd.  Works like a charm!  I really appreciate the help!

btw - sorry for asking a pretty obvious question! tongue

Offline

Board footer

Powered by FluxBB