FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux General Discussion

 
 
LinkBack Thread Tools
 
Old 07-02-2010, 09:56 AM
"Kurt J. Bosch"
 
Default Sleep instead of rebooting or shutting down when debugging initscripts

Am 2010-06-30 23:47, schrieb Victor Lowther:

---
functions | 2 +-
rc.shutdown | 3 +++
2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/functions b/functions
index f1dce8a..2c80a59 100644
--- a/functions
+++ b/functions
@@ -4,7 +4,7 @@

# width:

-grep -q initdebug&& {
+grep -q initdebug /proc/cmdline&& {
exec 2>/dev/tty9
}


OK that fixes the stdin problem - but /proc won't be mounted when
this is sourced in rc.sysinit if someone doesn't use an initcpio.




diff --git a/rc.shutdown b/rc.shutdown
index 1081970..96b10f0 100755
--- a/rc.shutdown
+++ b/rc.shutdown
@@ -93,6 +93,9 @@ run_hook shutdown_poweroff

# Power off or reboot
printsep
+
+grep -q initdebug /proc/cmdline&& sleep 9999
+
if [[ $RUNLEVEL = 0 ]]; then
printhl "${C_H2}POWER OFF"
/sbin/poweroff -d -f -h -i
 
Old 07-02-2010, 11:40 AM
Victor Lowther
 
Default Sleep instead of rebooting or shutting down when debugging initscripts

On Fri, 2010-07-02 at 11:56 +0200, Kurt J. Bosch wrote:
> Am 2010-06-30 23:47, schrieb Victor Lowther:
> > ---
> > functions | 2 +-
> > rc.shutdown | 3 +++
> > 2 files changed, 4 insertions(+), 1 deletions(-)
> >
> > diff --git a/functions b/functions
> > index f1dce8a..2c80a59 100644
> > --- a/functions
> > +++ b/functions
> > @@ -4,7 +4,7 @@
> >
> > # width:
> >
> > -grep -q initdebug&& {
> > +grep -q initdebug /proc/cmdline&& {
> > exec 2>/dev/tty9
> > }
>
> OK that fixes the stdin problem - but /proc won't be mounted when
> this is sourced in rc.sysinit if someone doesn't use an initcpio.

True, That did not occur to me. I discovered the awesomeness of lvm too
many years ago, I suppose.

> >
> > diff --git a/rc.shutdown b/rc.shutdown
> > index 1081970..96b10f0 100755
> > --- a/rc.shutdown
> > +++ b/rc.shutdown
> > @@ -93,6 +93,9 @@ run_hook shutdown_poweroff
> >
> > # Power off or reboot
> > printsep
> > +
> > +grep -q initdebug /proc/cmdline&& sleep 9999
> > +
> > if [[ $RUNLEVEL = 0 ]]; then
> > printhl "${C_H2}POWER OFF"
> > /sbin/poweroff -d -f -h -i
>
>

--
Victor Lowther
LPIC2 UCP RHCE
 
Old 07-16-2010, 12:10 PM
Thomas Bächler
 
Default Sleep instead of rebooting or shutting down when debugging initscripts

Am 30.06.2010 23:47, schrieb Victor Lowther:
> ---
> functions | 2 +-
> rc.shutdown | 3 +++
> 2 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/functions b/functions
> index f1dce8a..2c80a59 100644
> --- a/functions
> +++ b/functions
> @@ -4,7 +4,7 @@
>
> # width:
>
> -grep -q initdebug && {
> +grep -q initdebug /proc/cmdline && {
> exec 2>/dev/tty9
> }
>
> diff --git a/rc.shutdown b/rc.shutdown
> index 1081970..96b10f0 100755
> --- a/rc.shutdown
> +++ b/rc.shutdown
> @@ -93,6 +93,9 @@ run_hook shutdown_poweroff
>
> # Power off or reboot
> printsep
> +
> +grep -q initdebug /proc/cmdline && sleep 9999
> +
> if [[ $RUNLEVEL = 0 ]]; then
> printhl "${C_H2}POWER OFF"
> /sbin/poweroff -d -f -h -i

Seems nice. I'll still omit the initdebug patches for now and rethink
this, for some reason I don't like this yet.
 

Thread Tools




All times are GMT. The time now is 10:00 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org