Filippo Giunchedi has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/328298 )

Change subject: debian: ditch sysv/systemd on trusty, use upstart
......................................................................

debian: ditch sysv/systemd on trusty, use upstart

Change-Id: I5329d87c002310b6b497bd07772d554ca5ae2c1b
---
M debian/changelog
M debian/control
D debian/init
M debian/rules
D debian/service
A debian/upstart
6 files changed, 23 insertions(+), 78 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/software/hhvm_exporter 
refs/changes/98/328298/1

diff --git a/debian/changelog b/debian/changelog
index 514801c..582ecdd 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+prometheus-hhvm-exporter (0.2-2~trusty1) trusty-wikimedia; urgency=medium
+
+  * Trusty compatibility, replace sysv/systemd with upstart
+
+ -- Filippo Giunchedi <[email protected]>  Mon, 19 Dec 2016 21:50:46 +0000
+
 prometheus-hhvm-exporter (0.2-1) unstable; urgency=low
 
   * Fix duplicate 'hhvm_tc_used_bytes'
diff --git a/debian/control b/debian/control
index 55ed4a1..c7b23ec 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,6 @@
 Priority: optional
 Build-Depends: debhelper (>= 9),
   dh-python,
-  dh-systemd,
   python3-setuptools (>= 0.6b3),
   python3-all,
   python3-nose,
diff --git a/debian/init b/debian/init
deleted file mode 100755
index 3001bbf..0000000
--- a/debian/init
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/sh
-# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
-if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
-    set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
-fi
-### BEGIN INIT INFO
-# Provides:          prometheus-hhvm-exporter
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Prometheus exporter for HHVM
-### END INIT INFO
-
-# Author: Filippo Giunchedi <[email protected]>
-
-DESC="Prometheus exporter for HHVM"
-DAEMON=/usr/bin/prometheus-hhvm-exporter
-NAME=prometheus-hhvm-exporter
-USER=prometheus
-PIDFILE=/var/run/prometheus/prometheus-hhvm-exporter.pid
-LOGFILE=/var/log/prometheus/prometheus-hhvm-exporter.log
-
-ARGS=""
-[ -r /etc/default/$NAME ] && . /etc/default/$NAME
-
-HELPER=/usr/bin/daemon
-HELPER_ARGS="--name=$NAME --output=$LOGFILE --pidfile=$PIDFILE --user=$USER"
-
-do_start_prepare()
-{
-    mkdir -p `dirname $PIDFILE` || true
-    chown -R $USER: `dirname $LOGFILE`
-    chown -R $USER: `dirname $PIDFILE`
-}
-
-do_start_cmd()
-{
-    # Return
-    #   0 if daemon has been started
-    #   1 if daemon was already running
-    #   2 if daemon could not be started
-    $HELPER $HELPER_ARGS --running && return 1
-    $HELPER $HELPER_ARGS -- $DAEMON $ARGS || return 2
-    return 0
-}
-
-do_stop_cmd()
-{
-    # 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
-    $HELPER $HELPER_ARGS --running || return 1
-    $HELPER $HELPER_ARGS --stop || return 2
-    # wait for the process to really terminate
-    for n in 1 2 3 4 5; do
-        sleep 1
-        $HELPER $HELPER_ARGS --running || break
-    done
-    $HELPER $HELPER_ARGS --running || return 0
-    return 2
-}
diff --git a/debian/rules b/debian/rules
index ce3e575..3f60c10 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,7 +6,7 @@
 DEBPKGNAME ?= $(shell dpkg-parsechangelog | sed -n -e 's/^Source: //p')
 
 %:
-       dh $@ --with python3,systemd --buildsystem=pybuild
+       dh $@ --with python3 --buildsystem=pybuild
 
 override_dh_auto_install:
        dh_auto_install
diff --git a/debian/service b/debian/service
deleted file mode 100644
index 9afcb81..0000000
--- a/debian/service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=Prometheus exporter for HHVM
-Documentation=https://prometheus.io/docs/introduction/overview/
-
-[Service]
-Restart=always
-User=prometheus
-EnvironmentFile=-/etc/default/prometheus-hhvm-exporter
-ExecStart=/usr/bin/prometheus-hhvm-exporter $ARGS
-
-[Install]
-WantedBy=multi-user.target
diff --git a/debian/upstart b/debian/upstart
new file mode 100644
index 0000000..2069887
--- /dev/null
+++ b/debian/upstart
@@ -0,0 +1,16 @@
+description "Prometheus exporter for HHVM"
+
+start on (local-filesystems and net-device-up IFACE!=lo)
+stop on [!12345]
+
+setuid prometheus
+
+respawn
+
+# required: $HOME isn't set despite setuid
+chdir /var/lib/prometheus
+
+script
+    . /etc/default/prometheus-hhvm-exporter
+    exec /usr/bin/prometheus-hhvm-exporter $ARGS
+end script

-- 
To view, visit https://gerrit.wikimedia.org/r/328298
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5329d87c002310b6b497bd07772d554ca5ae2c1b
Gerrit-PatchSet: 1
Gerrit-Project: operations/software/hhvm_exporter
Gerrit-Branch: debian/trusty
Gerrit-Owner: Filippo Giunchedi <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to