[csw-devel] SF.net SVN: gar:[19139] csw/mgar/pkg/lang-python/salt/trunk
romeotheriault at users.sourceforge.net
romeotheriault at users.sourceforge.net
Tue Sep 4 10:45:10 CEST 2012
Revision: 19139
http://gar.svn.sourceforge.net/gar/?rev=19139&view=rev
Author: romeotheriault
Date: 2012-09-04 08:45:10 +0000 (Tue, 04 Sep 2012)
Log Message:
-----------
lang-python/salt/trunk: Added template config files and also init/smf scripts
Modified Paths:
--------------
csw/mgar/pkg/lang-python/salt/trunk/Makefile
Added Paths:
-----------
csw/mgar/pkg/lang-python/salt/trunk/files/cswsalt-master
csw/mgar/pkg/lang-python/salt/trunk/files/cswsalt-minion
Modified: csw/mgar/pkg/lang-python/salt/trunk/Makefile
===================================================================
--- csw/mgar/pkg/lang-python/salt/trunk/Makefile 2012-09-04 00:15:54 UTC (rev 19138)
+++ csw/mgar/pkg/lang-python/salt/trunk/Makefile 2012-09-04 08:45:10 UTC (rev 19139)
@@ -1,5 +1,3 @@
-#TODO:
-# * Create init scripts
NAME = salt
VERSION = 0.10.2
GARTYPE = v2
@@ -11,7 +9,9 @@
endef
MASTER_SITES = https://github.com/downloads/saltstack/salt/
-DISTFILES = $(DISTNAME).tar.gz
+DISTFILES += $(DISTNAME).tar.gz
+DISTFILES += cswsalt-minion
+DISTFILES += cswsalt-master
RUNTIME_DEP_PKGS_CSWpy-salt += CSWpy-yaml
RUNTIME_DEP_PKGS_CSWpy-salt += CSWpy-m2crypto
@@ -20,7 +20,7 @@
RUNTIME_DEP_PKGS_CSWpy-salt += CSWpy-pyzmq
RUNTIME_DEP_PKGS_CSWpy-salt += CSWpy-msgpack-python
-#CHECKPKG_OVERRIDES_CSWpy-salt += pkginfo-opencsw-repository-uncommitted
+CHECKPKG_OVERRIDES_CSWpy-salt += pkginfo-opencsw-repository-uncommitted
CHECKPKG_OVERRIDES_CSWpy-salt += surplus-dependency|CSWpy-m2crypto
CHECKPKG_OVERRIDES_CSWpy-salt += surplus-dependency|CSWpy-yaml
@@ -47,6 +47,11 @@
TEST_SCRIPTS =
+INITSMF += $(sysconfdir)/init.d/cswsalt-minion
+INITSMF += $(sysconfdir)/init.d/cswsalt-master
+PRESERVECONF += $(sysconfdir)/salt/minion
+PRESERVECONF += $(sysconfdir)/salt/master
+
include gar/category.mk
post-install-modulated: CONFDEST = $(DESTDIR)$(sysconfdir)/salt
@@ -56,6 +61,15 @@
# Copy config files (upstream)
ginstall -d $(CONFDEST)
cp $(addprefix $(WORKSRC)/conf/,$(CONFS)) $(CONFDEST)
+ gsed -i -e 's+/etc/salt+/etc/opt/csw/salt+g' $(DESTDIR)$(sysconfdir)/salt/master.template
+ gsed -i -e 's+/etc/salt+/etc/opt/csw/salt+g' $(DESTDIR)$(sysconfdir)/salt/minion.template
+ gsed -i -e 's+#pki_dir:+pki_dir:+g' $(DESTDIR)$(sysconfdir)/salt/master.template
+ gsed -i -e 's+#pki_dir:+pki_dir:+g' $(DESTDIR)$(sysconfdir)/salt/minion.template
+ mv $(CONFDEST)/minion.template $(CONFDEST)/minion
+ mv $(CONFDEST)/master.template $(CONFDEST)/master
+ # Copy init script in place
+ ginstall -d -m 755 $(DESTDIR)$(sysconfdir)/init.d
+ ginstall -m 755 $(DOWNLOADDIR)/cswsalt-minion $(DESTDIR)$(sysconfdir)/init.d
+ ginstall -m 755 $(DOWNLOADDIR)/cswsalt-master $(DESTDIR)$(sysconfdir)/init.d
@$(MAKECOOKIE)
-
Added: csw/mgar/pkg/lang-python/salt/trunk/files/cswsalt-master
===================================================================
--- csw/mgar/pkg/lang-python/salt/trunk/files/cswsalt-master (rev 0)
+++ csw/mgar/pkg/lang-python/salt/trunk/files/cswsalt-master 2012-09-04 08:45:10 UTC (rev 19139)
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+#AUTOENABLE no
+#
+
+PATH=/opt/csw/bin:$PATH
+export PATH
+CONF_FILE=/etc/opt/csw/salt/master
+PIDFILE=/var/run/salt-master.pid
+SALTMASTER=/opt/csw/bin/salt-master
+
+[ ! -f ${CONF_FILE} ] && exit $CONF_FILE
+
+start_service() {
+ /bin/rm -f ${PIDFILE}
+ $SALTMASTER -d -c ${CONF_FILE} 2>&1
+}
+
+stop_service() {
+ if [ -f "$PIDFILE" ]; then
+ /usr/bin/kill -TERM `/usr/bin/cat $PIDFILE`
+ fi
+}
+
+case "$1" in
+start)
+ start_service
+ ;;
+stop)
+ stop_service
+ ;;
+restart)
+ stop_service
+ sleep 1
+ start_service
+ ;;
+*)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+ ;;
+esac
Added: csw/mgar/pkg/lang-python/salt/trunk/files/cswsalt-minion
===================================================================
--- csw/mgar/pkg/lang-python/salt/trunk/files/cswsalt-minion (rev 0)
+++ csw/mgar/pkg/lang-python/salt/trunk/files/cswsalt-minion 2012-09-04 08:45:10 UTC (rev 19139)
@@ -0,0 +1,41 @@
+#!/bin/sh
+#
+#AUTOENABLE no
+#
+
+PATH=/opt/csw/bin:$PATH
+export PATH
+CONF_FILE=/etc/opt/csw/salt/minion
+PIDFILE=/var/run/salt-minion.pid
+SALTMINION=/opt/csw/bin/salt-minion
+
+[ ! -f ${CONF_FILE} ] && exit $CONF_FILE
+
+start_service() {
+ /bin/rm -f ${PIDFILE}
+ $SALTMINION -d -c ${CONF_FILE} 2>&1
+}
+
+stop_service() {
+ if [ -f "$PIDFILE" ]; then
+ /usr/bin/kill -TERM `/usr/bin/cat $PIDFILE`
+ fi
+}
+
+case "$1" in
+start)
+ start_service
+ ;;
+stop)
+ stop_service
+ ;;
+restart)
+ stop_service
+ sleep 1
+ start_service
+ ;;
+*)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+ ;;
+esac
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list