Open System Services Management and Operations Guide (G06.29+, H06.07+)

Operating the OSS Environment
Open System Services Management and Operations Guide527191-005
2-5
Manually Stopping the OSS File System and the
OSS Environment
Sending Warnings to Users
Use the OSS shell wall command or an OSS shell script to warn users of the OSS
shell about a shutdown. Follow your site’s broadcast message procedures to warn
users of Guardian environment processes that might be using OSS files.
The shell script in Figure 2-1 on page 2-5 gathers the terminal names for all logged-in
users into the shell variable named list, then echoes a message to each terminal
name in list. The message is displayed on all terminals with an active OSS shell.
Alternatively, you can capture the message in a file and use the OSS shell wall
command to broadcast it to all logged-in users. For example, if you capture the
message portion of the script from Figure 2-1 into a file named warn.msg in your
current working directory, then, to send that message to all logged-in users of the OSS
shell, you would enter:
/bin/wall warn.msg
You can also put commands such as the script in Figure 2-2 on page 2-5 in the
/etc/profile file to warn users who are starting an OSS shell. In Figure 2-2, time
is the time you put the message into the /etc/profile file. The message is
displayed every time a user logs in. Remember to remove the message after you
restart the OSS file system.
Figure 2-1. Sample Broadcast Message for Stopping the OSS File System
#!/bin/sh
list=`who | awk '{print $2}'`
for T in $list
do
(
echo "*****************************************"
echo "* Broadcast message at `eval date` *"
echo "* WARNING! *"
echo "* OSS environment *"
echo "* stopping in five minutes. *"
echo "* Please save your files and exit. *"
echo "*****************************************"
) > $T
done
Figure 2-2. Sample Login Warning for Stopping the OSS File System
echo "*****************************************"
echo "* Broadcast message at time *"
echo "* WARNING! *"
echo "* OSS environment *"
echo "* stopping in five minutes. *"
echo "* Please exit now. *"
echo "*****************************************"