Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 150248 Details for
Bug 232684
need initscripts for Solaris
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
diffs
cvsdiffs (text/plain), 10.05 KB, created by
Rich Megginson
on 2007-03-16 16:52:41 UTC
(
hide
)
Description:
diffs
Filename:
MIME Type:
Creator:
Rich Megginson
Created:
2007-03-16 16:52:41 UTC
Size:
10.05 KB
patch
obsolete
>Index: initscript.in >=================================================================== >RCS file: /cvs/dirsec/ldapserver/wrappers/initscript.in,v >retrieving revision 1.3 >diff -u -8 -r1.3 initscript.in >--- initscript.in 12 Feb 2007 20:10:21 -0000 1.3 >+++ initscript.in 16 Mar 2007 16:48:09 -0000 >@@ -1,111 +1,162 @@ >-#!/bin/bash >+#!/bin/sh > # > # @package_name@ This starts and stops @package_name@ > # > # chkconfig: - 21 79 > # description: @package_name@ Directory Server > # processname: @sbindir@/ns-slapd > # configdir: @sysconfdir@/@package_name@/ > # piddir: @localstatedir@/run/@package_name@ > # datadir: @localstatedir@/lib/@package_name@/slapd-<instance name> > # > > # Source function library. >+if [ -f /etc/rc.d/init.d/functions ] ; then > . /etc/rc.d/init.d/functions >+fi > # Source networking configuration. >+if [ -f /etc/sysconfig/network ] ; then > . /etc/sysconfig/network >+fi > > # Check that networking is up. >-if [ ${NETWORKING} = "no" ] >+if [ "${NETWORKING}" = "no" ] > then > echo "Networking is down" > exit 0 > fi > >+# return a list of process ids of the process given in $1 >+findpids() >+{ >+ type pidof > /dev/null 2>&1 && pidof "$1" >+ type pgrep > /dev/null 2>&1 && pgrep "$baseexec" >+} >+ >+# failure and success are not defined on some platforms >+type failure > /dev/null 2>&1 || { >+failure() >+{ >+ echo " FAILED\c" >+} >+} >+ >+type success > /dev/null 2>&1 || { >+success() >+{ >+ echo " SUCCESS\c" >+} >+} > >-exec="@sbindir@/ns-slapd" >+# On Solaris /var/run is in tmpfs and gets wiped out upon reboot >+# we have to recreate the /var/run/@package_name@ directory >+# We also have to make sure that the directory is writable >+# by the directory server process >+# the argument to this function is the server instance directory, >+# which must have a dse.ldif file in it >+fix_pid_dir_ownership() >+{ >+ if [ ! -d $piddir ] ; then >+ mkdir -p $piddir >+ owner=`grep \^nsslapd-localuser $1/dse.ldif | awk '{print $2}'` >+ if [ -n "$owner" ] ; then >+ chown $owner $piddir >+ chmod 700 $piddir >+ fi >+ fi >+} >+ >+baseexec="ns-slapd" >+exec="@sbindir@/$baseexec" > prog="@package_name@" > # Lockfile >-lockfile="@localstatedir@/lock/subsys/@package_name@" >+if [ -d "@localstatedir@/lock/subsys" ] ; then >+ lockfile="@localstatedir@/lock/subsys/@package_name@" >+else >+ lockfile="@localstatedir@/lock/@package_name@/lock" >+fi > # PID directory > piddir="@localstatedir@/run/@package_name@" >+ > # Instance basedir > instbase="@instconfigdir@" > > > [ -f $exec ] || exit 0 > > > umask 077 > >-pids=$(pidof $exec) >+pids=`findpids $exec` > > INSTANCES="" > > for FILE in `/bin/ls -d $instbase/slapd-* 2>/dev/null`; do > if [ -d "$FILE" ] ; then >- inst=$(echo "$FILE" | sed -e "s|$instbase/slapd-||") >+ inst=`echo "$FILE" | sed -e "s|$instbase/slapd-||"` > INSTANCES="$INSTANCES $inst" > fi > done > > if [ -n "$2" ]; then > for I in $INSTANCES; do > if [ "$2" = "$I" ]; then > INSTANCES="$2" > fi > done > if [ "$2" != "$INSTANCES" ]; then >- echo -n "$2 is an invalid @package_name@ instance" >+ echo "$2 is an invalid @package_name@ instance\c" > failure; echo > exit 1 > fi > fi > > start() { > if [ -n "$INSTANCES" ]; then >- export LD_LIBRARY_PATH=@libdir@/@package_name@:@nss_libdir@ >+ LD_LIBRARY_PATH=@libdir@/@package_name@:@nss_libdir@ >+ export LD_LIBRARY_PATH > echo "Starting $prog: " > # Start every slapd instance that isn't already running > errors=0 > successes=0 > for instance in $INSTANCES; do >- echo -n " $instance..." >+ echo " $instance...\c" > # the server creates pidfile and writes the pid to it when it is fully > # started and available to serve clients > pidfile=$piddir/slapd-$instance.pid > # the server creates startpidfile and writes the pid to just after > # the process begins i.e. it received the startup request and didn't > # die a horrible death (e.g. shared lib problem, oom, etc.) > startpidfile=$piddir/slapd-$instance.startpid > server_running=0 >- if [ -e $pidfile ]; then >- pid=$(cat $pidfile) >- if [ $(echo "$pids" | grep -c $pid) -ge 1 ]; then >- echo -n " already running" >+ if [ -f $pidfile ]; then >+ pid=`cat $pidfile` >+ if kill -0 $pid > /dev/null 2>&1 ; then >+ echo " already running\c" > success; echo >- let successes=successes+1 >+ successes=`expr $successes + 1` > server_running=1 > else >- echo -n " not running, but pid file exists - attempt to start anyway..." >+ echo " not running, but pid file exists - attempt to start anyway...\c" > rm -f $pidfile > fi > fi > server_started=0 > if [ $server_running -eq 0 ] ; then > rm -f $pidfile > rm -f $startpidfile >+ fix_pid_dir_ownership $instbase/slapd-$instance > $exec -D $instbase/slapd-$instance -i $pidfile -w $startpidfile > if [ $? -eq 0 ]; then > server_started=1 # well, perhaps not running, but started ok > else > failure; echo >- let errors=errors+1 >+ errors=`expr $errors + 1` > fi > fi > # ok, if we started the server successfully, let's see if it is really > # running and ready to serve requests > if [ $server_started -eq 1 ] ; then > loop_counter=1 > # wait for 10 seconds for the start pid file to appear > max_count=10 >@@ -114,17 +165,17 @@ > if test ! -f $startpidfile ; then > sleep 1 > else > pid=`cat $startpidfile` > fi > done > if test ! -f $startpidfile ; then > failure; echo >- let errors=errors+1 >+ errors=`expr $errors + 1` > server_started=0 > fi > fi > # ok, server wrote the startpid file - let's see if it comes up > # ready to service requests > if [ $server_started -eq 1 ] ; then > loop_counter=1 > # wait for 10 minutes (600 times 1 seconds) >@@ -139,20 +190,20 @@ > fi > else > pid=`cat $pidfile` > break > fi > done > if kill -0 $pid > /dev/null 2>&1 && test -f $pidfile ; then > success; echo >- let successes=successes+1 >+ successes=`expr $successes + 1` > else > failure; echo >- let errors=errors+1 >+ errors=`expr $errors + 1` > fi > fi > rm -f $startpidfile > done > if [ $successes -ge 1 ]; then > touch $lockfile > fi > if [ $errors -ge 1 ]; then >@@ -163,27 +214,27 @@ > fi > } > > stop() { > echo "Shutting down $prog: " > errors=0 > for instance in $INSTANCES; do > pidfile=$piddir/slapd-$instance.pid >- if [ -e $pidfile ]; then >- pid=$(cat $pidfile) >- echo -n " $instance..." >+ if [ -f $pidfile ]; then >+ pid=`cat $pidfile` >+ echo " $instance...\c" > server_stopped=0 >- if [ $(echo "$pids" | grep -c $pid) -ge 1 ]; then >+ if kill -0 $pid > /dev/null 2>&1 ; then > kill $pid > if [ $? -eq 0 ]; then > server_stopped=1 > else > failure; echo >- let errors=errors+1 >+ errors=`expr $errors + 1` > fi > fi > if [ $server_stopped -eq 1 ] ; then > loop_counter=1 > # wait for 10 minutes (600 times 1 second) > max_count=600 > while test $loop_counter -le $max_count; do > loop_counter=`expr $loop_counter + 1` >@@ -193,43 +244,43 @@ > if test -f $pidfile ; then > rm -f $pidfile > fi > break > fi > done > if test -f $pidfile ; then > failure; echo >- let errors=errors+1 >+ errors=`expr $errors + 1` > else > success; echo > rm -f $pidfile > fi > fi > fi > done > if [ $errors -ge 1 ]; then >- echo -n "*** Error: $errors instance(s) unsuccessfully stopped" >+ echo "*** Error: $errors instance(s) unsuccessfully stopped\c" > failure; echo > else > rm -f $lockfile > fi > } > > restart() { > stop > start > } > > > status() { > for instance in $INSTANCES; do >- if [ -e $piddir/slapd-$instance.pid ]; then >- pid=$(cat $piddir/slapd-$instance.pid) >- if [ $(echo "$pids" | grep -c $pid) -ge 1 ]; then >+ if [ -f $piddir/slapd-$instance.pid ]; then >+ pid=`cat $piddir/slapd-$instance.pid` >+ if kill -0 $pid > /dev/null 2>&1 ; then > echo "$prog $instance (pid $pid) is running..." > else > echo "$prog $instance dead but pid file exists" > fi > else > echo "$prog $instance is stopped" > fi > done >@@ -239,11 +290,12 @@ > case "$1" in > start|stop|restart|reload|status) > $1 > ;; > condrestart) > [ ! -f $lockfile ] || restart > ;; > *) >- echo $"Usage: $0 {start|stop|status|restart|condrestart} [instance-name]" >+ echo Unknown command $1 >+ echo "Usage: $0 {start|stop|status|restart|condrestart} [instance-name]" > exit 2 > esac
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 232684
: 150248