packages: flashpolicyd/flashpolicyd.spec, flashpolicyd/flashpolicyd.init (N...

glen glen at pld-linux.org
Tue Feb 9 17:07:39 CET 2010


Author: glen                         Date: Tue Feb  9 16:07:39 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- pldized initscript

---- Files affected:
packages/flashpolicyd:
   flashpolicyd.spec (1.2 -> 1.3) , flashpolicyd.init (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/flashpolicyd/flashpolicyd.spec
diff -u packages/flashpolicyd/flashpolicyd.spec:1.2 packages/flashpolicyd/flashpolicyd.spec:1.3
--- packages/flashpolicyd/flashpolicyd.spec:1.2	Tue Feb  9 16:33:22 2010
+++ packages/flashpolicyd/flashpolicyd.spec	Tue Feb  9 17:07:34 2010
@@ -3,12 +3,13 @@
 Summary:	Daemon to serve Adobe Flash socket policy XML
 Name:		flashpolicyd
 Version:	2.1
-Release:	0.1
+Release:	0.2
 License:	GPL v2
 Group:		Networking/Daemons
 URL:		http://code.google.com/p/flashpolicyd/
 Source0:	http://flashpolicyd.googlecode.com/files/%{name}-%{version}.tgz
 # Source0-md5:	0ad1ed0b130cf5850d77600fab90a7c2
+Source1:	%{name}.init
 BuildRequires:	rpmbuild(macros) >= 1.268
 Requires(post,preun):	/sbin/chkconfig
 Requires:	rc-scripts
@@ -45,7 +46,7 @@
 %install
 rm -rf $RPM_BUILD_ROOT
 install -d $RPM_BUILD_ROOT{/etc/{sysconfig,rc.d/init.d},%{_sbindir}}
-install -p flashpolicyd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/flashpolicyd
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/flashpolicyd
 install -p flashpolicyd.rb $RPM_BUILD_ROOT%{_sbindir}/flashpolicyd
 cp -a flashpolicy.xml $RPM_BUILD_ROOT%{_sysconfdir}/flashpolicy.xml
 
@@ -84,6 +85,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.3  2010/02/09 16:07:34  glen
+- pldized initscript
+
 Revision 1.2  2010/02/09 15:33:22  glen
 - subpackage for nagios compatible plugin
 

================================================================
Index: packages/flashpolicyd/flashpolicyd.init
diff -u /dev/null packages/flashpolicyd/flashpolicyd.init:1.1
--- /dev/null	Tue Feb  9 17:07:39 2010
+++ packages/flashpolicyd/flashpolicyd.init	Tue Feb  9 17:07:34 2010
@@ -0,0 +1,103 @@
+#!/bin/sh
+#
+# flashpolicyd	flashpolicyd short service description
+#
+# chkconfig:	345 20 20
+#
+# description: Starts a server on port 843 to server flash policy requests
+#
+# processname:	flashpolicyd
+# config: /etc/flashpolicy.xml
+#
+# $Id$
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Set defaults
+TIMEOUT=10
+XML=/etc/flashpolicy.xml
+LOGFREQ=1800
+LOGFILE=/var/log/flashpolicyd.log
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/flashpolicyd ] && . /etc/sysconfig/flashpolicyd
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+	if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+		msg_network_down "Flash policy server"
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+start() {
+	# Check if the service is already running?
+	if [ -f /var/lock/subsys/flashpolicyd ]; then
+		msg_already_running "Flash policy server"
+		return
+	fi
+
+	msg_starting "Flash policy server"
+	daemon /usr/sbin/flashpolicyd --timeout=$TIMEOUT --xml=$XML --logfreq=$LOGFREQ --logfile=$LOGFILE
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/flashpolicyd
+}
+
+stop() {
+	if [ ! -f /var/lock/subsys/flashpolicyd ]; then
+		msg_not_running "Flash policy server"
+		return
+	fi
+
+	# Stop daemons.
+	msg_stopping "Flash policy server"
+	killproc flashpolicyd
+	rm -f /var/lock/subsys/flashpolicyd
+}
+
+condrestart() {
+	if [ ! -f /var/lock/subsys/flashpolicyd ]; then
+		msg_not_running "Flash policy server"
+		RETVAL=$1
+		return
+	fi
+
+	stop
+	start
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+  	start
+	;;
+  stop)
+  	stop
+	;;
+  restart)
+	stop
+	start
+	;;
+  try-restart)
+	condrestart 0
+	;;
+  force-reload)
+	condrestart 7
+	;;
+  status)
+	status flashpolicyd
+	RETVAL=$?
+	;;
+  *)
+	msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
+	exit 3
+esac
+
+exit $RETVAL
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/flashpolicyd/flashpolicyd.spec?r1=1.2&r2=1.3&f=u



More information about the pld-cvs-commit mailing list