Thank you all for the response.
First of all i knew there is a way to do a smooth shutdown but i wanted to
do the reboot unattended.
I think the best answer came from Frank Wortner:
"You're right -- shutdown -r doesn't transition through run levels.  To do
the transitions,  you have to do a "shutdown" to single user mode,  and then
do a "reboot".  This is fine,  unless you want to do an unattended reboot.
One way to accomplish the latter would be to place some sort of marker --
probably a file like "/.reboot_me" -- and add logic to root's .profile --
which is run on on transition to single user mode -- to automatically reboot
based on the existence of that marker.  I used to do this years ago on a Sun
boxes,  but I think you can still do this today on Digital.
if [ -f /.reboot_me ]
then
        rm -f /.reboot_me
        /sbin/reboot
fi"
Another way to accomplish this is with Degerness solution:
"To shut the system down (only) you need to execute init 0 to run through
the
shutdown scripts.
I have been playing with writing a level 6 init script (on most System V
UNIXs, init 6 does a reboot).  It would be a fairly simple matter to add the
entry into /etc/inittab and copy and modify the /sbin/rc0 script to perform
reboot rather than halt"
Thank you all.
Zeev Fisher
System Unix
Tel - 972-9-7762400
E-mail:zeevf_at_amdocs.com
Received on Tue Oct 26 1999 - 04:42:00 NZDT