• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Deployment rather than development mode --> StartupItems fix
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deployment rather than development mode --> StartupItems fix


  • Subject: Re: Deployment rather than development mode --> StartupItems fix
  • From: LD <email@hidden>
  • Date: Fri, 30 Sep 2005 12:08:34 +1000

Hi there,

also note that the StopService syntax for the WebObjects startup item (/System/Library/StartupItems/WebObjects/WebObjects) is wrong on two counts. The Zsh shell doesn't interpret whitespace separated strings as arrays by default.

-- PROBLEM #1 --
BASH_ARRAY="one two three" # is simply a zsh string
ZSH_NATIVE_ARRAY=(one two three)

in zsh, however, you can use the BASH_ARRAY as an array by doing $ {=BASHARRAY}

-- PROBLEM #2 --
In bash you can create a variable such as:
CMD="/bin/ls -la ~/Desktop"
STR=`$CMD`

In zsh this will cause an error. The fix in zsh:
STR=`eval $CMD`

## THE FIXED VERSION
StopService ()
{
        if [ "$PRINTSTARTSTOPMESSAGES" = "YES" ]; then
                ConsoleMessage "Stopping WebObjects services"
        fi

local PSCOMMAND="$PS -jaxwwwww"
WOSERVICEPIDS=`eval $PSCOMMAND | $GREP "$WOSERVICE" | $GREP - v grep | $AWK '{print $2}'`


for parent in ${=WOSERVICEPIDS}
{
WOSERVICECHILDPIDS=`eval $PSCOMMAND | $AWK 'NF>3 {if ( $3 =='"$parent"' ) print $2}'`


                StopPID $parent

                for child in ${=WOSERVICECHILDPIDS}
                {
                        StopPID $child
                }

        }

}

with regards,
--

LD


_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Deployment rather than development mode (From: Mark Wardle <email@hidden>)
 >Re: Deployment rather than development mode (From: Ken Anderson <email@hidden>)

  • Prev by Date: Re: Learning Web Objects with Wiki
  • Next by Date: Re: FW: WebService Tutorial
  • Previous by thread: Re: Deployment rather than development mode
  • Next by thread: Re: Deployment rather than development mode
  • Index(es):
    • Date
    • Thread