Skip to content

Commit

Permalink
update rpmspec to bundle vdc-fluentd.
Browse files Browse the repository at this point in the history
  • Loading branch information
Masahiro Fujiwara committed Oct 23, 2013
1 parent 5ad6111 commit d810474
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
6 changes: 6 additions & 0 deletions contrib/etc/default/vdc-fluentd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# source common params
[ -f /etc/default/wakame-vdc ] && . /etc/default/wakame-vdc

# Comment out to run the vdc init script
#RUN=yes

33 changes: 33 additions & 0 deletions contrib/etc/init/vdc-fluentd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
description "Wakame-VDC: relay fluentd"
author "axsh Co."

start on vdc-net-device-up
stop on vdc-net-device-down
#start on (started rabbitmq-server)
#stop on (stopped rabbitmq-server or stopped mysql)

respawn
respawn limit 5 60

## agent name
env NAME=fluentd

script
[ -f /etc/default/vdc-${NAME} ] && . /etc/default/vdc-${NAME}
[ "x${RUN}" != "xyes" ] && {
logger "[${NAME}] ${NAME} will not start. because RUN is not 'yes' in /etc/default/vdc-${NAME}."
exit 0
}

ulimit -c ${DAEMON_COREFILE_LIMIT:-0}

[ -d "${VDC_ROOT}" ] || {
logger "no such directory: ${VDC_ROOT}"
exit 1
}
cd ${VDC_ROOT}/vdc-fluentd/

exec ${VDC_ROOT}/vdc-fluentd/bin/${NAME} \
--config /etc/wakame-vdc/fluentd.conf \
--log /var/log/wakame-vdc/${NAME}.log
end script
3 changes: 3 additions & 0 deletions rpmbuild/SPECS/wakame-vdc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ components="
dolphin
contrib
vendor
vdc-fluentd
"
for component in ${components}; do
rsync -aHA --exclude=".git/*" --exclude="*~" --exclude="*/cache/*.gem" --exclude="*/cache/bundler/git/*" `pwd`/${component} ${RPM_BUILD_ROOT}/%{prefix}/%{oname}/
Expand Down Expand Up @@ -557,6 +558,8 @@ trema_home_realpath=`cd %{prefix}/%{oname}/dcmgr && %{prefix}/%{oname}/ruby/bin/
%config(noreplace) /etc/default/vdc-hva
%config /etc/init/vdc-hva.conf
%config /etc/init/vdc-hva-worker.conf
%config(noreplace) /etc/default/vdc-fluentd
%config /etc/init/vdc-fluentd.conf
%config /etc/sysctl.d/30-bridge-if.conf
%dir /var/lib/%{oname}/instances
%dir /var/lib/%{oname}/instances/tmp
Expand Down
9 changes: 7 additions & 2 deletions rpmbuild/rules
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,14 @@ bundle-install-stamp:
(cd $(CURDIR)/frontend/dcmgr_gui && rm -rf vendor/cache && mkdir -p vendor && ln -fs ../../../vendor/cache vendor/)

# Use dolphin_client gem in local since the local version is the latest.
(cd $(CURDIR)/client/dolphin && gem build ./dolphin_client.gemspec && mv dolphin_client-*.gem $(CURDIR)/dcmgr/vendor/cache)
(cd $(CURDIR)/client/dolphin && gem build ./dolphin_client.gemspec && cp dolphin_client-*.gem $(CURDIR)/dcmgr/vendor/cache)

# Use metric_libs gem in local since the local version is the latest.
(cd $(CURDIR)/metric_libs && gem build ./metric_libs.gemspec && mv metric_libs-*.gem $(CURDIR)/dcmgr/vendor/cache)
(cd $(CURDIR)/metric_libs && gem build ./metric_libs.gemspec && cp metric_libs-*.gem $(CURDIR)/dcmgr/vendor/cache)

mkdir -p $(CURDIR)/vdc-fluentd/vendor/cache
(cp $(CURDIR)/client/dolphin/dolphin_client-*.gem $(CURDIR)/vdc-fluentd/vendor/cache)
(cp $(CURDIR)/metric_libs/metric_libs-*.gem $(CURDIR)/vdc-fluentd/vendor/cache)

mkdir -p $(CURDIR)/vendor/bundle/ruby
# in order to build rpm, client(ruby-hijiki)/ is no need.
Expand All @@ -58,6 +62,7 @@ bundle-install-stamp:
(cd $(CURDIR)/frontend/dcmgr_gui && rm -rf vendor/bundle && mkdir -p vendor/bundle && ln -fs ../../../../vendor/bundle/ruby vendor/bundle/ && bundle install --standalone --path vendor/bundle)
(cd $(CURDIR)/frontend/admin && rm -rf vendor/bundle && mkdir -p vendor/bundle && ln -fs ../../../../vendor/bundle/ruby vendor/bundle/ && bundle install --standalone --path vendor/bundle)
(cd $(CURDIR)/dolphin && rm -rf vendor/bundle && mkdir -p vendor/bundle && ln -fs ../../../vendor/bundle/ruby vendor/bundle/ && bundle install --standalone --path vendor/bundle)
(cd $(CURDIR)/vdc-fluentd && rm -rf vendor/bundle && mkdir -p vendor/bundle && ln -fs ../../../vendor/bundle/ruby vendor/bundle/ && PKGBUILD=1 bundle install --standalone --path vendor/bundle)
[ "$(RUBYDIR)" = "$(CURDIR)/ruby" ] || mv $(CURDIR)/client/ruby-hijiki.saved $(CURDIR)/client/ruby-hijiki

[ "$(RUBYDIR)" = "$(CURDIR)/ruby" ] || mv $(CURDIR)/client/dolphin.saved $(CURDIR)/client/dolphin
Expand Down

0 comments on commit d810474

Please sign in to comment.