Re: Linuxrc runs with PID 7

2001-02-01 Thread Russell King

Firstly, a /linuxrc script can't be PID 1.  Check the bottom of
do_basic_setup in init/main.c:

pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);

Since do_basic_setup is already PID 1, /linuxrc won't be.

If you need /linuxrc to be PID 1, don't call it /linuxrc, but /sbin/init,
/etc/init or /bin/init.

--
Russell King ([EMAIL PROTECTED])The developer of ARM Linux
 http://www.arm.linux.org.uk/personal/aboutme.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Linuxrc runs with PID 7

2001-02-01 Thread Rogier Wolff

Paul Powell wrote:
> This is a followup question to my previous question
> "Why isn't init at PID 1."
> 
> Previoulsy I was calling init from within linuxrc. 
> Linuxrc was a sash script, so the sash script
> supposedly had PID 1.  Now I've removed the script and
> have a C program for linuxrc.
> 
> I'm still not running at PID 1 but at 7.  The linuxrc
> program looks like:
> 
> int main(int argc, char* argv[])
> {
>printf("PID = %i\n", getpid());
> }
> 
> When I boot and linuxrc is executed, PID equals 7.
> 
> Any ideas as to why this is and how I can run at PID
> 1?

Yes, I've noticed this too. 

I concluded that to the kernel there is something magic about
"init=/bin/someprogram":  The program doesn't get PID 1 anymore. 

I used to have a script there fire up X and then exec init inside an
Xterm. I gave up on this after that junk started happening.

Oh, and Init refuses to be useful if it doesn't end up with PID 1. 

Roger. 

-- 
** [EMAIL PROTECTED] ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* There are old pilots, and there are bold pilots. 
* There are also old, bald pilots. 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Linuxrc runs with PID 7

2001-02-01 Thread Rogier Wolff

Paul Powell wrote:
 This is a followup question to my previous question
 "Why isn't init at PID 1."
 
 Previoulsy I was calling init from within linuxrc. 
 Linuxrc was a sash script, so the sash script
 supposedly had PID 1.  Now I've removed the script and
 have a C program for linuxrc.
 
 I'm still not running at PID 1 but at 7.  The linuxrc
 program looks like:
 
 int main(int argc, char* argv[])
 {
printf("PID = %i\n", getpid());
 }
 
 When I boot and linuxrc is executed, PID equals 7.
 
 Any ideas as to why this is and how I can run at PID
 1?

Yes, I've noticed this too. 

I concluded that to the kernel there is something magic about
"init=/bin/someprogram":  The program doesn't get PID 1 anymore. 

I used to have a script there fire up X and then exec init inside an
Xterm. I gave up on this after that junk started happening.

Oh, and Init refuses to be useful if it doesn't end up with PID 1. 

Roger. 

-- 
** [EMAIL PROTECTED] ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* There are old pilots, and there are bold pilots. 
* There are also old, bald pilots. 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Linuxrc runs with PID 7

2001-02-01 Thread Russell King

Firstly, a /linuxrc script can't be PID 1.  Check the bottom of
do_basic_setup in init/main.c:

pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD);

Since do_basic_setup is already PID 1, /linuxrc won't be.

If you need /linuxrc to be PID 1, don't call it /linuxrc, but /sbin/init,
/etc/init or /bin/init.

--
Russell King ([EMAIL PROTECTED])The developer of ARM Linux
 http://www.arm.linux.org.uk/personal/aboutme.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Linuxrc runs with PID 7

2001-01-31 Thread bert hubert

On Wed, Jan 31, 2001 at 11:23:38AM -0800, Paul Powell wrote:
> This is a followup question to my previous question
> "Why isn't init at PID 1."

Lots of stuff assumes that PID 0 is the idle task, and that PID 1 is init.
For example, the kernel disallows ptraceing of init, based on its pid of 1.

If you are PID 1, make sure that you handle SIGCHLDs etcetera from daemons.
Check the source of init, I suspect it does something which tells the kernel
'I am your init'.

Regards,

bert hubert

-- 
PowerDNS Versatile DNS Services  
Trilab   The Technology People   
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Linuxrc runs with PID 7

2001-01-31 Thread Paul Powell

This is a followup question to my previous question
"Why isn't init at PID 1."

Previoulsy I was calling init from within linuxrc. 
Linuxrc was a sash script, so the sash script
supposedly had PID 1.  Now I've removed the script and
have a C program for linuxrc.

I'm still not running at PID 1 but at 7.  The linuxrc
program looks like:

int main(int argc, char* argv[])
{
   printf("PID = %i\n", getpid());
}

When I boot and linuxrc is executed, PID equals 7.

Any ideas as to why this is and how I can run at PID
1?

Thanks,
Paul

__
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Linuxrc runs with PID 7

2001-01-31 Thread Paul Powell

This is a followup question to my previous question
"Why isn't init at PID 1."

Previoulsy I was calling init from within linuxrc. 
Linuxrc was a sash script, so the sash script
supposedly had PID 1.  Now I've removed the script and
have a C program for linuxrc.

I'm still not running at PID 1 but at 7.  The linuxrc
program looks like:

int main(int argc, char* argv[])
{
   printf("PID = %i\n", getpid());
}

When I boot and linuxrc is executed, PID equals 7.

Any ideas as to why this is and how I can run at PID
1?

Thanks,
Paul

__
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: Linuxrc runs with PID 7

2001-01-31 Thread bert hubert

On Wed, Jan 31, 2001 at 11:23:38AM -0800, Paul Powell wrote:
 This is a followup question to my previous question
 "Why isn't init at PID 1."

Lots of stuff assumes that PID 0 is the idle task, and that PID 1 is init.
For example, the kernel disallows ptraceing of init, based on its pid of 1.

If you are PID 1, make sure that you handle SIGCHLDs etcetera from daemons.
Check the source of init, I suspect it does something which tells the kernel
'I am your init'.

Regards,

bert hubert

-- 
PowerDNS Versatile DNS Services  
Trilab   The Technology People   
'SYN! .. SYN|ACK! .. ACK!' - the mating call of the internet
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/