Re: [gentoo-user] Runlevels, ordering initscripts and running them in background

2012-05-20 Thread Joost Roeleveld
On Wednesday, May 16, 2012 02:15:19 PM Neil Bothwick wrote:
 On Wed, 16 May 2012 09:40:26 +0100, Ignas Anikevicius wrote:
  I want to do this, so that I do not have to wait while non-crucial
  services are being started (e.g. fcron, bitlbee, ntpd to name a few).
  Maybe it is possible to somehow prioritize the initscripts?
 
 Yes it is. The initscripts themselves have such a mechanism, using the
 before and after statements, for example making sure that network
 services are started after the network is brought up. You can add your
 own rules to the daemons' config files in /etc/conf.d or to /etc/rc.conf.
 
 To have bitlbee start after xdm either add
 
 rc_after=xdm
 
 to /etc/conf.d/bitlbee or put
 
 rc_bitlbee_after=xdm
 
 in /etc/rc.conf. Both have the same effect, it depends on whether you
 want to put all these settings together or in the individual services'
 config files.

Putting them in /etc/rc.conf makes it simpler to maintain the init-scripts 
when updating packages.
I used to put these things in the init-scripts and occasionally forgot about 
some of these during an update.

--
Joost



Re: [gentoo-user] Runlevels, ordering initscripts and running them in background

2012-05-20 Thread Neil Bothwick
On Sun, 20 May 2012 19:59:40 +0200, Joost Roeleveld wrote:

  To have bitlbee start after xdm either add
  
  rc_after=xdm
  
  to /etc/conf.d/bitlbee or put
  
  rc_bitlbee_after=xdm
  
  in /etc/rc.conf. Both have the same effect, it depends on whether you
  want to put all these settings together or in the individual services'
  config files.  
 
 Putting them in /etc/rc.conf makes it simpler to maintain the
 init-scripts when updating packages.
 I used to put these things in the init-scripts and occasionally forgot
 about some of these during an update.

Don't put them in the init scripts, those are overwritten during an
update, either rc.conf or the config files in /etc/conf.d.

If you want to arrange the order of several items, rc.conf is the logical
place, but if you just want to make sure service A starts before service
B, /etc/conf.d/[AB] is more sensible IMO.


-- 
Neil Bothwick

Press every key to continue.


signature.asc
Description: PGP signature


[gentoo-user] Runlevels, ordering initscripts and running them in background

2012-05-16 Thread Ignas Anikevicius
Hello everybody,

I was wondering if the following is possible:
- Add a lot of daemons to a newly created runlevel post-default
- Switch to it after the xdm is started (or after some time)

I want to do this, so that I do not have to wait while non-crucial
services are being started (e.g. fcron, bitlbee, ntpd to name a few).
Maybe it is possible to somehow prioritize the initscripts?

Another related question is that I come from Arch and there I could just
give the *order* of the daemons/initscripts to start and some of them
could be started and 'in background'. Is it possible to do that with
openrc? I saw the rc_parallel option in rc.conf, but I do not know,
whether I need anything else.

Thanks for help,
Ignas A.



Re: [gentoo-user] Runlevels, ordering initscripts and running them in background

2012-05-16 Thread Canek Peláez Valdés
On Wed, May 16, 2012 at 3:40 AM, Ignas Anikevicius
anikevic...@gmail.com wrote:
 Hello everybody,

 I was wondering if the following is possible:
    - Add a lot of daemons to a newly created runlevel post-default
    - Switch to it after the xdm is started (or after some time)

 I want to do this, so that I do not have to wait while non-crucial
 services are being started (e.g. fcron, bitlbee, ntpd to name a few).
 Maybe it is possible to somehow prioritize the initscripts?

 Another related question is that I come from Arch and there I could just
 give the *order* of the daemons/initscripts to start and some of them
 could be started and 'in background'. Is it possible to do that with
 openrc? I saw the rc_parallel option in rc.conf, but I do not know,
 whether I need anything else.

Be aware that the rc_parallel option has never been really supported,
and it actually doesn't appear in the /etc/rc.conf of the one machine
I have access to that still uses OpenRC.

You may want to try systemd, it sounds like it does (out of the box)
exactly what you want to.

Regards.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México



Re: [gentoo-user] Runlevels, ordering initscripts and running them in background

2012-05-16 Thread Dale
Canek Peláez Valdés wrote:
 On Wed, May 16, 2012 at 3:40 AM, Ignas Anikevicius
 anikevic...@gmail.com wrote:
 Hello everybody,

 I was wondering if the following is possible:
- Add a lot of daemons to a newly created runlevel post-default
- Switch to it after the xdm is started (or after some time)

 I want to do this, so that I do not have to wait while non-crucial
 services are being started (e.g. fcron, bitlbee, ntpd to name a few).
 Maybe it is possible to somehow prioritize the initscripts?

 Another related question is that I come from Arch and there I could just
 give the *order* of the daemons/initscripts to start and some of them
 could be started and 'in background'. Is it possible to do that with
 openrc? I saw the rc_parallel option in rc.conf, but I do not know,
 whether I need anything else.
 
 Be aware that the rc_parallel option has never been really supported,
 and it actually doesn't appear in the /etc/rc.conf of the one machine
 I have access to that still uses OpenRC.
 
 You may want to try systemd, it sounds like it does (out of the box)
 exactly what you want to.
 
 Regards.


Just to add for the OP, this was discussed on -dev and it was removed,
although you can still try it if you want, a good while back because it
was causing problems.  I don't know anything much about systemsd but
according to the devs, you shouldn't use the parallel option with openRC
unless you want to keep up with the problems.

Dale

:-)  :-)

-- 
I am only responsible for what I said ... Not for what you understood or
how you interpreted my words!

Miss the compile output?  Hint:
EMERGE_DEFAULT_OPTS=--quiet-build=n



Re: [gentoo-user] Runlevels, ordering initscripts and running them in background

2012-05-16 Thread Neil Bothwick
On Wed, 16 May 2012 09:40:26 +0100, Ignas Anikevicius wrote:

 I want to do this, so that I do not have to wait while non-crucial
 services are being started (e.g. fcron, bitlbee, ntpd to name a few).
 Maybe it is possible to somehow prioritize the initscripts?

Yes it is. The initscripts themselves have such a mechanism, using the
before and after statements, for example making sure that network
services are started after the network is brought up. You can add your
own rules to the daemons' config files in /etc/conf.d or to /etc/rc.conf.

To have bitlbee start after xdm either add

rc_after=xdm 

to /etc/conf.d/bitlbee or put

rc_bitlbee_after=xdm

in /etc/rc.conf. Both have the same effect, it depends on whether you
want to put all these settings together or in the individual services'
config files.


-- 
Neil Bothwick

Tact is for people who don't understand sarcasm.


signature.asc
Description: PGP signature


Re: [gentoo-user] Runlevels, ordering initscripts and running them in background

2012-05-16 Thread Ignas Anikevicius
On 16/05/12 14:15, Neil Bothwick wrote:
 On Wed, 16 May 2012 09:40:26 +0100, Ignas Anikevicius wrote:
 
 I want to do this, so that I do not have to wait while non-crucial
 services are being started (e.g. fcron, bitlbee, ntpd to name a few).
 Maybe it is possible to somehow prioritize the initscripts?
 
 Yes it is. The initscripts themselves have such a mechanism, using the
 before and after statements, for example making sure that network
 services are started after the network is brought up. You can add your
 own rules to the daemons' config files in /etc/conf.d or to /etc/rc.conf.
 
 To have bitlbee start after xdm either add
 
 rc_after=xdm 
 
 to /etc/conf.d/bitlbee or put
 
 rc_bitlbee_after=xdm
 
 in /etc/rc.conf. Both have the same effect, it depends on whether you
 want to put all these settings together or in the individual services'
 config files.
 

Thanks for the tip!, I will use this to see how much difference do I
get. :)

Cheers,
Ignas



Re: [gentoo-user] Runlevels, ordering initscripts and running them in background

2012-05-16 Thread Ignas Anikevicius
On 16/05/12 13:13, Canek Peláez Valdés wrote:
 On Wed, May 16, 2012 at 3:40 AM, Ignas Anikevicius
 anikevic...@gmail.com wrote:
 Hello everybody,

 I was wondering if the following is possible:
- Add a lot of daemons to a newly created runlevel post-default
- Switch to it after the xdm is started (or after some time)

 I want to do this, so that I do not have to wait while non-crucial
 services are being started (e.g. fcron, bitlbee, ntpd to name a few).
 Maybe it is possible to somehow prioritize the initscripts?

 Another related question is that I come from Arch and there I could just
 give the *order* of the daemons/initscripts to start and some of them
 could be started and 'in background'. Is it possible to do that with
 openrc? I saw the rc_parallel option in rc.conf, but I do not know,
 whether I need anything else.
 
 Be aware that the rc_parallel option has never been really supported,
 and it actually doesn't appear in the /etc/rc.conf of the one machine
 I have access to that still uses OpenRC.
 
 You may want to try systemd, it sounds like it does (out of the box)
 exactly what you want to.
 
 Regards.

I did know, that this was removed. If I experience problems I'll remove
the option, but maybe I'll remove it all together.

I have systemd installed as I wanted to try, but I do not like the way
everything is managed. I like the idea of simple bash initscripts, which
can be easily extended if needed. I can also write bash scripts, which
configure my system the way I want (i.e. set battery charging thresholds
or something similar).

I do not care for a split second advantage, but I just do not see a lot
of point in waiting for bitlbee to start before xdm so that I might need
maybe a while after I boot into my computer.

Thanks for suggestions to everybody.

Cheers,
Ignas