[Python-modules-commits] r20320 - in packages/python-carbon/trunk/debian (8 files)

hggh-guest at users.alioth.debian.org hggh-guest at users.alioth.debian.org
Sun Feb 5 00:10:50 UTC 2012


    Date: Sunday, February 5, 2012 @ 00:10:46
  Author: hggh-guest
Revision: 20320

changed username to _graphite; fixed init script; added triggers; removed readme

Added:
  packages/python-carbon/trunk/debian/python-carbon.triggers
Modified:
  packages/python-carbon/trunk/debian/carbon-cache.init
  packages/python-carbon/trunk/debian/patches/carbon.conf.debian.patch
  packages/python-carbon/trunk/debian/python-carbon.logrotate
  packages/python-carbon/trunk/debian/python-carbon.postinst
  packages/python-carbon/trunk/debian/python-carbon.postrm
  packages/python-carbon/trunk/debian/rules
Deleted:
  packages/python-carbon/trunk/debian/README.Debian

Deleted: packages/python-carbon/trunk/debian/README.Debian
===================================================================
--- packages/python-carbon/trunk/debian/README.Debian	2012-02-04 23:29:21 UTC (rev 20319)
+++ packages/python-carbon/trunk/debian/README.Debian	2012-02-05 00:10:46 UTC (rev 20320)
@@ -1,15 +0,0 @@
-python-carbon for Debian
-------------------------
-
-If you would like to configure carbon copy the files from
-example/ into /etc/carbon:
-
- # zcat /usr/share/doc/python-carbon/examples/carbon.conf.example.gz \
-   >/etc/carbon/carbon.conf
-
- # cp /usr/share/doc/python-carbon/examples/storage-schemas.conf.example \
-   /etc/carbon/storage-schemas.conf
-
-Then start carbon-cache daemon:
-
- # /etc/init.d/carbon-cache start

Modified: packages/python-carbon/trunk/debian/carbon-cache.init
===================================================================
--- packages/python-carbon/trunk/debian/carbon-cache.init	2012-02-04 23:29:21 UTC (rev 20319)
+++ packages/python-carbon/trunk/debian/carbon-cache.init	2012-02-05 00:10:46 UTC (rev 20320)
@@ -11,7 +11,6 @@
 
 # Author: Jonas Genannt <jonas.genannt at capi2name.de>
 
-# PATH should only include /usr/* if it runs after the mountnfs.sh script
 PATH=/sbin:/usr/sbin:/bin:/usr/bin
 DESC="Graphite backend daemon"
 NAME=carbon-cache
@@ -20,88 +19,46 @@
 DAEMON_ARGS="--config=/etc/carbon/carbon.conf --pidfile=$PIDFILE --logdir=/var/log/carbon/ start"
 SCRIPTNAME=/etc/init.d/$NAME
 
-# Exit if the package is not installed
 [ -x "$DAEMON" ] || exit 0
 
-# Read configuration variable file if it is present
 [ -r /etc/default/python-carbon ] && . /etc/default/python-carbon
 
-# Load the VERBOSE setting and other rcS variables
 . /lib/init/vars.sh
 
-# Define LSB log_* functions.
-# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
-# and status_of_proc is working.
 . /lib/lsb/init-functions
 
 if [ ! -r /etc/carbon/carbon.conf ]; then
-	echo "Missing /etc/carbon/carbon.conf - not starting."
+	[ "$VERBOSE" != no ] && echo "Missing /etc/carbon/carbon.conf - not starting."
 	exit
 fi
 
 if [ "$CARBON_CACHE_RUN" != "yes" ] ; then
-	echo "carbon-cache disabled in /etc/default/python-carbon"
-	exit 0
+	[ "$VERBOSE" != no ] && echo "carbon-cache disabled in /etc/default/python-carbon"
+	exit
 fi
 
-#
-# Function that starts the daemon/service
-#
 do_start()
 {
-	# Return
-	#   0 if daemon has been started
-	#   1 if daemon was already running
-	#   2 if daemon could not be started
 	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
 		|| return 1
 	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
 		$DAEMON_ARGS \
 		|| return 2
-	# Add code here, if necessary, that waits for the process to be ready
-	# to handle requests from services started subsequently which depend
-	# on this one.  As a last resort, sleep for some time.
 }
 
-#
-# Function that stops the daemon/service
-#
 do_stop()
 {
-	# Return
-	#   0 if daemon has been stopped
-	#   1 if daemon was already stopped
-	#   2 if daemon could not be stopped
-	#   other if a failure occurred
 	start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
 	RETVAL="$?"
 	[ "$RETVAL" = 2 ] && return 2
-	# Wait for children to finish too if this is a daemon that forks
-	# and if the daemon is only ever run from this initscript.
-	# If the above conditions are not satisfied then add some other code
-	# that waits for the process to drop all resources that could be
-	# needed by services started subsequently.  A last resort is to
-	# sleep for some time.
+
 	start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
 	[ "$?" = 2 ] && return 2
-	# Many daemons don't delete their pidfiles when they exit.
+
 	rm -f $PIDFILE
 	return "$RETVAL"
 }
 
-#
-# Function that sends a SIGHUP to the daemon/service
-#
-do_reload() {
-	#
-	# If the daemon can reload its configuration without
-	# restarting (for example, when it is sent a SIGHUP),
-	# then implement that here.
-	#
-	start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
-	return 0
-}
-
 case "$1" in
   start)
 	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
@@ -122,20 +79,7 @@
   status)
        status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
        ;;
-  #reload|force-reload)
-	#
-	# If do_reload() is not implemented then leave this commented out
-	# and leave 'force-reload' as an alias for 'restart'.
-	#
-	#log_daemon_msg "Reloading $DESC" "$NAME"
-	#do_reload
-	#log_end_msg $?
-	#;;
   restart|force-reload)
-	#
-	# If the "reload" option is implemented then remove the
-	# 'force-reload' alias
-	#
 	log_daemon_msg "Restarting $DESC" "$NAME"
 	do_stop
 	case "$?" in
@@ -143,18 +87,16 @@
 		do_start
 		case "$?" in
 			0) log_end_msg 0 ;;
-			1) log_end_msg 1 ;; # Old process is still running
-			*) log_end_msg 1 ;; # Failed to start
+			1) log_end_msg 1 ;;
+			*) log_end_msg 1 ;;
 		esac
 		;;
 	  *)
-	  	# Failed to stop
 		log_end_msg 1
 		;;
 	esac
 	;;
   *)
-	#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
 	echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
 	exit 3
 	;;

Modified: packages/python-carbon/trunk/debian/patches/carbon.conf.debian.patch
===================================================================
--- packages/python-carbon/trunk/debian/patches/carbon.conf.debian.patch	2012-02-04 23:29:21 UTC (rev 20319)
+++ packages/python-carbon/trunk/debian/patches/carbon.conf.debian.patch	2012-02-05 00:10:46 UTC (rev 20320)
@@ -36,7 +36,7 @@
  # If this is blank carbon runs as the user that invokes it
  # This user must have write access to the local data directory
 -USER =
-+USER = graphite
++USER = _graphite
  
  # Limit the size of the cache to avoid swapping or becoming CPU bound.
  # Sorts and serving cache queries gets more expensive as the cache grows.

Modified: packages/python-carbon/trunk/debian/python-carbon.logrotate
===================================================================
--- packages/python-carbon/trunk/debian/python-carbon.logrotate	2012-02-04 23:29:21 UTC (rev 20319)
+++ packages/python-carbon/trunk/debian/python-carbon.logrotate	2012-02-05 00:10:46 UTC (rev 20320)
@@ -5,7 +5,7 @@
 	compress
 	delaycompress
 	notifempty
-	create 640 graphite root
+	create 640 _graphite root
 	sharedscripts
 	postrotate
 		/etc/init.d/carbon-cache restart > /dev/null

Modified: packages/python-carbon/trunk/debian/python-carbon.postinst
===================================================================
--- packages/python-carbon/trunk/debian/python-carbon.postinst	2012-02-04 23:29:21 UTC (rev 20319)
+++ packages/python-carbon/trunk/debian/python-carbon.postinst	2012-02-05 00:10:46 UTC (rev 20320)
@@ -4,29 +4,19 @@
 
 
 if [ "$1" = configure ]; then
-	if ! getent passwd graphite > /dev/null; then
+	if ! getent passwd _graphite > /dev/null; then
 		adduser --system --quiet --home /var/lib/graphite --no-create-home \
-			--shell /bin/false --group --gecos "Graphite User" graphite
+			--shell /bin/false --force-badname --group --gecos "Graphite User" _graphite
 	fi
-
-	if [ "`id -u graphite`" -eq 0 ]; then
-		echo "The graphite system user must not have uid 0 (root). Please fix this and reinstall this package." >&2
-		exit 1
-	fi
-
-	 if [ "`id -g graphite`" -eq 0 ]; then
-		echo "The graphite system user must not have root as primary group. Please fix this and reinstall this package." >&2
-		exit 1
-	fi
 fi
 
 
-DIRS_WWWDATA="/var/lib/graphite /var/lib/graphite/whisper /var/log/carbon"
+DIRS="/var/lib/graphite /var/lib/graphite/whisper /var/log/carbon"
 
-for i in $DIRS_WWWDATA; do
+for i in $DIRS; do
 	if ! dpkg-statoverride --list $i >/dev/null 2>&1
 	then
-		dpkg-statoverride --update --add graphite graphite 4755 $i
+		dpkg-statoverride --update --add _graphite _graphite 4755 $i
 	fi
 done
 

Modified: packages/python-carbon/trunk/debian/python-carbon.postrm
===================================================================
--- packages/python-carbon/trunk/debian/python-carbon.postrm	2012-02-04 23:29:21 UTC (rev 20319)
+++ packages/python-carbon/trunk/debian/python-carbon.postrm	2012-02-05 00:10:46 UTC (rev 20320)
@@ -3,13 +3,17 @@
 set -e
 
 
-DIRS_WWWDATA="/var/lib/graphite /var/lib/graphite/whisper /var/log/carbon"
+DIRS="/var/lib/graphite /var/lib/graphite/whisper /var/log/carbon"
 
-for i in $DIRS_WWWDATA; do
+for i in $DIRS; do
 	if ! dpkg-statoverride --list $i >/dev/null 2>&1
 	then
 		dpkg-statoverride --remove $i
 	fi
 done
 
+if [ "$1" = purge ]; then
+	rm -rf /var/log/carbon
+fi
+
 #DEBHELPER#

Added: packages/python-carbon/trunk/debian/python-carbon.triggers
===================================================================
--- packages/python-carbon/trunk/debian/python-carbon.triggers	                        (rev 0)
+++ packages/python-carbon/trunk/debian/python-carbon.triggers	2012-02-05 00:10:46 UTC (rev 20320)
@@ -0,0 +1 @@
+activate  twisted-plugins-cache

Modified: packages/python-carbon/trunk/debian/rules
===================================================================
--- packages/python-carbon/trunk/debian/rules	2012-02-04 23:29:21 UTC (rev 20319)
+++ packages/python-carbon/trunk/debian/rules	2012-02-05 00:10:46 UTC (rev 20320)
@@ -14,6 +14,9 @@
 	[ -d debian/python-carbon/usr/storage ] && rm -r debian/python-carbon/usr/storage
 	# install global default file for the three carbon daemons
 	cp debian/python-carbon.default debian/python-carbon/etc/default/python-carbon
+	# install config files
+	cp conf/carbon.conf.example debian/python-carbon/etc/carbon/carbon.conf
+	cp conf/storage-schemas.conf.example debian/python-carbon/etc/carbon/storage-schemas.conf
 	dh_install
 
 override_dh_installinit:




More information about the Python-modules-commits mailing list