[25851] in Source-Commits
/svn/athena r25262 - trunk/debathena/config/cluster-cups-config/debian
daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Wed Jul 20 14:19:59 2011
Date: Wed, 20 Jul 2011 14:19:53 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201107201819.p6KIJrnq028892@drugstore.mit.edu>
To: source-commits@mit.edu
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: jdreed
Date: 2011-07-20 14:19:53 -0400 (Wed, 20 Jul 2011)
New Revision: 25262
Added:
trunk/debathena/config/cluster-cups-config/debian/debathena-cluster-cups-config.init
Modified:
trunk/debathena/config/cluster-cups-config/debian/changelog
trunk/debathena/config/cluster-cups-config/debian/configure-athena-printers
trunk/debathena/config/cluster-cups-config/debian/postinst
Log:
In cluster-cups-config:
* Ship an init script which can be used to add the printers at boot
time, since they can't be added at install time because CUPS isn't
running
Modified: trunk/debathena/config/cluster-cups-config/debian/changelog
===================================================================
--- trunk/debathena/config/cluster-cups-config/debian/changelog 2011-07-20 01:14:02 UTC (rev 25261)
+++ trunk/debathena/config/cluster-cups-config/debian/changelog 2011-07-20 18:19:53 UTC (rev 25262)
@@ -1,3 +1,11 @@
+debathena-cluster-cups-config (2.0.2) unstable; urgency=low
+
+ * Ship an init script which can be used to add the printers at boot
+ time, since they can't be added at install time because CUPS isn't
+ running
+
+ -- Jonathan Reed <jdreed@mit.edu> Wed, 20 Jul 2011 14:19:43 -0400
+
debathena-cluster-cups-config (2.0.1) unstable; urgency=low
* wired is now Pharos
Modified: trunk/debathena/config/cluster-cups-config/debian/configure-athena-printers
===================================================================
--- trunk/debathena/config/cluster-cups-config/debian/configure-athena-printers 2011-07-20 01:14:02 UTC (rev 25261)
+++ trunk/debathena/config/cluster-cups-config/debian/configure-athena-printers 2011-07-20 18:19:53 UTC (rev 25262)
@@ -69,7 +69,7 @@
del_printers
;;
*)
- echo "Usage: $0 [ add | remove ]"
+ echo "Usage: $0 [ add | remove | verify ]"
exit 1
;;
esac
Added: trunk/debathena/config/cluster-cups-config/debian/debathena-cluster-cups-config.init
===================================================================
--- trunk/debathena/config/cluster-cups-config/debian/debathena-cluster-cups-config.init (rev 0)
+++ trunk/debathena/config/cluster-cups-config/debian/debathena-cluster-cups-config.init 2011-07-20 18:19:53 UTC (rev 25262)
@@ -0,0 +1,35 @@
+#! /bin/sh
+
+### BEGIN INIT INFO
+# Provides: debathena-cluster-cups-config
+# Required-Start: cups
+# Required-Stop: cups
+# Should-Start: $local_fs $network
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Cluster CUPS configuration
+# Description: Ensure cluster printers exist
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+case "$1" in
+ start)
+ if [ -f /var/lib/debathena-cluster-cups-config-reconfigure_required ]; then
+ log_action_msg "Adding cluster printers"
+ if /usr/share/debathena-cluster-cups-config/configure-athena-printers add; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
+ fi
+ ;;
+ stop|restart|reload|force-reload|status)
+ exit 0
+ ;;
+ *)
+ log_action_msg "Usage: /etc/init.d/debathena-cluster-cups-config {start}"
+ exit 1
+ ;;
+esac
+exit 0
Modified: trunk/debathena/config/cluster-cups-config/debian/postinst
===================================================================
--- trunk/debathena/config/cluster-cups-config/debian/postinst 2011-07-20 01:14:02 UTC (rev 25261)
+++ trunk/debathena/config/cluster-cups-config/debian/postinst 2011-07-20 18:19:53 UTC (rev 25262)
@@ -28,6 +28,14 @@
case "$1" in
configure)
restart_cups
+ if ! lpstat -r; then
+ # CUPS isn't running even though it should be. We're probably
+ # inside the installer. Let the initscript deal.
+ touch /var/lib/debathena-cluster-cups-config-reconfigure_required
+ touch /var/run/reboot-required
+ echo "debathena-cluster-cups-config" >> /var/run/reboot-required.pkgs
+ exit 0
+ fi
/usr/share/debathena-cluster-cups-config/configure-athena-printers add
;;