[CALUG] Difference between telinit and init

James Ewing Cottrell 3rd JECottrell3 at Comcast.NET
Fri Aug 25 21:43:21 CDT 2006



Gregory Haase wrote:
> init -t appears to work, although that would be an "undocumented
> feature" as far as the man page is concerned.

They are the same program. I didn't realize that they even HAD a -t 
option. I doubt that may people use it.
> 
> I don't understand why your second answer is "better yet" - It looks
> like a CLI hack for solving a problem that already has a viable solution.

Funny, I was going to say the same thing, only in reverse. We're already 
in CLI mode. And sleep is Ancient, occurring as early as UNIX V5. That's 
pre-1976. Telinit, and the new init, come from System III or System V, 
which is a good 10 years later.

As for it being a hack, remember the Unix Philosophy: There is One Tool 
for every job. The sleep command is the way to delay. You don't go 
around hacking "-t delay" into every command. It's Just Stupid!

> The real true difference between init and telinit is that init always
> carries a PID of 1 whereas telinit will acquire a separate PID as any
> other process in the system. Although I have no idea why this would
> actually matter in the grand scheme of things.

The original init process does indeed have a PID of 1, but people don't 
generally use "telinit". They use "init" to change run states.

At one time they might have even been separate programs, but then some 
programmer realized that they would do better as one, but the name stuck.

JIM

> -G
> 
> James Ewing Cottrell 3rd wrote:
> 
>>And what does "init -t 300 3" do? Better yet, what does "(sleep 300;
>>exec init 3)&" do?
>>
>>JIM
>>
>>Gregory Haase wrote:
>>
>>>If you look at the man page for init or telinit (actually the same page
>>>on my machine), you will see that other than including a runlevel after
>>>the command, the two have different switches - specifically, telinit
>>>includes the -t switch which allows you to add a time component to the
>>>command.
>>>
>>>Running init 3 will instantly cause the init process change the runlevel
>>>
>>>Running telinit -t 300 3 will cause the init process to change the
>>>runlevel in 5 minutes.
>>>
>>>-Greg
>>>
>>>James Ewing Cottrell 3rd wrote:
>>>
>>>
>>>>Which brings up the question: Why TF does "telinit" exist in the
>>>>first place? What's wrong with simply typing "init 1"? Nothing!
>>>>
>>>>JIM
>>>>
>>>>Gary wrote:
>>>>
>>>>
>>>>>Hi,
>>>>>
>>>>>I usually accomplish this with the "telinit" command:  "telinit 1"
>>>>>
>>>>>This drops you into runlevel 1, which is single-user mode. 
>>>>>Networking isn't typically enabled in runlevel 1, but you
>>>>>probably don't need it if the NVIDIA driver resides on the
>>>>>local machine.  Depending on the Linux distro, you might
>>>>>also try "telinit 3", which is multi-user command console
>>>>>mode in RedHat and Fedora Core distros.
>>>>>Good Luck,
>>>>> Gary.
>>>>>
>>>>>Edward D. Browne wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Hmmm, guess I haven't needed to do this since quite a few
>>>>>>releases ago.  I'm trying to upgrade my graphics driver
>>>>>>(to NVIDIA-Linux-x86-1.0-8762-pkg1.run), which means
>>>>>>I have to get out of X.  As I recall, there was always a menu
>>>>>>option at the login screen to log in without X running, but now
>>>>>>with RH AS3, I see no such option.  Killing X, and everything
>>>>>>that looks connected to X, only results in it automatically
>>>>>>restarting.   init 3 or 4 or 5 or 6 (it doesn't seem to matter)
>>>>>>just causes the machine to reboot all the way back to run
>>>>>>level 6.  What obvious solution am I missing?
>>>>>>
>>>>>>TIA - Ed
>>>>>>_______________________________________________
>>>>>>Columbia, Maryland Linux User's Group (CALUG) mailing list
>>>>>>CALUG Website: http://www.calug.com
>>>>>>Email postings to: lug at calug.com
>>>>>>Change your list subscription options:
>>>>>>http://calug.com/mailman/listinfo/lug
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>_______________________________________________
>>>>>Columbia, Maryland Linux User's Group (CALUG) mailing list
>>>>>CALUG Website: http://www.calug.com
>>>>>Email postings to: lug at calug.com
>>>>>Change your list subscription options:
>>>>>http://calug.com/mailman/listinfo/lug
>>>>>
>>>>
>>>>_______________________________________________
>>>>Columbia, Maryland Linux User's Group (CALUG) mailing list
>>>>CALUG Website: http://www.calug.com
>>>>Email postings to: lug at calug.com
>>>>Change your list subscription options:
>>>>http://calug.com/mailman/listinfo/lug
>>>
>>>_______________________________________________
>>>Columbia, Maryland Linux User's Group (CALUG) mailing list
>>>CALUG Website: http://www.calug.com
>>>Email postings to: lug at calug.com
>>>Change your list subscription options:
>>>http://calug.com/mailman/listinfo/lug
>>>
> 
> _______________________________________________
> Columbia, Maryland Linux User's Group (CALUG) mailing list
> CALUG Website: http://www.calug.com
> Email postings to: lug at calug.com
> Change your list subscription options: http://calug.com/mailman/listinfo/lug
> 


More information about the lug mailing list