diff options
author | Rich Megginson <rmeggins@redhat.com> | 2007-03-16 23:06:58 +0000 |
---|---|---|
committer | Rich Megginson <rmeggins@redhat.com> | 2007-03-16 23:06:58 +0000 |
commit | 0d974b1de16450e987ea047d176ec49a5a691288 (patch) | |
tree | 9dbab4da44dcd0bbe344020645bc7d11f137dcff | |
parent | f21aa3dea521bcf6b48d0af1a0b480978623aa68 (diff) | |
download | ds-0d974b1de16450e987ea047d176ec49a5a691288.tar.gz ds-0d974b1de16450e987ea047d176ec49a5a691288.tar.xz ds-0d974b1de16450e987ea047d176ec49a5a691288.zip |
Resolves: bug 232684
Description: need initscripts for Solaris
Fix Description: I messed up the linux init script - turns out linux echo doesn't like \c, so I created a echo_n() function which is stolen from configure. I had to add @ECHO_N@ and @ECHO_C@ to Makefile.am and have them replaced in initscript.in.
-rw-r--r-- | Makefile.am | 8 | ||||
-rw-r--r-- | Makefile.in | 8 | ||||
-rw-r--r-- | wrappers/initscript.in | 26 |
3 files changed, 28 insertions, 14 deletions
diff --git a/Makefile.am b/Makefile.am index a63fe88c..a18ccddb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -981,7 +981,9 @@ fixupcmd = sed \ -e 's,@sysconfdir\@,$(sysconfdir),g' \ -e 's,@localstatedir\@,$(localstatedir),g' \ -e 's,@package_name\@,$(PACKAGE_NAME),g' \ - -e 's,@instconfigdir\@,$(instconfigdir),g' + -e 's,@instconfigdir\@,$(instconfigdir),g' \ + -e 's,@ECHO_N\@,$(ECHO_N),g' \ + -e 's,@ECHO_C\@,$(ECHO_C),g' else fixupcmd = sed \ -e 's,@bindir\@,$(bindir),g' \ @@ -1005,7 +1007,9 @@ fixupcmd = sed \ -e 's,@sysconfdir\@,$(sysconfdir),g' \ -e 's,@localstatedir\@,$(localstatedir),g' \ -e 's,@package_name\@,$(PACKAGE_NAME),g' \ - -e 's,@instconfigdir\@,$(instconfigdir),g' + -e 's,@instconfigdir\@,$(instconfigdir),g' \ + -e 's,@ECHO_N\@,$(ECHO_N),g' \ + -e 's,@ECHO_C\@,$(ECHO_C),g' endif %: %.in diff --git a/Makefile.in b/Makefile.in index e00a691f..dd765dca 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1859,7 +1859,9 @@ rsearch_bin_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK) $(SASL_LINK) $(LIBS @BUNDLE_FALSE@ -e 's,@sysconfdir\@,$(sysconfdir),g' \ @BUNDLE_FALSE@ -e 's,@localstatedir\@,$(localstatedir),g' \ @BUNDLE_FALSE@ -e 's,@package_name\@,$(PACKAGE_NAME),g' \ -@BUNDLE_FALSE@ -e 's,@instconfigdir\@,$(instconfigdir),g' +@BUNDLE_FALSE@ -e 's,@instconfigdir\@,$(instconfigdir),g' \ +@BUNDLE_FALSE@ -e 's,@ECHO_N\@,$(ECHO_N),g' \ +@BUNDLE_FALSE@ -e 's,@ECHO_C\@,$(ECHO_C),g' # these are for the config files and scripts that we need to generate and replace @@ -1890,7 +1892,9 @@ rsearch_bin_LDADD = $(NSPR_LINK) $(NSS_LINK) $(LDAPSDK_LINK) $(SASL_LINK) $(LIBS @BUNDLE_TRUE@ -e 's,@sysconfdir\@,$(sysconfdir),g' \ @BUNDLE_TRUE@ -e 's,@localstatedir\@,$(localstatedir),g' \ @BUNDLE_TRUE@ -e 's,@package_name\@,$(PACKAGE_NAME),g' \ -@BUNDLE_TRUE@ -e 's,@instconfigdir\@,$(instconfigdir),g' +@BUNDLE_TRUE@ -e 's,@instconfigdir\@,$(instconfigdir),g' \ +@BUNDLE_TRUE@ -e 's,@ECHO_N\@,$(ECHO_N),g' \ +@BUNDLE_TRUE@ -e 's,@ECHO_C\@,$(ECHO_C),g' all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am diff --git a/wrappers/initscript.in b/wrappers/initscript.in index 6b0cdb12..f8bef0dc 100644 --- a/wrappers/initscript.in +++ b/wrappers/initscript.in @@ -26,18 +26,24 @@ then exit 0 fi +# Solaris echo cannot use -n - linux echo by default cannot use \c +echo_n() +{ + echo @ECHO_N@ "$*@ECHO_C@" +} + # failure and success are not defined on some platforms type failure > /dev/null 2>&1 || { failure() { - echo " FAILED\c" + echo_n " FAILED" } } type success > /dev/null 2>&1 || { success() { - echo " SUCCESS\c" + echo_n " SUCCESS" } } @@ -96,7 +102,7 @@ if [ -n "$2" ]; then fi done if [ "$2" != "$INSTANCES" ]; then - echo "$2 is an invalid @package_name@ instance\c" + echo_n "$2 is an invalid @package_name@ instance" failure; echo exit 1 fi @@ -111,7 +117,7 @@ start() { errors=0 successes=0 for instance in $INSTANCES; do - echo " $instance...\c" + echo_n " $instance..." # 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 @@ -123,12 +129,12 @@ start() { if [ -f $pidfile ]; then pid=`cat $pidfile` if kill -0 $pid > /dev/null 2>&1 ; then - echo " already running\c" + echo_n " already running" success; echo successes=`expr $successes + 1` server_running=1 else - echo " not running, but pid file exists - attempt to start anyway...\c" + echo_n " not running, but pid file exists - attempt to start anyway..." rm -f $pidfile fi fi @@ -136,7 +142,7 @@ start() { if [ $server_running -eq 0 ] ; then rm -f $pidfile rm -f $startpidfile - fix_pid_dir_ownership $instbase/slapd-$instance + 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 @@ -212,7 +218,7 @@ stop() { pidfile=$piddir/slapd-$instance.pid if [ -f $pidfile ]; then pid=`cat $pidfile` - echo " $instance...\c" + echo_n " $instance..." server_stopped=0 if kill -0 $pid > /dev/null 2>&1 ; then kill $pid @@ -249,7 +255,7 @@ stop() { fi done if [ $errors -ge 1 ]; then - echo "*** Error: $errors instance(s) unsuccessfully stopped\c" + echo_n "*** Error: $errors instance(s) unsuccessfully stopped" failure; echo else rm -f $lockfile @@ -286,7 +292,7 @@ case "$1" in [ ! -f $lockfile ] || restart ;; *) - echo Unknown command $1 + echo Unknown command $1 echo "Usage: $0 {start|stop|status|restart|condrestart} [instance-name]" exit 2 esac |