Find the answer to your Linux question:
Results 1 to 9 of 9
Hello, OS: Red-hat 6 32bit. Installed on VM Player. While executing init 0 or with any syntax, it is showing the error " init: command not found ". I am ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2012
    Posts
    2

    Post Init: Command not found


    Hello,

    OS: Red-hat 6 32bit. Installed on VM Player.

    While executing init 0 or with any syntax, it is showing the error " init: command not found ".

    I am trying with root user but still getting the error. If i try with any standard user the it is showing " init: Need to be root ".

    Can someone help me for resolving this issue?

    Thanks In Advance

  2. #2
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    Hello and Welcome!

    As far as runlevels are concerned, init 0 would shutdown your machine. Why not just use:
    Code:
    shutdown -h now
    ?

    If you want to use init,
    try, as root:
    Code:
    telinit 0
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

  3. #3
    Just Joined!
    Join Date
    Jun 2012
    Posts
    2

    Post

    Quote Originally Posted by jayd512 View Post
    Hello and Welcome!

    As far as runlevels are concerned, init 0 would shutdown your machine. Why not just use:
    Code:
    shutdown -h now
    ?

    If you want to use init,
    try, as root:
    Code:
    telinit 0
    Hello Mr. Jay,
    Thanks for your reply

    I tried with the both commands suggested by you, but still the same error "telinit: command not found" & "shutdown: command not found".

    * One thing i have observed that if i change the runlevel 3 or 1 by editing /etc/inittab file, and reboot the machine, all the commands working * But only in run level 5 are not. *

    Thanks Again

  4. #4
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    I've never even thought of using telinit 0 to halt the system, but telinit must be run as root.

    The shutdown command must also be run as root.
    So :
    Code:
    su -
    <enter root password>
    shutdown -h now
    If you get an error, copy/paste the whole sequence here.
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

  5. #5
    Just Joined!
    Join Date
    May 2005
    Posts
    2
    send the output for:
    'echo $path'
    and
    cat /etc/passwd|grep -w root

    I think that your rc files for root are messed up.

  6. #6
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,307
    have you tried using the full path? e.g.:

    Code:
    /sbin/init
    why are you trying to call init directly, though? That is not usually the best way to change the runlevel.

  7. #7
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    Quote Originally Posted by atreyu View Post
    why are you trying to call init directly, though? That is not usually the best way to change the runlevel.
    Exactly right.
    There are other, better ways to change a runlevel.
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

  8. #8
    Just Joined!
    Join Date
    May 2011
    Posts
    3
    > There are other, better ways to change a runlevel.

    lemme know which are those

  9. #9
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    As root:
    Code:
    telinit 3
    to go to a console.

    Code:
    man telinit
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •