[DRE-commits] [chef] 02/02: debian/chef-client.{init, default}: copied from old source package

Antonio Terceiro terceiro at moszumanska.debian.org
Sat Jun 13 22:48:41 UTC 2015


This is an automated email from the git hooks/post-receive script.

terceiro pushed a commit to branch master
in repository chef.

commit 5462a9b26863c8a5c4db96b13b43c43b7c175a1c
Author: Antonio Terceiro <terceiro at debian.org>
Date:   Sat Jun 13 19:31:36 2015 -0300

    debian/chef-client.{init,default}: copied from old source package
    
    These files have been dropped by upstream.
---
 debian/changelog           |   2 +
 debian/chef-client.default |   4 +
 debian/chef-client.init    | 212 +++++++++++++++++++++++++++++++++++++++++++++
 debian/rules               |   3 -
 4 files changed, 218 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index eab75b6..4d51331 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ chef (12.3.0-1) UNRELEASED; urgency=medium
     - Drop: Provides/Replaces used for upgrades in old releases
     - Dropped debian/require-rubygems.overrides, now obsolete
     - Drop debian/patches/remove_rubygems.diff, now obsolete
+  * debian/chef-client.{init,default}: copied from old source package. These
+    files have been dropped by upstream.
 
  -- Antonio Terceiro <terceiro at debian.org>  Sun, 17 May 2015 08:41:22 -0300
 
diff --git a/debian/chef-client.default b/debian/chef-client.default
new file mode 100644
index 0000000..a6413a3
--- /dev/null
+++ b/debian/chef-client.default
@@ -0,0 +1,4 @@
+LOGFILE=/var/log/chef/client.log
+CONFIG=/etc/chef/client.rb
+INTERVAL=1800
+SPLAY=20
diff --git a/debian/chef-client.init b/debian/chef-client.init
new file mode 100644
index 0000000..b74f6d9
--- /dev/null
+++ b/debian/chef-client.init
@@ -0,0 +1,212 @@
+#! /bin/sh
+### BEGIN INIT INFO
+# Provides:           chef-client
+# Required-Start:     $remote_fs $network
+# Required-Stop:      $remote_fs $network
+# Default-Start:      2 3 4 5
+# Default-Stop:       0 1 6
+# Short-Description:  Start a chef-client.
+### END INIT INFO
+#
+# Copyright (c) 2009-2010 Opscode, Inc, <legal at opscode.com>
+#
+# chef-client         Startup script for chef-client.
+# chkconfig: - 99 02
+# description: starts up chef-client in daemon mode.
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=$(which chef-client)
+NAME=chef-client
+DESC=chef-client
+PIDFILE=/var/run/chef/client.pid
+
+test -x $DAEMON || exit 1
+
+. /lib/lsb/init-functions
+
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+
+if [ ! -d /var/run/chef ]; then
+  mkdir /var/run/chef
+fi
+
+DAEMON_OPTS="-d -P $PIDFILE -c $CONFIG -i $INTERVAL -s $SPLAY"
+
+if [ ! -z $LOGFILE ]; then
+  DAEMON_OPTS="${DAEMON_OPTS} -L $LOGFILE"
+fi
+
+running_pid() {
+  pid=$1
+  name=$2
+  [ -z "$pid" ] && return 1
+  [ ! -d /proc/$pid ] &&  return 1
+  cmd=`awk '/Name:/ {print $2}' /proc/$pid/status`
+  [ "$cmd" != "$name" ] &&  return 1
+  return 0
+}
+
+running() {
+  [ ! -f "$PIDFILE" ] && return 1
+  pid=`cat $PIDFILE`
+  running_pid $pid $NAME || return 1
+  return 0
+}
+
+start_server() {
+  if [ -z "$DAEMONUSER" ] ; then
+    start_daemon -p $PIDFILE $DAEMON $DAEMON_OPTS
+  errcode=$?
+  else
+    start-stop-daemon --start --quiet --pidfile $PIDFILE \
+      --chuid $DAEMONUSER \
+      --exec $DAEMON -- $DAEMON_OPTS
+    errcode=$?
+  fi
+  return $errcode
+}
+
+stop_server() {
+   if [ -z "$DAEMONUSER" ] ; then
+     killproc -p $PIDFILE $DAEMON
+     errcode=$?
+   else
+     start-stop-daemon --stop --quiet --pidfile $PIDFILE \
+       --user $DAEMONUSER \
+       --exec $DAEMON
+     errcode=$?
+   fi
+   return $errcode
+}
+
+reload_server() {
+  if [ -z "$DAEMONUSER" ] ; then
+     killproc -p $PIDFILE $DAEMON -HUP
+     errcode=$?
+   else
+     start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE \
+       --user $DAEMONUSER \
+       --exec $DAEMON
+     errcode=$?
+   fi
+   return $errcode
+}
+
+run_server() {
+  if [ -z "$DAEMONUSER" ] ; then
+     killproc -p $PIDFILE $DAEMON -USR1
+     errcode=$?
+   else
+     start-stop-daemon --stop --signal USR1 --quiet --pidfile $PIDFILE \
+       --user $DAEMONUSER \
+       --exec $DAEMON
+     errcode=$?
+   fi
+   return $errcode
+}
+
+force_stop() {
+  [ ! -e "$PIDFILE" ] && return
+  if running ; then
+    /bin/kill -15 $pid
+    sleep "$DIETIME"s
+    if running ; then
+      /bin/kill -9 $pid
+      sleep "$DIETIME"s
+      if running ; then
+        echo "Cannot kill $NAME (pid=$pid)!"
+        exit 1
+      fi
+    fi
+  fi
+  rm -f $PIDFILE
+}
+
+case "$1" in
+  start)
+    log_daemon_msg "Starting $DESC " "$NAME"
+    if running ;  then
+        log_progress_msg "apparently already running"
+        log_end_msg 0
+        exit 0
+    fi
+    if start_server ; then
+        [ -n "$STARTTIME" ] && sleep $STARTTIME # Wait some time
+        if  running ;  then
+            log_end_msg 0
+        else
+            log_end_msg 1
+        fi
+    else
+        log_end_msg 1
+    fi
+    ;;
+  stop)
+    log_daemon_msg "Stopping $DESC" "$NAME"
+    if running ; then
+      errcode=0
+      stop_server || errcode=$?
+      log_end_msg $errcode
+    else
+      log_progress_msg "apparently not running"
+      log_end_msg 0
+      exit 0
+    fi
+    ;;
+  force-stop)
+    $0 stop
+    if running; then
+      log_daemon_msg "Stopping (force) $DESC" "$NAME"
+      errcode=0
+      force_stop || errcode=$?
+      log_end_msg $errcode
+    fi
+    ;;
+  restart|force-reload)
+    log_daemon_msg "Restarting $DESC" "$NAME"
+    errcode=0
+    if running ; then
+      stop_server || errcode=$?
+      [ -n "$DIETIME" ] && sleep $DIETIME
+    fi
+    start_server || errcode=$?
+    [ -n "$STARTTIME" ] && sleep $STARTTIME
+    running || errcode=$?
+    log_end_msg $errcode
+    ;;
+  status)
+    log_daemon_msg "Checking status of $DESC" "$NAME"
+    if running ;  then
+      log_progress_msg "running"
+      log_end_msg 0
+    else
+      log_progress_msg "apparently not running"
+      log_end_msg 1
+      exit 3
+    fi
+    ;;
+  reload)
+    if running; then
+      log_daemon_msg "Reloading $DESC" "$NAME"
+      errcode=0
+      reload_server || errcode=$?
+      log_end_msg $errcode
+    fi
+    ;;
+  run)
+    if running; then
+      log_daemon_msg "Triggering run of $DESC" "$NAME"
+      errcode=0
+      run_server || errcode=$?
+      log_end_msg $errcode
+    fi
+    ;;
+  *)
+    N=/etc/init.d/$NAME
+    echo "Usage: $N {start|stop|force-stop|restart|force-reload|status|run}" >&2
+    exit 1
+    ;;
+esac
+
+exit 0
+
diff --git a/debian/rules b/debian/rules
index 1003fd8..e2c71a6 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,9 +7,6 @@ export GEM2DEB_TEST_RUNNER = --check-dependencies
 
 override_dh_auto_install:
 	dh_auto_install
-	# init script name is different from the package:
-	cp -f $(CURDIR)/distro/debian/etc/init.d/chef-client $(CURDIR)/debian/chef-client.init
-	cp -f $(CURDIR)/distro/debian/etc/default/chef-client $(CURDIR)/debian/chef-client.default
 	dh_installinit --name chef-client -- defaults 99 02
 	cp -rf $(CURDIR)/debian/etc/chef/client.rb $(CURDIR)/debian/chef/usr/share/chef
 	cp -rf $(CURDIR)/debian/etc/chef/solo.rb $(CURDIR)/debian/chef/usr/share/chef

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/chef.git



More information about the Pkg-ruby-extras-commits mailing list