Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/108492


Change subject: Add upstart job definition file for Gitblit
......................................................................

Add upstart job definition file for Gitblit

The init.d script does not implement the 'status' sub-command, causing log churn
on antimony. So replace it with a modern and concise upstart job definition.
/etc/init.d/gitblit should be stopped and removed manually.

Change-Id: I3f32dedf15ce4c7cc96f6ed16d03dcfadce1d453
---
D modules/gitblit/files/gitblit-ubuntu
A modules/gitblit/files/gitblit.conf
M modules/gitblit/manifests/init.pp
3 files changed, 24 insertions(+), 54 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/92/108492/1

diff --git a/modules/gitblit/files/gitblit-ubuntu 
b/modules/gitblit/files/gitblit-ubuntu
deleted file mode 100644
index e6cd3f0..0000000
--- a/modules/gitblit/files/gitblit-ubuntu
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/bash
-# chkconfig: 3 21 91
-# Source function library.
-. /lib/init/vars.sh
-. /lib/lsb/init-functions
-
-PATH=/sbin:/bin:/usr/bin:/usr/sbin
-
-# change theses values (default values)
-GITBLIT_PATH=/var/lib/gitblit
-GITBLIT_BASE_FOLDER=/var/lib/gitblit/data
-GITBLIT_USER="gitblit"
-source ${GITBLIT_PATH}/java-proxy-config.sh
-ARGS="-server -Xmx4096M ${JAVA_PROXY_CONFIG} -Djava.awt.headless=true -jar 
gitblit.jar --baseFolder $GITBLIT_BASE_FOLDER"
-
-RETVAL=0
-
-case "$1" in
-  start)
-    if [ -f $GITBLIT_PATH/gitblit.jar ];
-      then
-      echo $"Starting gitblit server"
-      start-stop-daemon --start --quiet --background --oknodo --make-pidfile 
--pidfile /var/run/gitblit.pid --exec /usr/bin/java --chuid $GITBLIT_USER 
--chdir $GITBLIT_PATH -- $ARGS
-      exit $RETVAL
-    fi
-  ;;
-
-  stop)
-    if [ -f $GITBLIT_PATH/gitblit.jar ];
-      then
-      echo $"Stopping gitblit server"
-      start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/gitblit.pid
-      exit $RETVAL
-    fi
-  ;;
-
-  force-reload|restart)
-      $0 stop
-      $0 start
-  ;;
-
-  *)
-    echo $"Usage: /etc/init.d/gitblit {start|stop|restart|force-reload}"
-    exit 1
-  ;;
-esac
-
-exit $RETVAL
diff --git a/modules/gitblit/files/gitblit.conf 
b/modules/gitblit/files/gitblit.conf
new file mode 100644
index 0000000..6fec024
--- /dev/null
+++ b/modules/gitblit/files/gitblit.conf
@@ -0,0 +1,20 @@
+# gitblit - Web interface for Git
+#
+# Gitblit is an open-source, pure Java stack for managing, viewing, and
+# serving Git repositories.
+#
+description "Web interface for Git"
+
+start on runlevel [2345]
+stop on runlevel [!2345]
+
+setuid gitblit
+setgid gitblit
+
+chdir /var/lib/gitblit
+
+exec /usr/bin/java -server -Xmx4096M -Djava.awt.headless=true \
+        -jar gitblit.jar --baseFolder /var/lib/gitblit/data
+
+respawn
+respawn limit 10 5
diff --git a/modules/gitblit/manifests/init.pp 
b/modules/gitblit/manifests/init.pp
index 9853ea5..a01662e 100644
--- a/modules/gitblit/manifests/init.pp
+++ b/modules/gitblit/manifests/init.pp
@@ -51,11 +51,8 @@
         source  => 'puppet:///modules/gitblit/header.md',
     }
 
-    file { '/etc/init.d/gitblit':
-        mode    => '0554',
-        owner   => 'gitblit',
-        group   => 'gitblit',
-        source  => 'puppet:///modules/gitblit/gitblit-ubuntu',
+    file { '/etc/init/gitblit.conf':
+        source  => 'puppet:///modules/gitblit/gitblit.conf',
     }
 
     file { '/var/www/robots.txt':
@@ -67,8 +64,9 @@
 
     service { 'gitblit':
         ensure    => running,
+        provider  => 'upstart',
         subscribe => File['/var/lib/gitblit/data/gitblit.properties'],
-        enable    => true,
+        require   => File['/etc/init/gitblit.conf'],
     }
 
     apache_site { 'git':

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f32dedf15ce4c7cc96f6ed16d03dcfadce1d453
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh <o...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to