LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-12-2003, 02:47 AM   #1
juanb
Member
 
Registered: May 2002
Posts: 401

Rep: Reputation: 30
Unhappy shutdown RH 8


I usually logged as a regular user. whan I want to shotdown the system I know I must su to root an than enter the command shutdown or init but whan I do that I recive command not fownd.

why?
 
Old 03-12-2003, 03:58 AM   #2
Silent Bob
Member
 
Registered: Feb 2003
Location: Ireland
Distribution: Debian
Posts: 56

Rep: Reputation: 15
shutdown is located in /sbin/ which isn't in a normal users $PATH. If you just run su it doesn't create a login shell so you don't get that users environment settings etc.

Short answer - if you use su you will have to run /sbin/shutdown

Otherwise run su - (that's su followed by a dash) and that makes it a login shell and you can run shutdown without having to specify it's path.
 
Old 03-12-2003, 03:58 AM   #3
mayankjohri
Member
 
Registered: Mar 2002
Location: INDIA
Distribution: Mandrake Linux 9.2, Knoppix 3.0
Posts: 158

Rep: Reputation: 30
because when you su to root the root profile file is not executed. first execute the profile file and this problem will fly away
#. /root/.bash_profile
 
Old 03-12-2003, 04:01 AM   #4
mayankjohri
Member
 
Registered: Mar 2002
Location: INDIA
Distribution: Mandrake Linux 9.2, Knoppix 3.0
Posts: 158

Rep: Reputation: 30
silent bob gave the correct answer.
Cheers for Silent BOB
 
Old 03-12-2003, 01:09 PM   #5
nakkaya
LQ Guru
 
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Rep: Reputation: 45
if you chmod 7755 /sbin/shutdown you can shutdown the machine as regular user
 
Old 03-12-2003, 02:37 PM   #6
Silent Bob
Member
 
Registered: Feb 2003
Location: Ireland
Distribution: Debian
Posts: 56

Rep: Reputation: 15
Quote:
Originally posted by nakkaya
if you chmod 7755 /sbin/shutdown you can shutdown the machine as regular user
True. But then ANY user logged in to your machine can shut it down...
 
Old 03-13-2003, 10:54 PM   #7
xzh2001
LQ Newbie
 
Registered: Mar 2003
Posts: 7

Rep: Reputation: 0
Quote:
Originally posted by Silent Bob
True. But then ANY user logged in to your machine can shut it down...
how i can do that?
 
Old 03-13-2003, 11:03 PM   #8
Crashed_Again
Senior Member
 
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503

Rep: Reputation: 57
How can you do what? Allow all users to be able to shutdown? nakkaya told us how to do it.
 
Old 03-15-2003, 10:50 AM   #9
chrisk5527
Member
 
Registered: Oct 2002
Location: Michigan
Distribution: Slackware Linux 10.0
Posts: 289

Rep: Reputation: 30
If you use the "su - root" it will load root's PATH and then you can just issue your shutdown command.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Please help on how to save services shutdown or shutdown from the terminal. wambuzz Linux - General 2 03-11-2005 07:38 AM
Linux full shutdown vs. manual shutdown? LQtoto Linux - General 9 01-26-2005 06:21 PM
unable to 'shutdown' from x... need to shutdown using 'halt' guitarnix Linux - Newbie 5 11-24-2003 01:00 AM
konsole shutdown possible? or key combo = shutdown possible? Laptop2250 Linux - Newbie 3 11-16-2003 10:44 AM
shutdown hang during eth0 shutdown kurtisw Linux - Networking 5 10-30-2003 02:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:52 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration