]> git.pld-linux.org Git - packages/flashpolicyd.git/commitdiff
- pldized initscript
authorElan Ruusamäe <glen@pld-linux.org>
Tue, 9 Feb 2010 16:07:34 +0000 (16:07 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    flashpolicyd.init -> 1.1
    flashpolicyd.spec -> 1.3

flashpolicyd.init [new file with mode: 0644]
flashpolicyd.spec

diff --git a/flashpolicyd.init b/flashpolicyd.init
new file mode 100644 (file)
index 0000000..c7409bd
--- /dev/null
@@ -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
index 2b0818c424d0ab7b8365d5f4c8f27fdc4aac7719..4018b4fe5a176f762b6316629989c52003bbf41b 100644 (file)
@@ -2,12 +2,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
@@ -44,7 +45,7 @@ EOF
 %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
 
This page took 0.072549 seconds and 4 git commands to generate.