diff options
author | Elan Ruusamäe | 2008-10-14 19:48:25 (GMT) |
---|---|---|
committer | Elan Ruusamäe | 2013-06-16 20:58:13 (GMT) |
commit | e5f32fcefcc489c8d68e050ad142442c926c5ad6 (patch) | |
tree | 17238658c046bb86cfc365db71c77e2e2d697a2d | |
parent | 8a65acbfe478b55edcd779b3c4392da4e276a9d3 (diff) | |
download | switchboard-master.zip switchboard-master.tar.gz |
-rwxr-xr-x | switchboard.init | 106 | ||||
-rw-r--r-- | switchboard.spec | 9 |
2 files changed, 113 insertions, 2 deletions
diff --git a/switchboard.init b/switchboard.init new file mode 100755 index 0000000..d89dfe9 --- /dev/null +++ b/switchboard.init @@ -0,0 +1,106 @@ +#!/bin/sh +# +# switchboard switchboard is a FastCGI proxy +# +# chkconfig: 345 80 30 +# +# description: switchboard is a FastCGI proxy +# +# processname: switchboard +# config: +# pidfile: +# +# $Id: switchboard.init,v 1.1 2008/10/14 19:39:58 glen Exp $ + +# Source function library +. /etc/rc.d/init.d/functions + +# Get network config +. /etc/sysconfig/network + +# Get service config - may override defaults +[ -f /etc/sysconfig/switchboard ] && . /etc/sysconfig/switchboard + +# 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 switchboard + exit 1 + fi +else + exit 0 +fi + +start() { + # Check if the service is already running? + if [ ! -f /var/lock/subsys/switchboard ]; then + msg_starting switchboard + daemon /usr/sbin/switchboard + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/switchboard + else + msg_already_running switchboard + fi +} + +stop() { + if [ -f /var/lock/subsys/switchboard ]; then + # Stop daemons. + msg_stopping switchboard + killproc --pidfile /var/run/switchboard.pid switchboard -TERM + rm -f /var/lock/subsys/switchboard + else + msg_not_running switchboard + fi +} + +reload() { + if [ -f /var/lock/subsys/switchboard ]; then + msg_reloading switchboard + killproc --pidfile /var/run/switchboard.pid switchboard -HUP + RETVAL=$? + else + msg_not_running switchboard + RETVAL=7 + fi +} + +condrestart() { + if [ -f /var/lock/subsys/switchboard ]; then + stop + start + else + msg_not_running switchboard + RETVAL=$1 + fi +} + +RETVAL=0 +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + start + ;; + try-restart) + condrestart 0 + ;; + reload|force-reload) + reload + ;; + status) + status switchboard + RETVAL=$? + ;; + *) + msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}" + exit 3 +esac + +exit $RETVAL diff --git a/switchboard.spec b/switchboard.spec index de3a6c4..50020d7 100644 --- a/switchboard.spec +++ b/switchboard.spec @@ -7,11 +7,12 @@ Summary: FastCGI proxy that starts setuid FastCGI processes on demand Name: switchboard Version: 2.0.18 -Release: 0.1 +Release: 0.2 License: BSD Group: Applications Source0: http://www.flyingparchment.org.uk/dump/%{name}-%{version}.tar.gz # Source0-md5: 3376d3fbce213353321e1fbecd3dcd61 +Source1: %{name}.init URL: https://confluence.toolserver.org/display/switchboard/Home BuildRequires: boost-devel BuildRequires: pam-devel @@ -48,6 +49,7 @@ CXXFLAGS="%{rpmcxxflags}" \ ./configure \ --prefix=%{_prefix} \ --confdir=%{_sysconfdir} \ + --php-bin=/usr/bin/php.fcgi \ --log-exec=/var/log/%{name}/suexec.log \ --uid-min=50 \ --gid-min=50 \ @@ -58,7 +60,7 @@ CXXFLAGS="%{rpmcxxflags}" \ %install rm -rf $RPM_BUILD_ROOT -install -d $RPM_BUILD_ROOT +install -d $RPM_BUILD_ROOT{/var/run/%{name},/etc/rc.d/init.d} %{__make} install \ MANDIR=%{_mandir} \ @@ -68,6 +70,8 @@ install -d $RPM_BUILD_ROOT SB_GROUP=%(id -gn) \ DESTDIR=$RPM_BUILD_ROOT +install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/%{name} + mv $RPM_BUILD_ROOT%{_sysconfdir}/switchboard.conf{.example,} %clean @@ -78,6 +82,7 @@ rm -rf $RPM_BUILD_ROOT %doc README %dir %{_sysconfdir} %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/switchboard.conf +%attr(754,root,root) /etc/rc.d/init.d/%{name} %attr(755,root,root) %{_sbindir}/switchboard %attr(755,root,root) %{_sbindir}/switchstats |