Merge lp:~cblument/agent-smith/redhat-initscript into lp:agent-smith

Proposed by Chris Blumentritt
Status: Merged
Approved by: Antony Messerli
Approved revision: 104
Merged at revision: 104
Proposed branch: lp:~cblument/agent-smith/redhat-initscript
Merge into: lp:agent-smith
Diff against target: 96 lines (+76/-0)
2 files modified
agent-smith.redhat.init.in (+74/-0)
configure.ac (+2/-0)
To merge this branch: bzr merge lp:~cblument/agent-smith/redhat-initscript
Reviewer Review Type Date Requested Status
Antony Messerli Approve
Review via email: mp+47839@code.launchpad.net

Description of the change

Added redhat initscript infile

To post a comment you must log in.
Revision history for this message
Antony Messerli (antonym) wrote :

Approved.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'agent-smith.redhat.init.in'
2--- agent-smith.redhat.init.in 1970-01-01 00:00:00 +0000
3+++ agent-smith.redhat.init.in 2011-01-28 17:59:11 +0000
4@@ -0,0 +1,74 @@
5+#!/bin/bash
6+#
7+# agent-smith Startup script for cloud servers guest agent
8+#
9+# chkconfig: 2345 7 93
10+# description: agent-smith is a agent meant to run on linux guest instances \
11+# on Citrix XenServer for manipulating the guest through \
12+# xenstore.
13+# processname: agent-smith
14+# pidfile: /var/run/agent-smith.pid
15+
16+# Source function library.
17+. /etc/rc.d/init.d/functions
18+
19+prefix=@prefix@
20+exec_prefix=@exec_prefix@
21+datarootdir=@datarootdir@
22+datadir=@datadir@
23+sbindir=@sbindir@
24+
25+scriptdir=${datadir}/agent-smith
26+asbindir=${sbindir}
27+updatename="/var/run/agent-smith.tar"
28+pidfile="/var/run/agent-smith.pid"
29+
30+apply_update() {
31+ if [ -e $updatename -o -e ${updatename}.gz ]; then
32+ if [ -e ${updatename}.gz ] ; then
33+ updatename="${updatename}.gz"
34+ tarargs="z"
35+ else
36+ tarargs=""
37+ fi
38+
39+ if tar -t${tarargs}f $updatename > /dev/null 2>&1 ; then
40+ cat ${scriptdir}/filelist | while read f ; do
41+ test -f "$f" && rm -f "$f"
42+ done
43+ tar -x${tarargs}C / -f $updatename
44+ else
45+ echo "Ignoring broken update archive"
46+ fi
47+ rm -f $updatename ${updatename}.gz
48+ fi
49+}
50+
51+do_start() {
52+ apply_update
53+ ${asbindir}/agent-smith ${scriptdir}/dispatcher.sh
54+}
55+
56+do_stop() {
57+ kill `cat ${pidfile}`
58+ rm -f ${pidfile}
59+}
60+
61+case "$1" in
62+ start)
63+ do_start
64+ ;;
65+ stop)
66+ do_stop
67+ ;;
68+ restart)
69+ do_stop
70+ do_start
71+ ;;
72+ *)
73+ echo "Usage: $SCRIPTNAME {start|stop|restart}" >&2
74+ exit 3
75+ ;;
76+esac
77+
78+:
79
80=== modified file 'configure.ac'
81--- configure.ac 2010-12-29 22:49:45 +0000
82+++ configure.ac 2011-01-28 17:59:11 +0000
83@@ -182,11 +182,13 @@
84 scripts/tests/Makefile
85 src/Makefile
86 agent-smith.init
87+ agent-smith.redhat.init
88 scripts/version.sh])
89 AC_OUTPUT
90
91 chmod 755 scripts/version.sh
92 chmod 755 agent-smith.init
93+chmod 755 agent-smith.redhat.init
94
95 if test x$ac_cv_lib_check_srunner_create != xyes ; then
96 echo ""

Subscribers

People subscribed via source and target branches