Index: packaging/cups.list.in
===================================================================
--- packaging/cups.list.in	(revision 6330)
+++ packaging/cups.list.in	(working copy)
@@ -635,7 +635,7 @@
 %subpackage
 
 %system !darwin
-i 0755 root sys cups init/cups.sh
+i 0755 root sys cups init/cups.sh start(@RCSTART@) stop(@RCSTOP) runlevels(@RCLEVELS@)
 %subpackage lpd
 %if XINETD
 f 0644 root sys $XINETD/cups-lpd init/cups-lpd
Index: Makedefs.in
===================================================================
--- Makedefs.in	(revision 6330)
+++ Makedefs.in	(working copy)
@@ -218,6 +218,9 @@
 MANDIR		=	$(BUILDROOT)@mandir@
 MENUDIR		=	@MENUDIR@
 PMANDIR		=	$(BUILDROOT)@PMANDIR@
+RCLEVELS	=	@RCLEVELS@
+RCSTART		=	@RCSTART@
+RCSTOP		=	@RCSTOP@
 REQUESTS	= 	$(BUILDROOT)@CUPS_REQUESTS@
 SBINDIR		=	$(BUILDROOT)@sbindir@
 SERVERBIN	= 	$(BUILDROOT)@CUPS_SERVERBIN@
Index: config-scripts/cups-directories.m4
===================================================================
--- config-scripts/cups-directories.m4	(revision 6330)
+++ config-scripts/cups-directories.m4	(working copy)
@@ -123,24 +123,24 @@
 
 dnl Setup init.d locations...
 AC_ARG_WITH(rcdir, [  --with-rcdir            set path for rc scripts],rcdir="$withval",rcdir="")
+AC_ARG_WITH(rclevels, [  --with-rclevels         set run levels for rc scripts],rclevels="$withval",rclevels="2 3 5")
+AC_ARG_WITH(rcstart, [  --with-rcstart          set start number for rc scripts],rcstart="$withval",rcstart="99")
+AC_ARG_WITH(rcstop, [  --with-rcstop           set stop number for rc scripts],rcstop="$withval",rcstop="00")
 
+INITDIR=""
+INITDDIR=""
+RCLEVELS="$rclevels"
+RCSTART="$rcstart"
+RCSTOP="$rcstop"
+
 if test x$rcdir = x; then
 	case "$uname" in
-		FreeBSD* | OpenBSD* | MirBsD* | ekkoBSD*)
-			# FreeBSD and OpenBSD
-			INITDIR=""
-			INITDDIR=""
+		AIX*)
+			INITDIR="/etc/rc.d"
 			;;
 
-		NetBSD*)
-			# NetBSD
-			INITDIR=""
-			INITDDIR="/etc/rc.d"
-			;;
-
 		Darwin*)
 			# Darwin and MacOS X...
-			INITDIR=""
 			if test -x /sbin/launchd; then
 				INITDDIR="/System/Library/LaunchDaemons"
 			else 
@@ -148,48 +148,75 @@
 			fi
 			;;
 
+		FreeBSD* | OpenBSD* | MirBsD* | ekkoBSD*)
+			# FreeBSD and OpenBSD
+			;;
+
+		HP-UX*)
+			INITDIR="/sbin"
+			RCLEVELS="2"
+			RCSTART="620"
+			RCSTOP="380"
+			;;
+
+		IRIX*)
+			# IRIX
+			INITDIR="/etc"
+			RCSTART="60"
+			RCSTOP="25"
+			;;
+
 		Linux | GNU)
 			# Linux/HURD seems to choose an init.d directory at random...
 			if test -d /sbin/init.d; then
 				# SuSE
 				INITDIR="/sbin/init.d"
-				INITDDIR=".."
 			else
 				if test -d /etc/init.d; then
 					# Others
 					INITDIR="/etc"
-					INITDDIR="../init.d"
 				else
 					# RedHat
 					INITDIR="/etc/rc.d"
-					INITDDIR="../init.d"
 				fi
 			fi
+			RCSTART="81"
+			RCSTOP="36"
 			;;
 
-		OSF1* | HP-UX*)
+		NetBSD*)
+			# NetBSD
+			INITDDIR="/etc/rc.d"
+			;;
+
+		OSF1*)
 			INITDIR="/sbin"
-			INITDDIR="../init.d"
 			;;
 
-		AIX*)
-			INITDIR="/etc/rc.d"
-			INITDDIR=".."
+		SunOS*)
+			# Solaris
+			INITDIR="/etc"
+			RCSTART="81"
 			;;
 
 		*)
 			INITDIR="/etc"
-			INITDDIR="../init.d"
 			;;
 
 	esac
 else
-	INITDIR=""
-	INITDDIR="$rcdir"
+	if test "x$rclevels" = x; then
+		INITDDIR="$rcdir"
+	else
+		INITDIR="$rcdir"
+	fi
 fi
 
 AC_SUBST(INITDIR)
 AC_SUBST(INITDDIR)
+AC_SUBST(RCLEVELS)
+AC_SUBST(RCSTART)
+AC_SUBST(RCSTOP)
 
 dnl Xinetd support...
 AC_ARG_WITH(xinetd, [  --with-xinetd           set path for xinetd config files],XINETD="$withval",XINETD="")
Index: Makefile
===================================================================
--- Makefile	(revision 6330)
+++ Makefile	(working copy)
@@ -104,14 +104,17 @@
 		echo Installing init scripts...; \
 		$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/init.d; \
 		$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/init.d/cups; \
+		for level in $(RCLEVELS); do \
+			$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
+			$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/S$(RCSTART)cups; \
+			if test `uname` = HP-UX; then \
+				level=`expr $$level - 1`; \
+				$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc$${level}.d; \
+			fi; \
+			$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc$${level}.d/K$(RCSTOP)cups; \
+		done; \
 		$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc0.d; \
-		$(INSTALL_SCRIPT) init/cups.sh  $(BUILDROOT)$(INITDIR)/rc0.d/K00cups; \
-		$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc2.d; \
-		$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc2.d/S99cups; \
-		$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc3.d; \
-		$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc3.d/S99cups; \
-		$(INSTALL_DIR) -m 755 $(BUILDROOT)$(INITDIR)/rc5.d; \
-		$(INSTALL_SCRIPT) init/cups.sh $(BUILDROOT)$(INITDIR)/rc5.d/S99cups; \
+		$(LN) ../init.d/cups $(BUILDROOT)$(INITDIR)/rc0.d/K$(RCSTOP)cups; \
 	fi
 	if test "x$(INITDIR)" = x -a "x$(INITDDIR)" != x; then \
 		$(INSTALL_DIR) $(BUILDROOT)$(INITDDIR); \
Index: init/cups.sh.in
===================================================================
--- init/cups.sh.in	(revision 6330)
+++ init/cups.sh.in	(working copy)
@@ -4,7 +4,7 @@
 #
 #   Startup/shutdown script for the Common UNIX Printing System (CUPS).
 #
-#   Copyright 1997-2005 by Easy Software Products, all rights reserved.
+#   Copyright 1997-2007 by Easy Software Products, all rights reserved.
 #
 #   These coded instructions, statements, and computer programs are the
 #   property of Easy Software Products and are protected by Federal
@@ -136,6 +136,20 @@
 
 
 #
+# Make sure we have the standard program directories in the path
+# since some operating systems (this means YOU HP-UX!) don't
+# provide a standard path on boot-up...
+#
+
+if "x$PATH" = x; then
+	PATH="/bin:/usr/bin:/sbin:/usr/sbin"
+else
+	PATH="/bin:/usr/bin:/sbin:/usr/sbin:$PATH"
+fi
+
+export PATH
+
+#
 # See if the CUPS server (cupsd) is running...
 #
 
@@ -201,6 +215,16 @@
 		fi
 		;;
 
+	start_msg)
+		# HP-UX non-standard...
+		echo "Starting CUPS Server"
+		;;
+
+	stop_msg)
+		# HP-UX non-standard...
+		echo "Starting CUPS Server"
+		;;
+
 	*)
 		echo "Usage: cups {reload|restart|start|status|stop}"
 		exit 1
