Sponsored Content
Operating Systems Linux Fedora Script for shutting down 48 computers Post 302941469 by jim mcnamara on Thursday 16th of April 2015 09:09:47 AM
Old 04-16-2015
If you shut down the computer the script is executing on - e.g., ACC36 is first in the list, you've lost scripting process. No more shutdowns. Be sure to run the script on the LAST ACCxxx box in your list of computers.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to get IP addresses of LAN computers

I need a shell script for OS X, one that can find IP addresses of machines connected to my LAN, get the names of the computer associated with those addresses, then display them like so in a list: "Bob's L33T Boxx: #.#.#.#" Something like the network scanner in Apple Remote Desktop is what I'm... (1 Reply)
Discussion started by: sladuuch
1 Replies

2. UNIX for Advanced & Expert Users

Shutting down Solaris

Hi I have a mix of solaris 8,9 & 10. I need to have our 6 Solaris servers shutdown buy a script that will be executed by APC network Shutdown software Im really not sure how I would write a script to shut them down and the following processes? the processes are portmapper seq seq_api... (1 Reply)
Discussion started by: tonysequoia
1 Replies

3. UNIX for Dummies Questions & Answers

Shutting down the Server

Hi Is there anyway i can find out from which terminal a shutdown command has been run from ? :( (3 Replies)
Discussion started by: ktech
3 Replies

4. Ubuntu

Ubuntu Hangs when shutting down

i really dont know any other way to put it besides that Ubuntu 8.04, that i just installed on my computer hangs when it shuts down. the bar depletes the orange like it should, but it never actually shuts down. anyone know whats going on? (3 Replies)
Discussion started by: Texasone
3 Replies

5. Shell Programming and Scripting

Shell script to Shutdown Computers on Cluster

Hello all. I have built a cluster of 9 Macs for computational chemistry and I need a shell script that I can use from one computer to all the rest to shutdown. I have modified all of the Macs so that there is pass-wordless ssh. As well, I have modified each "visudo" file on each machine by... (1 Reply)
Discussion started by: marcozd
1 Replies

6. Solaris

I Need to edit message at shutting down

on solaris 8 i edited file rc0 in /sbin at last line ex. /sbin/sync; /sbin/sync; /sbin/sync # Unmount file systems. /usr, /var, /var/adm, /var/run are not unmounted by # umountall because they are mounted by rcS (for single user mode) rather than # mountall. If this is changed,... (1 Reply)
Discussion started by: infjustice
1 Replies

7. AIX

Getting error while shutting down

Hi, I am getting the error "/etc/rc.shutdown failed. Shutdown aborting" while shutting down the os. Please suggest. (1 Reply)
Discussion started by: manoj.solaris
1 Replies

8. Shell Programming and Scripting

Can i see wich Computers are up in my network with a script

#!/bin/bash for ((n=0 ; n < 254 ; n+=1)) do ip=192.168.0.$n if ping -c 1 -w 1 $ip > /dev/null 2> /dev/null >> /etc/logping.txt; then echo "${ip} is up" # output up # sintax >> /etc/logping.txt log with .txt format else echo "${ip} is down" # output... (4 Replies)
Discussion started by: Roggy
4 Replies

9. Solaris

11.2 not shutting down completely

I just installed this 11.2 ver and when I tell it to shutdown it takes for ever then just hangs with this just a little bit of that red line left to go, then it just sits there like forever until I get tired of looking at it then force a shutdown by holding my power button down until my laptop... (8 Replies)
Discussion started by: userx-bw
8 Replies
shutdown(8)						      System Manager's Manual						       shutdown(8)

NAME
shutdown - Shuts down a single system or an entire cluster SYNOPSIS
/usr/sbin/shutdown [-bfhknrs] time [warning-message ...] /usr/sbin/shutdown -c [-hs] time [warning-message ...] PARAMETERS
Defines the time at which the shutdown command will shut down the system (or cluster when the -c option is specified). There are several ways to express this time: Use the word now to cause an immediate shutdown. Specify a future time using the format: +number. This format starts a shutdown in number minutes. Specify a future time using the format: hhmm. This format starts a shutdown at the indicated time. You can separate the hours (hh) and minutes (mm) with a colon (:). Anything following the time parameter on the command line is considered to be a message, which is broadcast to users currently logged into the system or cluster. Prior to shutdown, the message is displayed on all user terminals. The message is sent more frequently as the shutdown time approaches. OPTIONS
Sends a shutdown message to the rwalld daemon on all remote client hosts that have NFS file systems mounted from this system. This option is incompatible with the -c option. Shuts down and halts all members of a cluster in an orderly fashion. The -h and -s options are invoked by default when the -c option is specified. That is, there is no difference between specifying the -c option alone and specifying -csh. If any options other than -h and -s are specified with the -c option, the shutdown command displays a usage message and exits. Performs a fast shutdown (in the manner of the fastboot and the fasthalt programs), bypassing the messages to other users and bringing the system down as quickly as possible. The system halts or reboots without checking the file systems. For example, the shutdown -f time command brings the system to single user and creates the /fastboot file; when the system reboots to multiuser, it does not invoke fsck. The shutdown -f -r time command shuts the system down, creates the /fastboot file, then immediately reboots. The shutdown -f -h time command creates the /fastboot file and halts the system. The -f option is incompatible with the -c option. Causes the system or cluster to shut down and halt. When shutting down a single system, the shutdown command sends a SIGTERM signal to the init process, which brings it to single-user mode, and then issues a halt command. However, if the -s option is specified with the -h option, the shutdown command executes the run-level transition scripts (and does not send the SIGTERM signal) before halting the system. Because halt is the only option when shutting down an entire cluster, the -h option is invoked by default when the -c option is specified. Additionally, executing the run-level scripts is mandatory in a clusterwide shutdown, thus the -s option is invoked by default, too. Sends shutdown messages to users, warning them of an impending shutdown. However, the system does not actually shut down. The /etc/nologin_hostname file is not created. This option is incompatible with the -c option. Bypasses the normal synchronization (syncing) of disks before stopping the system. The -n option is incompatible with the -f and -c options. Causes the system to shut down and reboot. The shutdown command accomplishes this by sending a SIGTERM signal to the init process, which brings it to single-user mode, and then issues the reboot command. However, if the -s option is specified with the -h option, the shutdown command executes the run- level transition scripts (and does not send the SIGTERM signal) before rebooting the system. This option is incompatible with the -c option. Executes the stop entry point of the run-level transition scripts in /sbin/rc0.d/[Knn_name], /sbin/rc2.d/[Knn_name], and /sbin/rc3.d/[Knn_name] (for example, the stop entry point of /sbin/rc0.d/K45sys- log). The run level at which the shutdown command is invoked determines which scripts are executed. If the current run level is level 3 or higher, the Knn_name scripts from all three directories are run. If the run level is 2, then only scripts from /sbin/rc0.d and /sbin/rc2.d are run. If the run level is 1, only scripts from /sbin/rc0.d are run. This option is optional for single-system shutdowns but is invoked by default for clusterwide shutdowns. It can be used only with the -r, -c, or -h options. DESCRIPTION
The shutdown command provides an automated shutdown procedure. You must be root to use this command. When shutting down a single system, use the shutdown command shown in the first format line in the SYNOPSIS section. If the -s option is not specified, the shutdown command sends a SIGTERM signal to the init process, which shuts the system down to single-user mode. It then halts the system, reboots it, or does nothing, depending upon whether the -h, -r, or neither option is specified: If the -h option is spec- ified, the system is shut down to single-user mode and then halted. If the -r option is specified, the system is shut down to single-user mode and rebooted. If neither the -h or -r options is specified, the system is shut down to and remains in single-user mode. If you specify the -s option with the -h or -r option, the shutdown command does not send the SIGTERM signal prior to halting or rebooting the system. Rather, it executes the stop entry point of the run level transition scripts in /sbin/rc0.d/[Knn_name], /sbin/rc2.d/[Knn_name], and /sbin/rc3.d/[Knn_name]. The run level at which the shutdown command is invoked determines which scripts are executed. When shutting down an entire cluster, use the shutdown command shown in the second format line in the SYNOPSIS section: /usr/sbin/shutdown -c [-hs] time [warning-message ...] You must shut an entire cluster down to a halt. (Automatic reboots and shutting down to single user mode are not supported.) If you specify the -c option, the -h and -s options are invoked by default. The shutdown process is similar for single-system and cluster shutdowns. Five minutes before shutdown (or immediately, if shutdown is in less than five minutes) the shutdown command creates the /etc/nologin_hostname file (or /etc/nologin in the case of a clusterwide shutdown) and copies the warning-message and time of the shutdown to it. If a user subsequently attempts to log in, the login program checks for the existence of /etc/nologin_hostname or /etc/nologin as appropri- ate, prints the contents, and exits. The shutdown command removes the /etc/nologin_hostname or /etc/nologin file just before it exits. Similarly, when the shutdown command is invoked with the -c option to shut down an entire cluster, the shutdown command creates the /clus- ter/admin/.clu_shutdown_file file and copies the command parameters to it. The existence of this file prevents new members from joining a cluster while a clusterwide shutdown is in progress. It also prevents multiple clusterwide shutdowns from occurring simultaneously. The time parameter establishes a "grace period" during which you can cancel a shutdown. You must not abort a shutdown process once the grace period ends and the shutdown actually begins. To cancel a system or cluster shutdown during the grace period, use the following procedure: From the system on which you executed the shutdown command, identify the shutdown processes. There is a single shutdown process for /usr/sbin/shutdown; in a cluster, there may also be a /usr/sbin/clu_shutdown process. For example: # ps ax | grep -v grep | grep shutdown 14680 ttyp5 I < 0:00.01 /usr/sbin/shutdown +20 going down 14687 ttyp5 I < 0:00.01 /usr/sbin/clu_shutdown Terminate all of them by specifying their PIDs in a kill command. For example: # kill 14680 14687 If you kill the shutdown processes during the grace period, the shutdown is canceled and the /etc/nologin_host- name file is removed. In a clusterwide shutdown, the /etc/nologin and /cluster/admin/.clu_shutdown_file files are removed. Warning If a clusterwide shutdown does not run to completion, the remaining members might be left in a state with quorum checking turned off. Logins, member boots, and additional clusterwide shutdowns might all be disabled. To clear this state, you must manually shut down the remaining members one at a time (for example, by using the shutdown -h command) before resuming cluster operation. Failure to do so can lead to unpredictable cluster operation and possible data corruption. In the rare event that a member does not respond to the shutdown -h command, use the /usr/sbin/halt command to halt it. (If you must halt multiple members in this manner, halt them one at a time.) As a final resort, press the member's halt button to halt it and then crash the system at the console prompt to create a crash dump. At shutdown time, the shutdown command writes a message to the system log. This message states the time of the shutdown, who ran the shut- down command, and the reason. FILES
Specifies the command path. Location of the nologin file for a clusterwide shutdown. Location of the nologin file for a nonclustered system. For example, /etc/nologin_sys5.zk3.dec.com. Contains parameters associated with a clusterwide shutdown. This file is locked during a clusterwide shutdown to prevent multiple simulta- neous clusterwide shutdowns and to keep new members from joining the cluster during the shutdown. A record of all clusterwide shutdowns for the cluster is written to this file. Clusterwide shutdown script called by the shutdown command. RELATED INFORMATION
Commands: fastboot(8), fasthalt(8), halt(8), login(1), reboot(8), wall(1) delim off shutdown(8)
All times are GMT -4. The time now is 12:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy