Please help with startup script

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Craig White
Date:  
Subject: Please help with startup script
On Wed, 2003-11-05 at 11:33, Chris Gehlker wrote:
> I have a simple script that supposed to start the samba daemons on an
> old HR 7.0 system. It is pretty much copied right out of the "Using
> Samba" book except that paths were adjusted to fit the system. It was
> stuck on the end of /etc/rc.d/rc.local as follows:
>
> #!/bin/sh
> #
> # This script will be executed *after* all the other init scripts.
> # You can put your own initialization stuff in here if you don't
> # want to do the full Sys V style init stuff.
>
> if [ -f /etc/redhat-release ]; then
>      R=$(cat /etc/redhat-release)

>
>      arch=$(uname -m)
>      a="a"
>      case "_$arch" in
>         _a*) a="an";;
>         _i*) a="an";;
>      esac

>
>      NUMPROC=`egrep -c "^cpu[0-9]+" /proc/stat`
>      if [ "$NUMPROC" -gt "1" ]; then
>          SMP="$NUMPROC-processor "
>          if [ "$NUMPROC" = "8" -o "$NUMPROC" = "11" ]; then
>              a="an"
>     else
>         a="a"
>          fi
>      fi

>
>      # This will overwrite /etc/issue at every boot.  So, make any 
> changes you
>      # want to make to /etc/issue here or you will lose them when you 
> reboot.
>      echo "" > /etc/issue
>      echo "$R" >> /etc/issue
>      echo "Kernel $(uname -r) on $a $SMP$(uname -m)" >> /etc/issue

>
>      cp -f /etc/issue /etc/issue.net
>      echo >> /etc/issue
> fi

>
> if [ -x /usr/sbin/smbd]; then
>      touch /home/chrisg/test1
>      echo "Starting smbd..."
>      /usr/sbin/smbd -D
>      echo "Starting nmbd..."
>      /usr/sbin/nmbd -D
> fi

>
> touch /home/chrisg/test2
>
> I added the part after the first if. I'm no great scriptor but I think
> the if is just testing for
> the existence or the executability of /usr/sbin/smbd. In either case,
> the test should pass but it fails. After restarting I have test2 but
> not test1 in my home directory.
>
> I would really appreciate any help.
>

----
try putting a space after /usr/sbin/smbd and before the closing brace -
very literal these things

Craig