Re: [gentoo-user] Adding dependencies in init scripts

2010-03-07 Thread Damian
On Sun, Feb 14, 2010 at 7:46 PM, Damian damian.o...@gmail.com wrote:
 On Sun, Feb 14, 2010 at 6:00 PM, Dirk Heinrichs
 dirk.heinri...@online.de wrote:
 Am Sonntag 14 Februar 2010 16:48:00 schrieb Stroller:

 Is it possible that you  Dirk are using different versions of
 baselayout?

 Yes, I am running OpenRC/BL2. I didn't even think for a second that somebody
 could still be using BL1, sorry for that ;)
 Ok, I just thought that there might be an easy way in (my loved)
 gentoo to start daemon/service X whenever Y is started.

 So I'll try upgrading to baselayout 2, and I'll see what happens.
A*fter a long time I've found some free time to migrate to baselayout 2.

After upgrading and reading through
http://www.gentoo.org/doc/en/openrc-migration.xml, I created a file
named '/etc/conf.d/mpd' and I added the line:
rc_need=mpdscribble
as described in '/etc/rc.conf'.

And that was it! Now mpdscribble gets started whenever I start mpd
(and this way all the Britney Spears songs I play will be sent to
libre.fm, weee!).

Thanks a lot for your help.



Re: [gentoo-user] Adding dependencies in init scripts

2010-02-14 Thread Dirk Heinrichs
Am Sonntag 14 Februar 2010 02:51:57 schrieb Damian:
 On Sun, Feb 14, 2010 at 2:25 AM, Damian damian.o...@gmail.com wrote:
  HTH...
  
 Dirk
  
  Thanks a lot for your responses. That looks just like what I needed.
 
 Ok, I just cannot make this work.
 
 I've created a file  /etc/conf.d/mpd with the following line
 rc_after=mpdscrible
 
 But the init script seems to ignore it. No matter what I put in
 /etc/conf.d/mpd . The gentoo handbook doesn't say anything about it.
 I'm clearly missing something, but I don't know what it is.

In your first post you stated that you want to have both started, right? But 
after is about order, not dependency. I'd say you need to put

rc_need=mpd

into /etc/conf.d/mpdscrible and put mpdscrible into default runlevel, not mpd.

Maybe a combination of both

rc_after=mpdscrible
rc_need=mpdscrible

in /etc/conf.d/mpd could also work.

HTH...

Dirk



Re: [gentoo-user] Adding dependencies in init scripts

2010-02-14 Thread Damian
Hi Dirk,

 In your first post you stated that you want to have both started, right? But
 after is about order, not dependency. I'd say you need to put

 rc_need=mpd

 into /etc/conf.d/mpdscrible and put mpdscrible into default runlevel, not mpd.
I understand, but that isn't what I want, because when I boot up, I
don't always start up mpd.


 Maybe a combination of both

 rc_after=mpdscrible
 rc_need=mpdscrible

 in /etc/conf.d/mpd could also work.
That's the problem. No matter what I put in  /etc/conf.d/mpd the init
script seems to ignore it. Even if I write
rc_need=more money
it will be ignored. Although the config file is read when I restart mpd.



Re: [gentoo-user] Adding dependencies in init scripts

2010-02-14 Thread Willie Wong
Damian:

On Sun, Feb 14, 2010 at 12:56:14PM +0100, Damian wrote:
 I understand, but that isn't what I want, because when I boot up, I
 don't always start up mpd.

  Maybe a combination of both
 
  rc_after=mpdscrible
  rc_need=mpdscrible
 
  in /etc/conf.d/mpd could also work.
 That's the problem. No matter what I put in  /etc/conf.d/mpd the init
 script seems to ignore it. Even if I write
 rc_need=more money
 it will be ignored. Although the config file is read when I restart mpd.

I am getting rather confused by this back and forth (I thought I
understood what you wanted and Dirk and other's answers should be
right, but now I am not so sure). Can you answer the following for me
just to make sure we are on the same page?

(a) What is mpdscribble? My understanding is that it is a service that
tells other things what is currently playing on mpd? That it is
actually a client of mpd? Is it actually a daemon/service?

(b) What actually is the desired behaviour? From the last e-mail I am
under the impression you don't always want to have the mpd daemon
running, but you want to be able to bring up /etc/init.d/mpd and
automatically have mpdscribble started? Can you give me a description
of what commands you want to execute and what you want to accomplish
with those?

(c) I noticed that in your previous e-mail you spelled it mpdscrible
with only one b. Is that a typo in the e-mail, or is it actually how
you have it in /etc/conf.d/mpd? emerge --search suggests that
mpdscribble is spelled with two b's.

(d) What versions of openrc and baselayout are you using?

Cheers, 

W

-- 
Willie W. Wong ww...@math.princeton.edu
Data aequatione quotcunque fluentes quantitae involvente fluxiones invenire 
 et vice versa   ~~~  I. Newton



Re: [gentoo-user] Adding dependencies in init scripts

2010-02-14 Thread Damian
 I am getting rather confused by this back and forth (I thought I
 understood what you wanted and Dirk and other's answers should be
 right, but now I am not so sure). Can you answer the following for me
 just to make sure we are on the same page?
Sure, I'm sorry for the confusion.

 (a) What is mpdscribble? My understanding is that it is a service that
 tells other things what is currently playing on mpd? That it is
 actually a client of mpd? Is it actually a daemon/service?
In short, mpdscribble is a daemon that submits the tracks you play
(using mpd) to sites such as libre.fm. In that sense it is a client of
mpd. It is possible to start mpdscribble by using
/etc/init.d/mpdscribble start

 (b) What actually is the desired behaviour? From the last e-mail I am
 under the impression you don't always want to have the mpd daemon
 running, but you want to be able to bring up /etc/init.d/mpd and
 automatically have mpdscribble started? Can you give me a description
 of what commands you want to execute and what you want to accomplish
 with those?
Yes, that's exactly what I want. If I start mpd using the command
/etc/init.d/mpd start

I would like mpdscribble to be automatically started. What I have as
output instead:
$ /etc/init.d/mpd stop  /etc/init.d/mpd start 
/etc/init.d/mpdscribble status
* Caching service dependencies ...
*  Service 'syslog-ng' already provides 'logger'!;
*  Not adding service 'metalog'...
   [ ok ]
* Service mpd stopping
* Service mpd stopped
* Service mpd starting
* Service mpd started
* status:  stopped


 (c) I noticed that in your previous e-mail you spelled it mpdscrible
 with only one b. Is that a typo in the e-mail, or is it actually how
 you have it in /etc/conf.d/mpd? emerge --search suggests that
 mpdscribble is spelled with two b's.
That's right, it is a typo in my previous mail. The config file has no typo.

 (d) What versions of openrc and baselayout are you using?
openrc is not installed, and the baselayout version is 1.12.13.

Thanks,
Damian.



Re: [gentoo-user] Adding dependencies in init scripts

2010-02-14 Thread Stroller


On 14 Feb 2010, at 11:56, Damian wrote:

Hi Dirk,

In your first post you stated that you want to have both started,  
right? But

after is about order, not dependency. I'd say you need to put

rc_need=mpd

into /etc/conf.d/mpdscrible and put mpdscrible into default  
runlevel, not mpd.

I understand, but that isn't what I want, because when I boot up, I
don't always start up mpd.


So don't put either of them into the default runlevel. The point is to  
get one of them to start when the other does.



Maybe a combination of both

rc_after=mpdscrible
rc_need=mpdscrible

in /etc/conf.d/mpd could also work.

That's the problem. No matter what I put in  /etc/conf.d/mpd the init
script seems to ignore it. Even if I write
   rc_need=more money
it will be ignored. Although the config file is read when I restart  
mpd.


Is it possible that you  Dirk are using different versions of  
baselayout?


$ grep rc_need /etc/init.d/*
$ grep rc_need /etc/conf.d/*
$ eix -I baselayout
[I] sys-apps/baselayout
 Available versions:  [P]1.11.15-r3 1.12.11.1 ~1.12.12 1.12.13  
~2.0.0 ~2.0.1 {bootstrap build static unicode}
 Installed versions:  1.12.13(03:11:46 09/02/10)(unicode - 
bootstrap -build -static)

 Homepage:http://www.gentoo.org/
 Description: Filesystem baselayout and init scripts

$

Stroller.




Re: [gentoo-user] Adding dependencies in init scripts

2010-02-14 Thread Willie Wong
On Sun, Feb 14, 2010 at 03:54:10PM +0100, Damian wrote:
  (d) What versions of openrc and baselayout are you using?
 openrc is not installed, and the baselayout version is 1.12.13.

I am thinking that Dirk's advice maybe OpenRC/baselayout2 specific.
Which is perhaps why those configuration variables gets ignored in
your case. 

One thing you can try is to upgrade. But be sure to follow
http://www.gentoo.org/doc/en/openrc-migration.xml
if you choose to do so. If you leave the system in an inconsistent
state it will fail to boot. 

(Unfortunately, as far as I know, openrc is not terribly well
documented besides the information in /etc/rc.conf ... I'd be happy to
be shown otherwise.)

For baselayout-1, I think you are more or less stuck with
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2chap=4

Cheers, 

W
-- 
Willie W. Wong ww...@math.princeton.edu
Data aequatione quotcunque fluentes quantitae involvente fluxiones invenire 
 et vice versa   ~~~  I. Newton



Re: [gentoo-user] Adding dependencies in init scripts

2010-02-14 Thread Dirk Heinrichs
Am Sonntag 14 Februar 2010 12:56:14 schrieb Damian:

  into /etc/conf.d/mpdscrible and put mpdscrible into default runlevel, not
  mpd.
 
 I understand, but that isn't what I want, because when I boot up, I
 don't always start up mpd.

Well, then don't put it in any runlevel, but if you start the service, you 
should rather start mpdscrible instead of mpd. The latter should then be 
started automatically because of rc_need.

Bye...

Dirk



Re: [gentoo-user] Adding dependencies in init scripts

2010-02-14 Thread Dirk Heinrichs
Am Sonntag 14 Februar 2010 16:48:00 schrieb Stroller:

 Is it possible that you  Dirk are using different versions of  
 baselayout?

Yes, I am running OpenRC/BL2. I didn't even think for a second that somebody 
could still be using BL1, sorry for that ;)

Bye...

Dirk



Re: [gentoo-user] Adding dependencies in init scripts

2010-02-14 Thread Damian
On Sun, Feb 14, 2010 at 6:00 PM, Dirk Heinrichs
dirk.heinri...@online.de wrote:
 Am Sonntag 14 Februar 2010 16:48:00 schrieb Stroller:

 Is it possible that you  Dirk are using different versions of
 baselayout?

 Yes, I am running OpenRC/BL2. I didn't even think for a second that somebody
 could still be using BL1, sorry for that ;)
Ok, I just thought that there might be an easy way in (my loved)
gentoo to start daemon/service X whenever Y is started.

So I'll try upgrading to baselayout 2, and I'll see what happens.

Thanks,
Damian.



Re: [gentoo-user] Adding dependencies in init scripts

2010-02-14 Thread Marc Joliet
Am Sun, 14 Feb 2010 15:54:10 +0100
schrieb Damian damian.o...@gmail.com:

  (d) What versions of openrc and baselayout are you using?
 openrc is not installed, and the baselayout version is 1.12.13.

As Willie Wong mentioned, that ought to explain it. The features Dirk was
referring to are AFAIK only available in OpenRC/Baselayout-2.

In addition to the previous advice, another thing you could try is modify the
mpdscribble init script and add it (not the entire /etc/init.d/ directory [0])
to CONFIG_PROTECT in make.conf, similarly to what Neil suggested. Then you
should only be bothered by mpdscribble updates, and not by *any* update
in /etc/init.d/. Of course this is up to you.

Perhaps there is a better way to accomplish what you want with baselayout-1,
but I can't think of any right now.

 Thanks,
 Damian.

[0] According to make.conf(5), CONFIG_PROTECT and CONFIG_PROTECT_MASK may
contain individual files in addition to whole directories.

HTH
-- 
Marc Joliet
--
Lt. Frank Drebin: It's true what they say: cops and women don't mix. Like
eating a spoonful of Drāno; sure, it'll clean you out, but it'll leave you
hollow inside.


signature.asc
Description: PGP signature


Re: [gentoo-user] Adding dependencies in init scripts

2010-02-13 Thread Damian
 HTH...

        Dirk
Thanks a lot for your responses. That looks just like what I needed.



Re: [gentoo-user] Adding dependencies in init scripts

2010-02-13 Thread Damian
On Sun, Feb 14, 2010 at 2:25 AM, Damian damian.o...@gmail.com wrote:
 HTH...

        Dirk
 Thanks a lot for your responses. That looks just like what I needed.

Ok, I just cannot make this work.

I've created a file  /etc/conf.d/mpd with the following line
rc_after=mpdscrible

But the init script seems to ignore it. No matter what I put in
/etc/conf.d/mpd . The gentoo handbook doesn't say anything about it.
I'm clearly missing something, but I don't know what it is.



[gentoo-user] Adding dependencies in init scripts

2010-02-11 Thread Damian
Hello,

I would like to configure my system so that every time I start mpd
(via /etc/init.d/mpd)  mpdscrible is started as well. What is the best
way to achieve this?

Thanks in advance,
Damian.



Re: [gentoo-user] Adding dependencies in init scripts

2010-02-11 Thread Dale

chrome://messenger/locale/messengercompose/composeMsgs.properties:

Hello,

I would like to configure my system so that every time I start mpd
(via /etc/init.d/mpd)  mpdscrible is started as well. What is the best
way to achieve this?

Thanks in advance,
Damian.


   


I found this by looking in the cups init script.  It should help.

depend() {
use net
need avahi-daemon dbus
before nfs
after logger
}

Dale

:-)  :-)



Re: [gentoo-user] Adding dependencies in init scripts

2010-02-11 Thread Damian
On Thu, Feb 11, 2010 at 11:21 AM, Dale rdalek1...@gmail.com wrote:
 chrome://messenger/locale/messengercompose/composeMsgs.properties:

 Hello,

 I would like to configure my system so that every time I start mpd
 (via /etc/init.d/mpd)  mpdscrible is started as well. What is the best
 way to achieve this?

 Thanks in advance,
 Damian.




 I found this by looking in the cups init script.  It should help.

 depend() {
    use net
    need avahi-daemon dbus
    before nfs
    after logger
 }
Thanks Dale.

I've tried putting after mpdscribble  without success. Also the
problem with this approach is that if I update mpd, I will have to
modify the init script again.



Re: [gentoo-user] Adding dependencies in init scripts

2010-02-11 Thread Dale

chrome://messenger/locale/messengercompose/composeMsgs.properties:

On Thu, Feb 11, 2010 at 11:21 AM, Dalerdalek1...@gmail.com  wrote:
   

chrome://messenger/locale/messengercompose/composeMsgs.properties:
 

Hello,

I would like to configure my system so that every time I start mpd
(via /etc/init.d/mpd)  mpdscrible is started as well. What is the best
way to achieve this?

Thanks in advance,
Damian.



   

I found this by looking in the cups init script.  It should help.

depend() {
use net
need avahi-daemon dbus
before nfs
after logger
}
 

Thanks Dale.

I've tried putting after mpdscribble  without success. Also the
problem with this approach is that if I update mpd, I will have to
modify the init script again.


   


It will likely overwrite your changes but I have no other ideas on how 
to do this.  I would imagine that the script is the only thing that can 
do it since it is what starts/stops the service.


Maybe someone else will have a idea.

Dale

:-)  :-)



Re: [gentoo-user] Adding dependencies in init scripts

2010-02-11 Thread Neil Bothwick
On Thu, 11 Feb 2010 13:15:04 +0100, Damian wrote:

  I found this by looking in the cups init script.  It should help.
 
  depend() {
     use net
     need avahi-daemon dbus
     before nfs
     after logger
  }  

 I've tried putting after mpdscribble  without success. Also the
 problem with this approach is that if I update mpd, I will have to
 modify the init script again.

That only means that is mdscribble is in the runlevel, start mpd after
it. Try need mpdscribble. The handbook and one of the man pages explain
these options.

You can add /etc/init.d to CONFIG_PROTECT and remove it from
CONFIG_PROTECT_MASK in make.conf.

Or you could remove mpd from the default runlevel and call both the init
scripts from /etc/conf.d/local.


-- 
Neil Bothwick

You are a completely unique individual, just like everybody else.


signature.asc
Description: PGP signature


Re: [gentoo-user] Adding dependencies in init scripts

2010-02-11 Thread heini
Am Donnerstag 11 Februar 2010 18:00:09 schrieb Neil Bothwick:
 On Thu, 11 Feb 2010 13:15:04 +0100, Damian wrote:
   I found this by looking in the cups init script.  It should help.
   
   depend() {
  use net
  need avahi-daemon dbus
  before nfs
  after logger
   }
  
  I've tried putting after mpdscribble  without success. Also the
  problem with this approach is that if I update mpd, I will have to
  modify the init script again.
 
 That only means that is mdscribble is in the runlevel, start mpd after
 it. Try need mpdscribble. The handbook and one of the man pages explain
 these options.
 
 You can add /etc/init.d to CONFIG_PROTECT and remove it from
 CONFIG_PROTECT_MASK in make.conf.
 
 Or you could remove mpd from the default runlevel and call both the init
 scripts from /etc/conf.d/local.

Nope. Lookup /etc/rc.conf:

##
# SERVICE CONFIGURATION VARIABLES
# These variables are documented here, but should be configured in
# /etc/conf.d/foo for service foo and NOT enabled here unless you
# really want them to work on a global basis.

# Some daemons are started and stopped via start-stop-daemon.
# We can set some things on a per service basis, like the nicelevel.
#export SSD_NICELEVEL=-19

# Pass ulimit parameters 
#rc_ulimit=-u 30

# It's possible to define extra dependencies for services like so
#rc_config=/etc/foo
#rc_need=openvpn
#rc_use=net.eth0
#rc_after=clock
#rc_before=local
#rc_provide=!net

# You can also enable the above commands here for each service. Below is an
# example for service foo.
#rc_foo_config=/etc/foo
#rc_foo_need=openvpn
#rc_foo_after=clock

# You can also remove dependencies.
# This is mainly used for saying which servies do NOT provide net.
#rc_net_tap0_provide=!net

HTH...

Dirk



Re: [gentoo-user] Adding dependencies in init scripts

2010-02-11 Thread Neil Bothwick
On Thu, 11 Feb 2010 22:22:50 +0100, heini wrote:

  Or you could remove mpd from the default runlevel and call both the
  init scripts from /etc/conf.d/local.  
 
 Nope. Lookup /etc/rc.conf:

I'd forgotten all about that, nice one!


-- 
Neil Bothwick

First Law of Laboratory Work:
Hot glass looks exactly the same as cold glass.


signature.asc
Description: PGP signature