Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

add debian packaging files.

Change-Id: I08a6067edf45b47224597cebc3e9f4bc5f5ec05e
  • Loading branch information...
commit 7895ff6ad3f26e8edceeb6bf31de407ab5bff8af 1 parent 083203b
Yaguang Tang authored
6  debian/README.Debian
... ...
@@ -0,0 +1,6 @@
  1
+kanyun for Debian
  2
+-----------------
  3
+
  4
+<possible notes regarding this package - if none, delete this file>
  5
+
  6
+ -- Tang Yaguang <yaguang@staff.sina.com.cn>  Tue, 24 Jul 2012 10:53:31 +0800
9  debian/README.source
... ...
@@ -0,0 +1,9 @@
  1
+kanyun for Debian
  2
+-----------------
  3
+
  4
+<this file describes information about the source package, see Debian policy
  5
+manual section 4.14. You WILL either need to modify or delete this file>
  6
+
  7
+
  8
+
  9
+
5  debian/changelog
... ...
@@ -0,0 +1,5 @@
  1
+kanyun (0.1.1-1) unstable; urgency=low
  2
+
  3
+  * Initial release (Closes: #nnnn)  <nnnn is the bug number of your ITP>
  4
+
  5
+ -- Tang Yaguang <yaguang@staff.sina.com.cn>  Tue, 24 Jul 2012 10:53:31 +0800
1  debian/compat
... ...
@@ -0,0 +1 @@
  1
+8
38  debian/control
... ...
@@ -0,0 +1,38 @@
  1
+Source: kanyun
  2
+Section: net
  3
+Priority: extra
  4
+Maintainer: Tang Yaguang <yaguang@staff.sina.com.cn>
  5
+Build-Depends: debhelper (>= 8.0.0)
  6
+Standards-Version: 3.9.2
  7
+Homepage: https://git.sws.sina.com.cn/kanyun
  8
+#Vcs-Git: git://git.debian.org/collab-maint/kanyun.git
  9
+#Vcs-Browser: http://git.debian.org/?p=collab-maint/kanyun.git;a=summary
  10
+
  11
+Package: kanyun
  12
+Architecture: any
  13
+Depends: ${shlibs:Depends}, ${misc:Depends}
  14
+Description: sina sws virtual machine monitor
  15
+ sina sws virtual machine monitor
  16
+
  17
+Package: kanyun-common
  18
+Architecture: all
  19
+Depends: cassandra
  20
+Description: kanyun-common
  21
+ sina sws kanyun-common
  22
+
  23
+Package: kanyun-api
  24
+Architecture: all
  25
+Depends: kanyun-common
  26
+Description: kanyun-api
  27
+ sina sws kanyun-api
  28
+
  29
+Package: kanyun-worker
  30
+Architecture: all
  31
+Description: kanyun-worker
  32
+ sina sws kanyun-worker
  33
+
  34
+Package: kanyun-server
  35
+Architecture: all
  36
+Depends: kanyun-common
  37
+Description: kanyun-server
  38
+ sina sws kanyun-server
36  debian/copyright
... ...
@@ -0,0 +1,36 @@
154  debian/init.d
... ...
@@ -0,0 +1,154 @@
  1
+#!/bin/sh
  2
+### BEGIN INIT INFO
  3
+# Provides:          kanyun
  4
+# Required-Start:    $network $local_fs
  5
+# Required-Stop:
  6
+# Default-Start:     2 3 4 5
  7
+# Default-Stop:      0 1 6
  8
+# Short-Description: <Enter a short description of the sortware>
  9
+# Description:       <Enter a long description of the software>
  10
+#                    <...>
  11
+#                    <...>
  12
+### END INIT INFO
  13
+
  14
+# Author: Tang Yaguang <yaguang@staff.sina.com.cn>
  15
+
  16
+# PATH should only include /usr/* if it runs after the mountnfs.sh script
  17
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
  18
+DESC=kanyun             # Introduce a short description here
  19
+NAME=kanyun             # Introduce the short server's name here
  20
+DAEMON=/usr/sbin/kanyun # Introduce the server's location here
  21
+DAEMON_ARGS=""             # Arguments to run the daemon with
  22
+PIDFILE=/var/run/$NAME.pid
  23
+SCRIPTNAME=/etc/init.d/$NAME
  24
+
  25
+# Exit if the package is not installed
  26
+[ -x $DAEMON ] || exit 0
  27
+
  28
+# Read configuration variable file if it is present
  29
+[ -r /etc/default/$NAME ] && . /etc/default/$NAME
  30
+
  31
+# Load the VERBOSE setting and other rcS variables
  32
+. /lib/init/vars.sh
  33
+
  34
+# Define LSB log_* functions.
  35
+# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
  36
+. /lib/lsb/init-functions
  37
+
  38
+#
  39
+# Function that starts the daemon/service
  40
+#
  41
+do_start()
  42
+{
  43
+	# Return
  44
+	#   0 if daemon has been started
  45
+	#   1 if daemon was already running
  46
+	#   2 if daemon could not be started
  47
+	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
  48
+		|| return 1
  49
+	start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
  50
+		$DAEMON_ARGS \
  51
+		|| return 2
  52
+	# Add code here, if necessary, that waits for the process to be ready
  53
+	# to handle requests from services started subsequently which depend
  54
+	# on this one.  As a last resort, sleep for some time.
  55
+}
  56
+
  57
+#
  58
+# Function that stops the daemon/service
  59
+#
  60
+do_stop()
  61
+{
  62
+	# Return
  63
+	#   0 if daemon has been stopped
  64
+	#   1 if daemon was already stopped
  65
+	#   2 if daemon could not be stopped
  66
+	#   other if a failure occurred
  67
+	start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
  68
+	RETVAL="$?"
  69
+	[ "$RETVAL" = 2 ] && return 2
  70
+	# Wait for children to finish too if this is a daemon that forks
  71
+	# and if the daemon is only ever run from this initscript.
  72
+	# If the above conditions are not satisfied then add some other code
  73
+	# that waits for the process to drop all resources that could be
  74
+	# needed by services started subsequently.  A last resort is to
  75
+	# sleep for some time.
  76
+	start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
  77
+	[ "$?" = 2 ] && return 2
  78
+	# Many daemons don't delete their pidfiles when they exit.
  79
+	rm -f $PIDFILE
  80
+	return "$RETVAL"
  81
+}
  82
+
  83
+#
  84
+# Function that sends a SIGHUP to the daemon/service
  85
+#
  86
+do_reload() {
  87
+	#
  88
+	# If the daemon can reload its configuration without
  89
+	# restarting (for example, when it is sent a SIGHUP),
  90
+	# then implement that here.
  91
+	#
  92
+	start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
  93
+	return 0
  94
+}
  95
+
  96
+case "$1" in
  97
+  start)
  98
+    [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC " "$NAME"
  99
+    do_start
  100
+    case "$?" in
  101
+		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
  102
+		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
  103
+	esac
  104
+  ;;
  105
+  stop)
  106
+	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
  107
+	do_stop
  108
+	case "$?" in
  109
+		0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
  110
+		2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
  111
+	esac
  112
+	;;
  113
+  status)
  114
+       status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
  115
+       ;;
  116
+  #reload|force-reload)
  117
+	#
  118
+	# If do_reload() is not implemented then leave this commented out
  119
+	# and leave 'force-reload' as an alias for 'restart'.
  120
+	#
  121
+	#log_daemon_msg "Reloading $DESC" "$NAME"
  122
+	#do_reload
  123
+	#log_end_msg $?
  124
+	#;;
  125
+  restart|force-reload)
  126
+	#
  127
+	# If the "reload" option is implemented then remove the
  128
+	# 'force-reload' alias
  129
+	#
  130
+	log_daemon_msg "Restarting $DESC" "$NAME"
  131
+	do_stop
  132
+	case "$?" in
  133
+	  0|1)
  134
+		do_start
  135
+		case "$?" in
  136
+			0) log_end_msg 0 ;;
  137
+			1) log_end_msg 1 ;; # Old process is still running
  138
+			*) log_end_msg 1 ;; # Failed to start
  139
+		esac
  140
+		;;
  141
+	  *)
  142
+	  	# Failed to stop
  143
+		log_end_msg 1
  144
+		;;
  145
+	esac
  146
+	;;
  147
+  *)
  148
+	#echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
  149
+	echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
  150
+	exit 3
  151
+	;;
  152
+esac
  153
+
  154
+:
2  debian/kanyun-api.install
... ...
@@ -0,0 +1,2 @@
  1
+bin/kanyun-api /usr/bin/
  2
+bin/api-client /usr/bin
4  debian/kanyun-api.logrotate
... ...
@@ -0,0 +1,4 @@
  1
+/var/log/kanyun/kanyun-api.log{
  2
+daily
  3
+rotate 15
  4
+}
20  debian/kanyun-api.upstart
... ...
@@ -0,0 +1,20 @@
  1
+description "kanyun monitor service"
  2
+author "yaguang <yaguang@staff.sina.com.cn>"
  3
+
  4
+start on (filesystem and net-device-up IFACE!=lo)
  5
+stop on runlevel [016]
  6
+
  7
+respawn
  8
+
  9
+chdir /var/run
  10
+
  11
+pre-start script
  12
+	mkdir -p /var/run/kanyun
  13
+	chown kanyun:root /var/run/kanyun/
  14
+
  15
+	mkdir -p /var/lock/kanyun
  16
+	chown kanyun:root /var/lock/kanyun/
  17
+
  18
+end script
  19
+
  20
+exec su -s /bin/sh -c "exec kanyun-api" kanyun
3  debian/kanyun-common.install
... ...
@@ -0,0 +1,3 @@
  1
+usr/lib/python*/dist-packages/*
  2
+bin/kanyun-manager /usr/bin
  3
+etc/kanyun.conf.example /etc/kanyun/
14  debian/kanyun-common.postinst
... ...
@@ -0,0 +1,14 @@
  1
+#!/bin/sh -e
  2
+
  3
+if [ "$1" = "configure" ]; then
  4
+    if ! getent group kanyun> /dev/null 2>&1; then
  5
+        addgroup --system kanyun>/dev/null
  6
+    fi
  7
+    if ! getent passwd kanyun> /dev/null 2>&1; then
  8
+        mkdir -p /var/lib/kanyun
  9
+        adduser --system --home /var/lib/kanyun --ingroup kanyun --no-create-home --shell /bin/false kanyun
  10
+    fi
  11
+fi
  12
+mkdir -p /var/log/kanyun
  13
+mkdir -p /etc/kanyun
  14
+chown -R kanyun:kanyun /var/log/kanyun /etc/kanyun/ /var/lib/kanyun
1  debian/kanyun-server.install
... ...
@@ -0,0 +1 @@
  1
+bin/kanyun-server /usr/bin/
4  debian/kanyun-server.logrotate
... ...
@@ -0,0 +1,4 @@
  1
+/var/log/kanyun/kanyun-server.log{
  2
+daily
  3
+rotate 15
  4
+}
20  debian/kanyun-server.upstart
... ...
@@ -0,0 +1,20 @@
  1
+description "kanyun monitor service"
  2
+author "yaguang <yaguang@staff.sina.com.cn>"
  3
+
  4
+start on (filesystem and net-device-up IFACE!=lo)
  5
+stop on runlevel [016]
  6
+
  7
+respawn
  8
+
  9
+chdir /var/run
  10
+
  11
+pre-start script
  12
+	mkdir -p /var/run/kanyun
  13
+	chown kanyun:root /var/run/kanyun/
  14
+
  15
+	mkdir -p /var/lock/kanyun
  16
+	chown kanyun:root /var/lock/kanyun/
  17
+
  18
+end script
  19
+
  20
+exec su -s /bin/sh -c "exec kanyun-server" kanyun
3  debian/kanyun-worker.install
... ...
@@ -0,0 +1,3 @@
  1
+usr/lib/python*/dist-packages/*
  2
+bin/kanyun-worker /usr/bin/
  3
+
4  debian/kanyun-worker.logrotate
... ...
@@ -0,0 +1,4 @@
  1
+/var/log/kanyun/kanyun-worker.log{
  2
+   daily
  3
+   rotate 15
  4
+}
20  debian/kanyun-worker.upstart
... ...
@@ -0,0 +1,20 @@
  1
+description "kanyun monitor service"
  2
+author "yaguang <yaguang@staff.sina.com.cn>"
  3
+
  4
+start on (filesystem and net-device-up IFACE!=lo)
  5
+stop on runlevel [016]
  6
+
  7
+respawn
  8
+
  9
+chdir /var/run
  10
+
  11
+pre-start script
  12
+	mkdir -p /var/run/kanyun
  13
+	chown kanyun:root /var/run/kanyun/
  14
+
  15
+	mkdir -p /var/lock/kanyun
  16
+	chown kanyun:root /var/lock/kanyun/
  17
+
  18
+end script
  19
+
  20
+exec su -s /bin/sh -c "exec kanyun-worker" root
21  debian/rules
... ...
@@ -0,0 +1,21 @@
  1
+#!/usr/bin/make -f
  2
+# -*- makefile -*-
  3
+# Sample debian/rules that uses debhelper.
  4
+#
  5
+# This file was originally written by Joey Hess and Craig Small.
  6
+# As a special exception, when this file is copied by dh-make into a
  7
+# dh-make output file, you may use that output file without restriction.
  8
+# This special exception was added by Craig Small in version 0.37 of dh-make.
  9
+#
  10
+# Modified to make a template file for a multi-binary package with separated
  11
+# build-arch and build-indep targets  by Bill Allombert 2001
  12
+
  13
+# Uncomment this to turn on verbose mode.
  14
+#export DH_VERBOSE=1
  15
+
  16
+# This has to be exported to make some magic below work.
  17
+export DH_OPTIONS
  18
+
  19
+
  20
+%:
  21
+	dh $@ --with python2
1  debian/source/format
... ...
@@ -0,0 +1 @@
  1
+3.0 (quilt)
23  debian/watch
... ...
@@ -0,0 +1,23 @@
  1
+# Example watch control file for uscan
  2
+# Rename this file to "watch" and then you can run the "uscan" command
  3
+# to check for upstream updates and more.
  4
+# See uscan(1) for format
  5
+
  6
+# Compulsory line, this is a version 3 file
  7
+version=3
  8
+
  9
+# Uncomment to examine a Webpage
  10
+# <Webpage URL> <string match>
  11
+#http://www.example.com/downloads.php kanyun-(.*)\.tar\.gz
  12
+
  13
+# Uncomment to examine a Webserver directory
  14
+#http://www.example.com/pub/kanyun-(.*)\.tar\.gz
  15
+
  16
+# Uncommment to examine a FTP server
  17
+#ftp://ftp.example.com/pub/kanyun-(.*)\.tar\.gz debian uupdate
  18
+
  19
+# Uncomment to find new files on sourceforge, for devscripts >= 2.9
  20
+# http://sf.net/kanyun/kanyun-(.*)\.tar\.gz
  21
+
  22
+# Uncomment to find new files on GooglePages
  23
+# http://example.googlepages.com/foo.html kanyun-(.*)\.tar\.gz
8  bin/kanyun.conf.example → etc/kanyun.conf.example
@@ -8,22 +8,22 @@ sql_connection: <copy from /etc/nova/nova.conf>
8 8
 host: *
9 9
 port: 5551
10 10
 db_host: 127.0.0.1
11  
-log: /tmp/kanyun-server.log
  11
+log: /var/log/kanyun/kanyun-server.log
12 12
 
13 13
 [api]
14 14
 api_host: *
15 15
 api_port: 5556
16 16
 db_host: 127.0.0.1
17  
-log: /tmp/kanyun-api.log
  17
+log: /var/log/kanyun/kanyun-api.log
18 18
 
19 19
 [worker]
20 20
 id: worker1
21 21
 worker_timeout: 60
22 22
 dataserver_host: 127.0.0.1
23 23
 dataserver_port: 5551
24  
-log: /tmp/kanyun-worker.log
  24
+log: /var/log/kanyun/kanyun-worker.log
25 25
 
26 26
 [client]
27 27
 api_host: 127.0.0.1
28 28
 api_port: 5556
29  
-log: /tmp/kanyun-client.log
  29
+log: /var/log/kanyun/kanyun-client.log

0 notes on commit 7895ff6

Please sign in to comment.
Something went wrong with that request. Please try again.