#! /bin/sh

# $Copyright:	$
# Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989, 1990 
# Sequent Computer Systems, Inc.   All rights reserved.
#  
# This software is furnished under a license and may be used
# only in accordance with the terms of that license and with the
# inclusion of the above copyright notice.   This software may not
# be provided or otherwise made available to, or used by, any
# other person.  No title to or ownership of the software is
# hereby transferred.

#	Copyright (c) 1984 AT&T
#	  All Rights Reserved

#	THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T
#	The copyright notice above does not evidence any
#	actual or intended publication of such source code.

#ident	"$Header: rc1.sh 1.12 90/04/25 $@(#)initpkg:rc1.sh	1.1"
if u3b2 || i386
then
echo "#! /bin/sh
#	\"Run Commands\" for init state 1
#	Leaves the system in state S for system maintenance.
#	The sequence is the same as for state 0 except for the
#	transition to state S

echo 'The system is coming down.  Please wait.'

#	The following segment is for historical purposes.
#	There should be nothing in /etc/shutdown.d.
if [ -d /etc/shutdown.d ]
then
	for f in /etc/shutdown.d/*
	{
		if [ -f /etc/shutdown.d/\$f ]
		then
			/bin/sh \${f}
		fi
	}
fi
#	End of historical section

if [ -d /etc/rc0.d ]
then
	for f in /etc/rc0.d/K*
	{
		if [ -s \${f} ]
		then
			/bin/sh \${f} stop
		fi
	}

#	system cleanup functions ONLY (things that end fast!)	

	for f in /etc/rc0.d/S*
	{
		if [ -s \${f} ]
		then
			/bin/sh \${f} start
		fi
	}
fi

trap \"\" 15
# send SIGTERM to ALL processes
kill -15 -1
sleep 5
/etc/killall 9
sync; sync; sync
/etc/umountall -f 4.2
sync; sync; sync
/etc/init S
" > rc1
fi
