LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Method to reinitialize init process whithout rebooting the system (https://www.linuxquestions.org/questions/programming-9/method-to-reinitialize-init-process-whithout-rebooting-the-system-297671/)

vinaybms 03-04-2005 12:40 PM

Method to reinitialize init process whithout rebooting the system
 
Hi geeks,

Is there any Method to reinitialize init process whithout rebooting the system. I mean the init process should be killed and reinitialized to previous state. if u know pls respond as quick as possible.

Thanks in advance.

Vinay

dwrose 03-04-2005 12:51 PM

Quick googling shows that /sbin/telinit -q will send the init process the correct signals to have it reread inittab. Note: playing around with init is not for the faint of heart. You should really know what you are doing or its possible to disable part or all of your system. There is also in the man page of init description of how to test init by running it in user space using an alternate directory as the root as far as the test is concerned.

Here is an excerpt from its man page:

TELINIT
/sbin/telinit is linked to /sbin/init. It takes a one-
character argument and signals init to perform the appro-
priate action. The following arguments serve as direc-
tives to telinit:

9 March 1998 2

0,1,2,3,4,5 or 6
tell init to switch to the specified run level.

a,b,c tell init to process only those /etc/inittab file
entries having runlevel a,b or c.

Q or q tell init to re-examine the /etc/inittab file.

S or s tell init to switch to single user mode.

U or u tell init to re-execute itself (preserving the
state). No re-examining of /etc/inittab file hap-
pens. Run level should be one of Ss12345, otherwise
request would be silently ignored.

telinit can also tell init how long it should wait between
sending processes the SIGTERM and SIGKILL signals. The
default is 5 seconds, but this can be changed with the -t
sec option.

telinit can be invoked only by users with appropriate
privileges.

The init binary checks if it is init or telinit by looking
at its process id; the real init's process id is always 1.
From this it follows that instead of calling telinit one
can also just use init instead as a shortcut.

jlliagre 03-04-2005 03:38 PM

If you are using Solaris 10, you can use zones.
Each zone has its own init process so you can effectively restart a zone (i.e. reboot it) in seconds, without hard rebooting the system, so with the kernel staying alive.
FreeBSD Jails may provide this or a similar feature too.

vinaybms 03-05-2005 03:46 AM

Hi jlliagre,

Thanks for your reply, I am using solaris 8. could you please tell me if there is an equivalent thing in solaris 8?

jlliagre 03-05-2005 05:40 AM

Nope, this is one of the new features of Solaris 10. Why not upgrading ? Solaris 10 is free.


All times are GMT -5. The time now is 09:35 PM.