Re: [ATrpms-devel] New mpd available - Part 1

2013-07-27 Thread Kim Bisgaard

Hi Paulo,

I need it running as a system daemon, so .. and it works i F19 except 
for the creation of the /var/run/mpd dir and my "smaller" problems with 
pulseaudio and alsa ...


Thanks!

Best regards,
Kim

On 26-07-2013 14:01, Paulo Cavalcanti wrote:

Hi, Kim

the only way I got mpd working system wide in F17, was recursively
labelling all my mp3 directory "audio_home_t".

You can try mdp as a user, using something as:

music_directory  "/home/mp3"
playlist_directory "/home/kim/.mpd/playlists"
db_file"/home/kim/.mpd/database"
log_file   "/home/kim/.mpd/log"
pid_file   "/home/kim/.mpd/pid"
state_file"/home/kim/.mpd/state"

.

bind_to_address "0.0.0.0"  < this may help

and just starting mpd (this is how it runs in Mac OS for me).
It should work in linux this way if the selinux labels are wrong.
But maybe F19 has something different.

Anyway, is it working in F19 using /var/run/mpd?













On Thu, Jul 25, 2013 at 4:22 PM, Kim Bisgaard
mailto:kim...@alleroedderne.adsl.dk>> wrote:

Hi Paulo,

If I look at selinux labeling in F19 it looks like the attached
picture. See "Part 2"

I can see that selinux expects the pid and socket file to be in
"/var/run/mpd"

I have no audio_home_t, but mpd_data_t

Here is my system wide config:
music_directory "/var/lib/mpd/music"
playlist_directory  "/var/lib/mpd/playlists"
db_file "/var/lib/mpd/database"
pid_file"/var/run/mpd/pid"
user"mpd"
bind_to_address "192.168.0.5"
bind_to_address "/var/run/mpd/socket"
port"6600"
log_level   "verbose"
metadata_to_use
"artist,album,title,track,__name,genre,date,composer,__performer,disc"
follow_outside_symlinks "yes"
follow_inside_symlinks  "yes"
zeroconf_enabled"no"
input {
   plugin  "curl"
}
audio_output {
   type"pulse"
   name"My Pulse Output"
   sink
  "alsa_output.pci-_00_14.2.__analog-stereo"
}

Which unfortunately does still not work. I can get alsa output to
work if I do not mind not beeing able to touch the volume. But
Pulseaudio just gives: {{mpd: output: Failed to open "My Pulse
Output" [pulse]: failed to connect: Connection terminated}}

I do NOT think that you can help or is responsible - I just think
that Mpd is somewhat difficult to configure correctly on Fedora (I
had similar problems in F17 :-(  )

Best regards,
Kim


Den 25-07-2013 16 :01, Paulo Cavalcanti skrev:

mpd has a directory where, among other things, its database and
pid are
stored.

If mpd is run system wide as root, this is /var/lib/mpd, as you
should
set in
/etc/mpd.conf:

cascavel:~] ls -al /var/lib/mpd
total 12604
drwxr-xr-x.  5 mpd  mpd4096 Jul 18 07:12 .
drwxrwxr-x. 78 root procgrafico4096 Jul 14 22:37 ..
-rw-r--r--.  1 mpd  mpd 3350971 Jul 20 17:37 database
-rw---.  1 mpd  mpd  16 Jul  5  2012 .esd_auth
-rw-r--r--.  1 root root9508991 Jul 24 18:20 log
drwxr-xr-x.  2 mpd  mpd4096 Jul 10 09:08 music
-rw-r--r--.  1 mpd  mpd   5 Jul 18 07:12 pid
drwxr-xr-x.  2 mpd  mpd4096 Jul 10 09:08 playlists
drwx--.  2 mpd  mpd4096 Feb  9 00:09 .pulse
-rw---.  1 mpd  mpd 256 Jul  5  2012 .pulse-cookie
-rw-r--r--.  1 mpd  mpd3258 Jul 20 17:42 state


If mpd is run for a single user this is generally ~/.mpd:

[cascavel:~] ls -al ~/.mpd
total 8260
drwxrwxr-x.   4 roma roma4096 Mar 11 08:45 .
drwxr-xr-x. 115 roma roma   12288 Jul 24 17:10 ..
drwxrwxr-x.   2 roma roma4096 Sep  2  2012 .AppleDouble
-rw-rw-r--.   1 roma roma 3313663 Mar  7 09:00 database
-rw-rw-r--.   1 roma roma 5093395 Mar 11 17:30 log
-rw-r--r--.   1 roma roma   13727 Jul  7  2012 mpd.conf
-rw-rw-r--.   1 roma roma   5 Mar 11 08:45 pid
drwxrwxr-x.   2 roma roma4096 Oct 14  2012 playlists
-rw-rw-r--.   1 roma roma3917 Mar  7 09:32 state

Therefore, there has never been a /var/run/mpd. To use the
system wide
approach with selinux active, the files must be labelled
"audio_home_t".

Nonetheless, you have to edit /etc/mpd.conf and set your choices,
removing the pounds (#) at least until:

#state_file "/var/lib/mpd/state"

Otherwise, I doubt mpd will work...



On Thu, Jul 25, 2013 at 8:14 AM, Kim Bisgaard
mailto:kim%2...

Re: [ATrpms-devel] New mpd available - Part 1

2013-07-26 Thread Paulo Cavalcanti
Hi, Kim

the only way I got mpd working system wide in F17, was recursively
labelling all my mp3 directory "audio_home_t".

You can try mdp as a user, using something as:

music_directory  "/home/mp3"
playlist_directory "/home/kim/.mpd/playlists"
db_file"/home/kim/.mpd/database"
log_file   "/home/kim/.mpd/log"
pid_file   "/home/kim/.mpd/pid"
state_file"/home/kim/.mpd/state"

.

bind_to_address "0.0.0.0"  < this may help

and just starting mpd (this is how it runs in Mac OS for me).
It should work in linux this way if the selinux labels are wrong.
But maybe F19 has something different.

Anyway, is it working in F19 using /var/run/mpd?













On Thu, Jul 25, 2013 at 4:22 PM, Kim Bisgaard
wrote:

> Hi Paulo,
>
> If I look at selinux labeling in F19 it looks like the attached picture.
> See "Part 2"
>
> I can see that selinux expects the pid and socket file to be in
> "/var/run/mpd"
>
> I have no audio_home_t, but mpd_data_t
>
> Here is my system wide config:
> music_directory "/var/lib/mpd/music"
> playlist_directory  "/var/lib/mpd/playlists"
> db_file "/var/lib/mpd/database"
> pid_file"/var/run/mpd/pid"
> user"mpd"
> bind_to_address "192.168.0.5"
> bind_to_address "/var/run/mpd/socket"
> port"6600"
> log_level   "verbose"
> metadata_to_use "artist,album,title,track,**name,genre,date,composer,**
> performer,disc"
> follow_outside_symlinks "yes"
> follow_inside_symlinks  "yes"
> zeroconf_enabled"no"
> input {
>   plugin  "curl"
> }
> audio_output {
>   type"pulse"
>   name"My Pulse Output"
>   sink"alsa_output.pci-_00_14.2.**analog-stereo"
> }
>
> Which unfortunately does still not work. I can get alsa output to work if
> I do not mind not beeing able to touch the volume. But Pulseaudio just
> gives: {{mpd: output: Failed to open "My Pulse Output" [pulse]: failed to
> connect: Connection terminated}}
>
> I do NOT think that you can help or is responsible - I just think that Mpd
> is somewhat difficult to configure correctly on Fedora (I had similar
> problems in F17 :-(  )
>
> Best regards,
> Kim
>
>
> Den 25-07-2013 16:01, Paulo Cavalcanti skrev:
>
>> mpd has a directory where, among other things, its database and pid are
>> stored.
>>
>> If mpd is run system wide as root, this is /var/lib/mpd, as you should
>> set in
>> /etc/mpd.conf:
>>
>> cascavel:~] ls -al /var/lib/mpd
>> total 12604
>> drwxr-xr-x.  5 mpd  mpd4096 Jul 18 07:12 .
>> drwxrwxr-x. 78 root procgrafico4096 Jul 14 22:37 ..
>> -rw-r--r--.  1 mpd  mpd 3350971 Jul 20 17:37 database
>> -rw---.  1 mpd  mpd  16 Jul  5  2012 .esd_auth
>> -rw-r--r--.  1 root root9508991 Jul 24 18:20 log
>> drwxr-xr-x.  2 mpd  mpd4096 Jul 10 09:08 music
>> -rw-r--r--.  1 mpd  mpd   5 Jul 18 07:12 pid
>> drwxr-xr-x.  2 mpd  mpd4096 Jul 10 09:08 playlists
>> drwx--.  2 mpd  mpd4096 Feb  9 00:09 .pulse
>> -rw---.  1 mpd  mpd 256 Jul  5  2012 .pulse-cookie
>> -rw-r--r--.  1 mpd  mpd3258 Jul 20 17:42 state
>>
>>
>> If mpd is run for a single user this is generally ~/.mpd:
>>
>> [cascavel:~] ls -al ~/.mpd
>> total 8260
>> drwxrwxr-x.   4 roma roma4096 Mar 11 08:45 .
>> drwxr-xr-x. 115 roma roma   12288 Jul 24 17:10 ..
>> drwxrwxr-x.   2 roma roma4096 Sep  2  2012 .AppleDouble
>> -rw-rw-r--.   1 roma roma 3313663 Mar  7 09:00 database
>> -rw-rw-r--.   1 roma roma 5093395 Mar 11 17:30 log
>> -rw-r--r--.   1 roma roma   13727 Jul  7  2012 mpd.conf
>> -rw-rw-r--.   1 roma roma   5 Mar 11 08:45 pid
>> drwxrwxr-x.   2 roma roma4096 Oct 14  2012 playlists
>> -rw-rw-r--.   1 roma roma3917 Mar  7 09:32 state
>>
>> Therefore, there has never been a /var/run/mpd. To use the system wide
>> approach with selinux active, the files must be labelled "audio_home_t".
>>
>> Nonetheless, you have to edit /etc/mpd.conf and set your choices,
>> removing the pounds (#) at least until:
>>
>> #state_file "/var/lib/mpd/state"
>>
>> Otherwise, I doubt mpd will work...
>>
>>
>>
>> On Thu, Jul 25, 2013 at 8:14 AM, Kim Bisgaard
>> > >
>> wrote:
>>
>> Hi Paulo,
>>
>> I have tried to use it on F19. THANKS!!
>>
>> I could not get it to start. It threw a very misleading error -
>> "Failed to bind to 'localhost': No such file or directory", but the
>> real reason was that the directory "/var/run/mpd" was not created.
>>
>> This in it self has nothing to do with systemd as such, just because
>> Fedora introduced the empty /var at the same time (tmpfs mounted
>> /var) .
>>
>> Hope this clears it up?
>>
>> Regards,
>> Kim
>>

Re: [ATrpms-devel] New mpd available - Part 1

2013-07-25 Thread Kim Bisgaard

Hi Paulo,

If I look at selinux labeling in F19 it looks like the attached picture. 
See "Part 2"


I can see that selinux expects the pid and socket file to be in 
"/var/run/mpd"


I have no audio_home_t, but mpd_data_t

Here is my system wide config:
music_directory "/var/lib/mpd/music"
playlist_directory  "/var/lib/mpd/playlists"
db_file "/var/lib/mpd/database"
pid_file"/var/run/mpd/pid"
user"mpd"
bind_to_address "192.168.0.5"
bind_to_address "/var/run/mpd/socket"
port"6600"
log_level   "verbose"
metadata_to_use 
"artist,album,title,track,name,genre,date,composer,performer,disc"

follow_outside_symlinks "yes"
follow_inside_symlinks  "yes"
zeroconf_enabled"no"
input {
  plugin  "curl"
}
audio_output {
  type"pulse"
  name"My Pulse Output"
  sink"alsa_output.pci-_00_14.2.analog-stereo"
}

Which unfortunately does still not work. I can get alsa output to work 
if I do not mind not beeing able to touch the volume. But Pulseaudio 
just gives: {{mpd: output: Failed to open "My Pulse Output" [pulse]: 
failed to connect: Connection terminated}}


I do NOT think that you can help or is responsible - I just think that 
Mpd is somewhat difficult to configure correctly on Fedora (I had 
similar problems in F17 :-(  )


Best regards,
Kim


Den 25-07-2013 16:01, Paulo Cavalcanti skrev:

mpd has a directory where, among other things, its database and pid are
stored.

If mpd is run system wide as root, this is /var/lib/mpd, as you should
set in
/etc/mpd.conf:

cascavel:~] ls -al /var/lib/mpd
total 12604
drwxr-xr-x.  5 mpd  mpd4096 Jul 18 07:12 .
drwxrwxr-x. 78 root procgrafico4096 Jul 14 22:37 ..
-rw-r--r--.  1 mpd  mpd 3350971 Jul 20 17:37 database
-rw---.  1 mpd  mpd  16 Jul  5  2012 .esd_auth
-rw-r--r--.  1 root root9508991 Jul 24 18:20 log
drwxr-xr-x.  2 mpd  mpd4096 Jul 10 09:08 music
-rw-r--r--.  1 mpd  mpd   5 Jul 18 07:12 pid
drwxr-xr-x.  2 mpd  mpd4096 Jul 10 09:08 playlists
drwx--.  2 mpd  mpd4096 Feb  9 00:09 .pulse
-rw---.  1 mpd  mpd 256 Jul  5  2012 .pulse-cookie
-rw-r--r--.  1 mpd  mpd3258 Jul 20 17:42 state


If mpd is run for a single user this is generally ~/.mpd:

[cascavel:~] ls -al ~/.mpd
total 8260
drwxrwxr-x.   4 roma roma4096 Mar 11 08:45 .
drwxr-xr-x. 115 roma roma   12288 Jul 24 17:10 ..
drwxrwxr-x.   2 roma roma4096 Sep  2  2012 .AppleDouble
-rw-rw-r--.   1 roma roma 3313663 Mar  7 09:00 database
-rw-rw-r--.   1 roma roma 5093395 Mar 11 17:30 log
-rw-r--r--.   1 roma roma   13727 Jul  7  2012 mpd.conf
-rw-rw-r--.   1 roma roma   5 Mar 11 08:45 pid
drwxrwxr-x.   2 roma roma4096 Oct 14  2012 playlists
-rw-rw-r--.   1 roma roma3917 Mar  7 09:32 state

Therefore, there has never been a /var/run/mpd. To use the system wide
approach with selinux active, the files must be labelled "audio_home_t".

Nonetheless, you have to edit /etc/mpd.conf and set your choices,
removing the pounds (#) at least until:

#state_file "/var/lib/mpd/state"

Otherwise, I doubt mpd will work...



On Thu, Jul 25, 2013 at 8:14 AM, Kim Bisgaard
mailto:kim...@alleroedderne.adsl.dk>> wrote:

Hi Paulo,

I have tried to use it on F19. THANKS!!

I could not get it to start. It threw a very misleading error -
"Failed to bind to 'localhost': No such file or directory", but the
real reason was that the directory "/var/run/mpd" was not created.

This in it self has nothing to do with systemd as such, just because
Fedora introduced the empty /var at the same time (tmpfs mounted /var) .

Hope this clears it up?

Regards,
Kim


On 2013-07-25 12:25, Paulo Cavalcanti wrote:

Hi,

the version for F17 uses systemd, ant the other for rhel6, does not.

What version do you mean?




On Tue, Jul 23, 2013 at 8:51 AM, Kim Bisgaard
mailto:kim...@alleroedderne.adsl.dk>> wrote:

Hi Paulo,

Could I persuade you to create the directory with the socket
file in the package? This prevents the package to work on
distributions with systemd.

The spec-file-fu is something like the following:
file mpd.tpmfilesd with this line:
d /var/run/mpd 0755 mpd audio -

Source10: mpd.tmpfilesd

%if %{with systemd}
#install -p -D -m 644 %{SOURCE10}
$RPM_BUILD_ROOT%{_tmpfilesdir}/mpd.conf
install -p -D -m 644 %{SOURCE10}
$RPM_BUILD_ROOT/etc/tmpfiles.d/mpd.conf
%endif

Regards,
Kim



On 2013-07-10 14:30, Paulo Cavalcanti wrote:

Hi, Axel

I have two versions. One for Fedora, which uses mpd.service,
and another for rhel6 with /etc/rc.d/init.d/mpd.

The fedora version is the same we