Init 6 & Init 0 problem

Hi Expert,

I have encountered some problem with my SUN system. Everytime when i issue command #init 6 OR #init 0 it just logout and prompt for login again instead of rebooting the server when run init 6 and system shutdown when run init 0..

I can only reboot the system using reboot ... Was wondering what happen to the system ???

Unable to find any solution from the SUN website..

Appreciate anyone can help...

First off, the command to switch runlevels is not "init", but "telinit". I don't now about Sun machines, on AIX "init" and "telinit" do the same, so that may be no problem.

Possible places to look for problems: /etc/inittab and /etc/rc.d/rc<n>.d, where <n> is the number of the runlevel making problems.

Hope this helps.

bakunin

FYI this is not strictly true on Suns. The telinit command (/etc/telinit) is simply a soft link to /sbin/init. So strickly speaking init it the command and telinit is the alias.

Does ths shutdown command do the same thing for you? You can change system runtime levels with it in much the same way as init except there is a slight delay even if you specify 0 delay :slight_smile:

For init level 0, no wait time, dont ask for confirmation:

shutdown -g0 -i0 -y

For init level 6, no wait time, dont ask for confirmation:

shutdown -g0 -i6 -y

Suggest you look at your init command - First, find out which one you are using
# which init
If it's /usr/sbin/init, then check on another server running the same version of Solaris for the file - check that the patch levels are the same and run a checksum against both init files and compare the output. If they are different, then one may be corrupt (make sure both servers are at the same level of patching)
# sum /usr/sbin/init

Using the shutdown command as suggested by Unbeliever is good advice since the shutdown command is just a script which runs a /sbin/init command at the end of the script.

Gah .. I really should explain myself better sometimes :slight_smile:

As RTM correctly points out shutdown is simply a script which then calls /sbin/init. His suggestion to determine which init you are running is a good one.

/usr/sbin/init and /sbin/init are *not* the same (one is statically linked the other dynamically) and you should try both to see if they do different things.

If /sbin/init doesn't work and /usr/sbin/init does then its possible that /sbin/init is corrupt. If /sbin/init works and /usr/sbin/init doesnt then /usr/sbin/init and/or one of the files it depends on (use: ldd /usr/sbin/init) maybe corrupt.

My guess is that one of the scripts in /etc/rc0.d is hanging. Do an ls -l in that directory and check the recent additions. If not that, my next guess would be that /sbin/uadmin is missing or corrupt.

The fact that it logs you out and asks for a login prompt instead of changing runlevels, plus the fact that it isn't giving any error messages or locking up makes me think somebody did this on purpose. If the init file was corrupted I would expect worse behavior than just logging you out.

Check root's login scripts and see if anybody aliased init 0 and init 6 to logout or something similar. Maybe this was done as a way to prevent mistakes, similar to how some people alias rm to rm -i . . . .