Results 1 to 2 of 2

Thread: PATH variable - strange behaver.

  1. #1

    Default PATH variable - strange behaver.

    Hi everybody!!

    i am installed the openSUSE 11.2 from scratch.
    now i see something strange goes here...
    when i ran the command: "sudo init 3", i got the error:
    "sudo: init: command not found"

    so i checked the PATH variable and didn't saw /sbin in there, so i added it.
    after that i could run init as normal.

    but the strange thing here, that after restarting the system i saw that all the change i did to the PATH variable are gone...

    What is the problem, how can i solve this issue?

    Thank you very much!

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    24,851

    Default Re: PATH variable - strange behaver.

    You should do
    Code:
    sudo -i init 3
    This will give you a login shell (for root) and thus the startup scripts of the root login shell and thus the correct initialized PATH variable for root (which is different from the one initialized for you). See the man page of sudo.

    Also, as every variable in the environment, the PATH variable belongs to a process (the bash you are running in this case). As soon as that process halts, it is gone. In this case: as soon as you log out it is gone. Let alone when you reboot the system.
    Henk van Velden

Tags for this Thread

Posting Permissions

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