components/cups/Solaris/svc-cupsd
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Wed, 29 Aug 2012 11:05:56 -0700
changeset 957 255465c5756f
parent 810 297dc5ace0d5
permissions -rw-r--r--
Close of build 04.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
810
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     1
#!/usr/bin/ksh
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     2
#
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     3
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     4
#
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     5
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     6
#
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     7
# Standard prolog
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     8
#
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
     9
. /lib/svc/share/smf_include.sh
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    10
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    11
if [ -z "$SMF_FMRI" ] ; then
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    12
	echo "SMF framework variables are not initialized."
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    13
	exit $SMF_EXIT_ERR_NOSMF
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    14
fi
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    15
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    16
# directory where to look for startup scripts
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    17
STARTUP=/usr/lib/cups/startup
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    18
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    19
# for all startup scripts found in the directory
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    20
for SCRIPT in $STARTUP/* ; do
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    21
	# verify the script is executable
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    22
	[ -x "$SCRIPT" ] || continue
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    23
	# execute the script
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    24
	if ! "$SCRIPT" "$SMF_FMRI" "startup/${SCRIPT##*/}" ; then
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    25
		echo "Warning: startup script $SCRIPT failed."
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    26
	fi
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    27
done
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    28
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    29
# execute the CUPS daemon
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    30
exec /usr/sbin/cupsd
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    31
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    32
# fatal error, failed to execute CUPS daemon
297dc5ace0d5 7156212 spooled files won't actually print after upgrade from build 10 to build 12
Petr Cvachoucek <petr.cvachoucek@oracle.com>
parents:
diff changeset
    33
exit $SMF_EXIT_ERR_FATAL