How to control/overide shutdown/reboot process?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to control/overide shutdown/reboot process?
# 1  
Old 03-26-2007
How to control/overide shutdown/reboot process?

Dear all,

I want to control my server from shutting down and rebooting.
It will ask for some question before the process, ex: who are you? what is the reason for shutting down? ...

I think I can overide that binary of shutdown/reboot command, but it is confused.
We have many way to shutdown/reboot:
1. By using mouse.
2. Or many commands: halt, shutshown, reboot, poweroff, init 6.

Do you have any ideas?

Last edited by fongthai; 03-26-2007 at 02:04 AM.. Reason: change title
# 2  
Old 03-26-2007
Give the root password to only two people- you and one other you trust
That way only you can shutdown the server.
# 3  
Old 03-26-2007
No, you mis-understood my idea. It is not to secure root password, only to log the reason before shutdown/reboot (like Windows 2003 severs)
my idea is: "Admin users can shutdown/reboot, but everytime they want to reboot they have to answer some questions to keep record of servers shutdown/reboot".

Question could be like this:
1/ what is your name ?
2/ Reason of shutdown/reboot ?

And they may answer:
1/ John Mayer
2/ new package installed

After they answer those questions, the real shutdown/reboot process will start.

And we have log file record that:
[Date and time] [name] [action] [reason] [login from]
2007-03-25 15:02:21 John mayer reboot new package installed 192.168.0.5
...
# 4  
Old 04-09-2007
Anyone have an idea?
# 5  
Old 04-09-2007
Simple
1)write a script called "servershutdwn" that asks the quetions.
Log the results away in a log file, then executes the real shut down command.
2) do what we do. - All "re-boots" are auhthrised by my department and logged in spread sheet on a windows drive so that management gets a monthly report of re-boot activity.
3) i still reckon you should limit root access, say use "sudo" (for example)

It simply boils down to server security, procedures and policices
# 6  
Old 04-09-2007
Thank Andrek,

So how about the real shutdown binary?, I dont want it to run directly even by root account! So I'll make an alias to servershutdown script, is it OK?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Exit script when shutdown or reboot command is given

This is probably a simple question, but I'm new with writing scripts for Linux (IPFire in this case) and Google wasn't helpful with this. When creating a script, what is the best and/or proper way to have it exit automatically if the reboot or shutdown command is given? If that's even... (2 Replies)
Discussion started by: bartgrefte
2 Replies

2. Shell Programming and Scripting

Escape Sequence Overide in XML file

Hi I am try to use sed to remove decleration information from an XML file however their are special characters in the string and sed is not able to parse it . I am using the following commond. sed -e "s/xmlns=http://www.abc.com/integration/services/testtemplate1//g" Orginal.xml... (3 Replies)
Discussion started by: jimmyb
3 Replies

3. Linux

Reboot/Shutdown messages

Hi, I'm using 2.6.11 kernel on ARM 9. Below are the messages I get issuing different commands. When I give "reboot" I get run level 6 initiated and get the following messages. I have nothing to complaint about it. All the scripts in rc6.d are executed. The system is going down for reboot... (3 Replies)
Discussion started by: suryaemlinux
3 Replies

4. Shell Programming and Scripting

control timeout of sqlplus process

Hi, I'm using simple sqlplus to test DB availability. When DB is going down, sqlplus command is hang for a few minutes I want to implement the following: 1. execute sqlplus 2. if after 20 sec I dont get a response, kill the process and exit with error. 3. if I get immediate response... (2 Replies)
Discussion started by: gdan2000
2 Replies

5. UNIX for Advanced & Expert Users

shutdown and reboot unix server

Hi, please could someone advise the best command to shutdown and then for it to reboot back online again. Note: I shall be doing this from a telent session. regards venhart (3 Replies)
Discussion started by: venhart
3 Replies

6. UNIX for Dummies Questions & Answers

Shutdown and Reboot problem

Hi, i have sco openserver 5.0.6 but have a problem with shutdown or reboot commands. The string I use is "shutdown -g0 -y" but the system just hangs on "The sytem is down" . I used to get a "Safe to turn of" but now nothing. Same with "reboot" the sytem just freezes. Any suggestions? (1 Reply)
Discussion started by: VTechman
1 Replies

7. UNIX for Dummies Questions & Answers

init and process control

I'm trying to wrap my head around process control in Unix... particularly init and how it fits in to the equation. Init is responsible for creating sessions by spawning instances of getty which calls login effectively creating sessions right? Why then can init belong to a session? If you ps jx... (4 Replies)
Discussion started by: dexfantasy
4 Replies

8. UNIX for Advanced & Expert Users

control the process

I found that in my system , there are some strange process , it will make the system crash so I would like to control the system no such process is running , this is if the system process that its process name is "ora" AND its ppid is not "2" , then it will crash the system, can suggest how to... (2 Replies)
Discussion started by: ust
2 Replies

9. Programming

Reading a process control block

Hello, I want to know what call to use to read the details of a process control block in solaris ?:) (2 Replies)
Discussion started by: hmurali
2 Replies

10. Filesystems, Disks and Memory

unix process control

can anyone send me enything about "unix process control " nicko@freemail.com.mk (2 Replies)
Discussion started by: nicko
2 Replies
Login or Register to Ask a Question