Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Gentoo User (http://www.linux-archive.org/gentoo-user/)
-   -   Runlevels, ordering initscripts and running them in background (http://www.linux-archive.org/gentoo-user/667343-runlevels-ordering-initscripts-running-them-background.html)

Ignas Anikevicius 05-16-2012 08:40 AM

Runlevels, ordering initscripts and running them in background
 
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.

Canek Peláez Valdés 05-16-2012 12:13 PM

Runlevels, ordering initscripts and running them in background
 
On Wed, May 16, 2012 at 3:40 AM, Ignas Anikevicius
<anikevicius@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

Dale 05-16-2012 12:35 PM

Runlevels, ordering initscripts and running them in background
 
Canek Peláez Valdés wrote:
> On Wed, May 16, 2012 at 3:40 AM, Ignas Anikevicius
> <anikevicius@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"

walt 05-16-2012 12:43 PM

Runlevels, ordering initscripts and running them in background
 
On 05/16/2012 01:40 AM, Ignas Anikevicius wrote:

> I want to do this, so that I do not have to wait while non-crucial
> services are being started

I can barely remember when I was young enough to care about saving
a few seconds. (But, good for you :)

Have you heard of systemd? Yet another evil conspiracy spawned by
Lennart Poettering, father of pulseaudio and scourge of old fossils
(like many of us here) who avoid any form of progress.

http://en.wikipedia.org/wiki/Systemd

My evil twin, Walter Dnes, has been agitating for systemd in this
mailing list for months. He actually knows how systemd works and
can be persuaded to... well, I expect he'll be along shortly to
tell you about it.

Neil Bothwick 05-16-2012 01:15 PM

Runlevels, ordering initscripts and running them in background
 
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.

Ignas Anikevicius 05-16-2012 02:50 PM

Runlevels, ordering initscripts and running them in background
 
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

Ignas Anikevicius 05-16-2012 02:55 PM

Runlevels, ordering initscripts and running them in background
 
On 16/05/12 13:13, Canek Peláez Valdés wrote:
> On Wed, May 16, 2012 at 3:40 AM, Ignas Anikevicius
> <anikevicius@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

"Walter Dnes" 05-17-2012 12:41 AM

Runlevels, ordering initscripts and running them in background
 
On Wed, May 16, 2012 at 05:43:50AM -0700, walt wrote

On 05/16/2012 01:40 AM__Ignas Anikevicius wrote:
_ ( ) __ ____
> I want to do ( )s, s (ha( do n( )e to wait while non-crucial
> services are__)
g __) ed) ( __) /
__ __( (__/ )( ( )
I can( ( (__) ( y) ou_h to care about saving
a few ) \_) )/ )( )
_ (__ ' (_/(__ ___
Ha(_)y__) )n( )cy spawned by
Lenna(___ S P L O R F _ /cou) )of old fossils
(like ma( ___ ____/f))ro(__/s.
_( ) _ ( ) __ ____ __) _ ( \_
htt(___)(_/i) i( (g/ (yste)( _/ ) \__)
(_____) ) ( __) / / ( (_
My evil twin_ Walter)(nes (as b(_/ agi) )g for systemd in this
mailing lis(_)or mo(__). ( )actually (___/ how systemd works and
can be persuaded to... wel)/ I(_)pect he'll be along shortly to
tell you about it. '

--
Walter Dnes <waltdnes@waltdnes.org>

walt 05-19-2012 05:13 PM

Runlevels, ordering initscripts and running them in background
 
On 05/16/2012 05:41 PM, Walter Dnes wrote:
> On Wed, May 16, 2012 at 05:43:50AM -0700, walt wrote
>
> On 05/16/2012 01:40 AM__Ignas Anikevicius wrote:
> _ ( ) __ ____
>> I want to do ( )s, s (ha( do n( )e to wait while non-crucial
>> services are__)
g __) ed) ( __) /
> __ __( (__/ )( ( )
> I can( ( (__) ( y) ou_h to care about saving
> a few ) \_) )/ )( )
> _ (__ ' (_/(__ ___
> Ha(_)y__) )n( )cy spawned by
> Lenna(___ S P L O R F _ /cou) )of old fossils
> (like ma( ___ ____/f))ro(__/s.
> _( ) _ ( ) __ ____ __) _ ( \_
> htt(___)(_/i) i( (g/ (yste)( _/ ) \__)
> (_____) ) ( __) / / ( (_
> My evil twin_ Walter)(nes (as b(_/ agi) )g for systemd in this
> mailing lis(_)or mo(__). ( )actually (___/ how systemd works and
> can be persuaded to... wel)/ I(_)pect he'll be along shortly to
> tell you about it. '


I love it! :-D

Naturally I immediately started planning to use it on other people,
but haven't figured out a way to automate it with sed or perl or
one of the other usual suspects. Very clever :)

Joost Roeleveld 05-20-2012 05:59 PM

Runlevels, ordering initscripts and running them in background
 
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


All times are GMT. The time now is 09:39 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.