Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Gentoo: User

[OT] interrupting runscripts during startup

 

 

Gentoo user RSS feed   Index | Next | Previous | View Threaded


amitds at oversi

Nov 19, 2009, 2:02 PM

Post #1 of 5 (249 views)
Permalink
[OT] interrupting runscripts during startup

Hi all.

When hitting Ctrl-C during startup, I manage to interrupt services at
the early stages of init, yet later-on I can no-longer do this. It seems
that up till runlevel 'default', services can be hit with the interrupt.
I'm wondering where is this behavior being set, and whether I can enable
the interruption by SIGINT in 'default' level runscripts (e.g.
'local.start'). I'm suspecting this is somewhere in /sbin/init, but
can't ascertain this.
Anyone knows?
thanks,
Amit


ragermany at gmx

Nov 19, 2009, 3:45 PM

Post #2 of 5 (228 views)
Permalink
Re: [OT] interrupting runscripts during startup [In reply to]

On Fri, 20 Nov 2009 00:02:47 +0200 Amit Dor-Shifer <amitds [at] oversi>
wrote:
> When hitting Ctrl-C during startup, I manage to interrupt services at
> the early stages of init, yet later-on I can no-longer do this. It
> seems that up till runlevel 'default', services can be hit with the
> interrupt.

Why do you want to stop services by hitting CTRL-C ? Services are
shell scripts. Hitting CTRL-C stops the script somewhere in the
middle during its execution. Everything that was done until that moment
won't be automagically undone. There can be files left , and processes
already started will still run. That's not clean.

Better use the interactive init feature. Just hit 'I' when init starts
(init even tells you, that you can do it) and choose which services to
start by hitting 'y' and 'n'.


Cheers,
Renat

--
Probleme kann man niemals mit derselben Denkweise loesen,
durch die sie entstanden sind.
(Einstein)
Attachments: signature.asc (0.19 KB)


amitds at oversi

Nov 20, 2009, 7:56 AM

Post #3 of 5 (228 views)
Permalink
Re: [OT] interrupting runscripts during startup [In reply to]

My interest is foremost trivial. Not necessarily related to the
application of such interrupts.
Nevertheless, with regards to the post:
* runscripts can (and AFAIK do) trap and handle SIGINT.
* the interactive mode is ok for interrupting the init process between
scripts. But I can't interrupt a script while it's running with 'I', and
with SIGINT, I can.

Amit

Renat Golubchyk wrote:
> On Fri, 20 Nov 2009 00:02:47 +0200 Amit Dor-Shifer <amitds [at] oversi>
> wrote:
>
>> When hitting Ctrl-C during startup, I manage to interrupt services at
>> the early stages of init, yet later-on I can no-longer do this. It
>> seems that up till runlevel 'default', services can be hit with the
>> interrupt.
>>
>
> Why do you want to stop services by hitting CTRL-C ? Services are
> shell scripts. Hitting CTRL-C stops the script somewhere in the
> middle during its execution. Everything that was done until that moment
> won't be automagically undone. There can be files left , and processes
> already started will still run. That's not clean.
>
> Better use the interactive init feature. Just hit 'I' when init starts
> (init even tells you, that you can do it) and choose which services to
> start by hitting 'y' and 'n'.
>
>
> Cheers,
> Renat
>
>


marcusw at cox

Nov 20, 2009, 8:13 AM

Post #4 of 5 (224 views)
Permalink
Re: [OT] interrupting runscripts during startup [In reply to]

On 11/19/2009 6:45 PM, Renat Golubchyk wrote:
> Better use the interactive init feature. Just hit 'I' when init starts
> (init even tells you, that you can do it) and choose which services to
> start by hitting 'y' and 'n'
(actually 1, 2, 3, and 4)

Marcus


wonko at wonkology

Nov 23, 2009, 10:19 AM

Post #5 of 5 (215 views)
Permalink
Re: [OT] interrupting runscripts during startup [In reply to]

Renat Golubchyk writes:

> On Fri, 20 Nov 2009 00:02:47 +0200 Amit Dor-Shifer <amitds [at] oversi>
> wrote:
> > When hitting Ctrl-C during startup, I manage to interrupt services at
> > the early stages of init, yet later-on I can no-longer do this. It
> > seems that up till runlevel 'default', services can be hit with the
> > interrupt.
>
> Why do you want to stop services by hitting CTRL-C ?

I do this when a periodic files system check of a large partition kicks in
and I do not want to spend the time waiting for it.
Other things I like to interrupt are long timeouts, e.g. while some
program waits for a server to respond, but I do not have an internet
connection at the moment. I had this problem with an annoyingly large NTP
timeout (it seems to be much smaller these days), and I wished I could
have stopped it.

Wonko

Gentoo user RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.