LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-01-2005, 07:56 PM   #1
iclinux
Member
 
Registered: Dec 2004
Posts: 69

Rep: Reputation: 15
respawn--about "/etc/inittab"


hi,there

I copy a console program named TEST to the directory "/sbin" , and
append "2:2345:respawn:/sbin/TEST" to the end of the file "/etc/inittab".

I thought init would call TEST automatically when OS reboot, and if TEST exited, init would call it again.

But when I reboot my system, I find TEST isn't called.

What's the matter?

Regards.
 
Old 02-01-2005, 10:37 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
That should work, AFAIK. is there anything in your logs about it? If the process continuously quits, init may complain about having to respawn it too quickly. beyond that, I can't really help much.
 
Old 02-01-2005, 11:38 PM   #3
iclinux
Member
 
Registered: Dec 2004
Posts: 69

Original Poster
Rep: Reputation: 15
btmiller

there's no log file

dose it work well on your pc?
 
Old 02-02-2005, 12:44 AM   #4
iclinux
Member
 
Registered: Dec 2004
Posts: 69

Original Poster
Rep: Reputation: 15
it works now. I forgot to make it a daemon...

But there're 10 process in the OS, I don't know why.

what's the detailed mean of "2:2345:respawn:/sbin/TEST" ?

Code:
#include <stdio.h>
#include <unistd.h>

int main(int argc, char *argv[])
{
	if (fork()) return 0;

	int i = 0;
	while (true) {
		if (i++ > 300) break;
	  	sleep(1);
	}
	return 0;
}
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what is "sticky bit mode" , "SUID" , "SGID" augustus123 Linux - General 10 08-03-2012 04:40 AM
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 11:26 AM
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
The inittab line "ud::once:/sbin/update" and mdk 9.1 Wasteed Mandriva 0 09-03-2003 07:04 AM
no automatic startx and /etc/inittab set at "5" chess Linux - General 2 03-05-2002 03:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration