Understanding shutdown


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Understanding shutdown
# 1  
Old 02-16-2009
Question Understanding shutdown

Hi there,
I start using the function shutdown instead of reboot + poweroff.
But there are some points that are not explained in the man pages.

1) What is the usage of the t swith.
Quote:
shutdown 22:30 'Beware!'
shutdown -t 30 22:30 'Beware!'
Both commands will display the message immediatly on every terminal and shutdown at 22:30. Where is the difference?

2) Can I specify the date/time like in the date command?
Quote:
supernova:~# date
Mon Feb 16 22:33:45 CET 2009
supernova:~# date -d 'now + 1 minute'
Mon Feb 16 22:34:49 CET 2009
supernova:~# shutdown 'now + 1 minute'
Usage: shutdown [-akrhHPfnc] [-t secs] time [warning message]
[...]
supernova:~#
Thanks for your help
Santiago
# 2  
Old 02-16-2009
Post the output of "uname -a" so we know what OS you're using.
# 3  
Old 02-16-2009
Hi Perderabo, here is the result:
Quote:
Linux supernova.caoba.fr 2.6.27.10-grsec-xxxx-grs-ipv4-32 #3 SMP Wed Feb 4 19:28:53 UTC 2009 i686 GNU/Linux
It's a Debian
# 4  
Old 02-16-2009
You should have a man page that states

"-t sec
Tell init(8) to wait sec seconds between sending processes the warning and the kill signal, before changing to another runlevel."

When the shutdown occurs, a program called init must kill running processes. To do this it first does the equivalent of a "kill -15 pid" and if that doesn't work, it will do the equivalent of a "kill -9 pid". The -t is affecting how long init waits between the two kills. The default is 5 seconds. So a "-t 120" might take longer to complete the shutdown. But if the first kill works, init will never try the second kill. In that case, the -t could have no effect at all.
# 5  
Old 02-16-2009
Thanks Perderabo, I quite understand.
With my little knowledge, I thought that the warning sent before the kill signal was the message displayed by shutdown. That's why I was confused to see that this warning message was displayed exactly the same in both cases.
About my other question, do you have any clue?
I'd like to be have a command to reboot my server giving the other users 5 minuts to close their work in progress. How can I achieve something like:
Code:
shutdown -r 'now + 5 minute' 'beware, rebooting in 5 minutes!'

# 6  
Old 02-16-2009
You really need to read that man page.

"The time argument can have different formats. First, it can be an absolute time in the format hh:mm, in which hh is the hour (1 or 2 digits) and mm is the minute of the hour (in two digits). Second, it can be in the format +m, in which m is the number of minutes to wait. The word now is an alias for +0."


If you want to wait 5 minutes it's just +5.
# 7  
Old 02-17-2009
You're right Perderabo, I have been really distracted on that point.
Everything's clear now.
Thanks for your help.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

plink shutdown

Hi, I'm testing out this plink script - which will be executed to shutdown multiple LPARs. This consists from: plink -i /path/ssh/cert/ root@host shutdown -F plink -i /path/ssh/cert/ root@host2 shutdown -F The commands gets executed, however it stops on one host, and does not move... (6 Replies)
Discussion started by: ollie01
6 Replies

2. UNIX for Dummies Questions & Answers

Script to force Oracle database shutdown when shutdown immediate does not work

I have Oracle 9i R2 on AIX 5.2. My Database is running in shared server mode (MTS). Sometimes when I shutdown the database it shutsdown cleanly in 4-5 mints and sometimes it takes good 15-20 minutes and then I get some ora-600 errors and only way to shutdown is by opening another session and... (7 Replies)
Discussion started by: aixhp
7 Replies

3. Solaris

shutdown question

Hi is shutdown and init 0 are same command in solaris? (2 Replies)
Discussion started by: mokkan
2 Replies

4. AIX

server is getting shutdown

Hi Guys, Please help in this...when we start HACMP services ..server is getting shutdon. Error mesg from cluster.log. Apr 14 08:43:27 bascop17 snmpd: NOTICE: SMUX trap: (0 0) (127.0.0.1+46302+1) Apr 14 08:43:33 bascop17 topsvcs: (Recorded using libct_ffdc.a cv 2):::Error ID:... (1 Reply)
Discussion started by: b_manu78
1 Replies

5. HP-UX

Shutdown script

Hi, I am on Alpha Server with HP Tru64 system. I wish to setup shutdown to automatically and cleanly shutdown informix during the shutting down of the system. Ie. I was trying to use rc0.d to do this but failed. Has anyone tried doing this before? I already have the script and linked it to... (0 Replies)
Discussion started by: kingsto88
0 Replies

6. UNIX for Advanced & Expert Users

Shutdown

Firstly uname -a = UnixWare companyname 5 7.1.4 i386 x86at SCO UNIX_SVR5 Server is an HP Proliant ML350 G4 Tower Right, now to the problem. We frequently have power outtages and lightning strikes here due to our location in a VERY rural part of the UK. As such, I need to be able to remotely... (6 Replies)
Discussion started by: aewpcoles
6 Replies

7. UNIX for Advanced & Expert Users

Shutdown script

Hi Guys, I want to execute few of my bash script, so that whenever someone calls shutdown now -r command, I want my script to execute first before shutting down. Any help please????? I've just started playing with the unix system, so far its been brilliant.... (10 Replies)
Discussion started by: alpha_manic
10 Replies

8. UNIX for Dummies Questions & Answers

How do you shutdown from login?

Hello all - On some of the systems we use - AlphaServer es40 Tru64 digital unix - you can login with the username: shutdown - with no password - and it shuts down the system gracefully. I've tried to trace what's going on in the system, but to no avail. I've been searching the web, but... (1 Reply)
Discussion started by: kapolani
1 Replies

9. SuSE

Shutdown scripts

Hello all I'm trying to automate the startup/shutdown of my database whenever the OS is bounced ... OS : Linux (Kernel : 2.4.20.-6) Oracle : 9.2.0.5 The contents of /etc/init.d/dbora file is listed below case "$1" in 'start') su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart"... (1 Reply)
Discussion started by: luft
1 Replies

10. UNIX for Advanced & Expert Users

to shutdown

Hai Could somebody tell me the solution to my problem. the question is as follows there is one unix server and 100 dummy terminals connected to my server, i want to shutdown client system if some of the client forgetten to power down their system. plez provide me the code for that. (2 Replies)
Discussion started by: rajashekaran
2 Replies
Login or Register to Ask a Question