On Mon, Jan 03, 2005, Doug Summers wrote:

> Doug Summers wrote:
> >Using OpenPKG 2.2.2, compiled from source...
> >Installed to /openpkg, which is symlinked to /usr/local...
> >
> >After compiling and installing Mozilla 1.7.3 (from release/2.2/SRC/PLUS) 
> >it won't run, giving me this error:

Oh, i did not see the "won't run"

> >[EMAIL PROTECTED] /usr/local/RPM/PKG # mozilla
> >couldn't set locale correctly

Just a warning, should not lead to a crash.

[...]
> After tweaking the /openpkg/bin/mozilla startup script to not try to set 
> the LANG variable the "locale" errors go away, but now Mozilla gives me 
> this (as any user including root):
> 
> mozilla -v
> mozilla: process still not running (not available remotely)
> mozilla: running new process
> mozilla: exec: /openpkg/lib/mozilla/mozilla >/dev/null 2>&1 &


Try the following script e.g. with "mozilla -l /tmp/mozilla.log" and
look in the logfile.

----8<------------------8<-----------------------8<------------------8<---
#!/bin/sh
##
##  mozilla -- Mozilla Browser Startup Control Utility
##  Copyright (c) 2000-2003 The OpenPKG Project <http://www.openpkg.org/>
##  Copyright (c) 2000-2003 Ralf S. Engelschall <[EMAIL PROTECTED]>
##  Copyright (c) 2000-2003 Cable & Wireless <http://www.cw.com/>
##
##  Permission to use, copy, modify, and distribute this software for
##  any purpose with or without fee is hereby granted, provided that
##  the above copyright notice and this permission notice appear in all
##  copies.
##
##  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
##  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
##  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
##  IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
##  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
##  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
##  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
##  USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
##  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
##  OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
##  OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
##  SUCH DAMAGE.
##

#   configuration
mozilla_dir="/opkg/lib/mozilla"
mozilla_bin="/opkg/lib/mozilla/mozilla"
xsel_bin="/opkg/bin/xsel"
wmctrl_bin="/opkg/bin/wmctrl"

#   option parsing
opt_v=no
opt_w=no
opt_t=no
opt_r=""
opt_l="/dev/null"
while [ ".$1" != . ]; do
    case $1 in
        -m|-mail|--mail ) opt_m=yes; shift ;;
        -v|--verbose    ) opt_v=yes; shift ;;
        -w|--window     ) opt_w=yes; shift ;;
        -t|--tab        ) opt_t=yes; shift ;;
        -r|-remote|--remote ) opt_r="$2"; shift; shift ;;
        -l|--log        ) opt_l="$2"; shift; shift ;;
        -* ) echo "$0:ERROR: invalid option \"$1\"" 1>&2; exit 1 ;;
        * ) break ;;
    esac
done
if [ $# -eq 0 ]; then
    set -- ""
fi

(echo "\n"; date; echo "\n") >>$opt_l

verbose () {
    if [ ".$opt_v" = .yes ]; then
        echo "mozilla: $*" 1>&2
    fi
}

#   establish Mozilla environment
MOZILLA_FIVE_HOME="$mozilla_dir"
export MOZILLA_FIVE_HOME
LANG=en_US.ISO8859-1
export LANG

#   special case of direct remote option
if [ ".$opt_r" != . ]; then
    verbose "exec: $mozilla_bin -remote \"$opt_r\""
    exec $mozilla_bin -remote "$opt_r"
fi

#   special case of direct email option
if [ ".$opt_m" != . ]; then
    $mozilla_bin -remote "ping()" >>$opt_l 2>&1
    if [ $? -eq 0 ]; then
        verbose "$mozilla_bin -remote \"xfeDoCommand(openInbox)\""
        $mozilla_bin -remote "xfeDoCommand(openInbox)"
    else
        verbose "exec: $mozilla_bin -mail"
        exec $mozilla_bin -mail
    fi
fi

#   determine Mozilla run-time status
$mozilla_bin -remote "ping()" >>$opt_l 2>&1
if [ $? -eq 0 ]; then
    verbose "process already running (available remotely)"
    restart=no
else
    verbose "process still not running (not available remotely)"
    restart=yes
fi

#   open one or more URLs
first=yes
for url in "$@"; do
    #   determine URL to open
    if [ ".`echo .$url | grep '@'`" != . ]; then
        #   expand at-sign into X11 selection buffer
        xsel=`($xsel_bin --paste) 2>>$opt_l`
        url=`echo "$url" | sed -e "s;@;$xsel;"`
    fi
    if [ ".$url" = . ]; then
        #   expand an empty URL into the internal blank page
        url="about:blank"
    else
        #   expand special URL constructs
        case "$url" in
            auto:* )
                url=`echo "$url" | sed -e 's;^auto:;;'`
                case "$url" in
                    http://* | https://* | ftp://* | file://* ) ;;
                    www.* ) url="http://$url"; ;;
                    ftp.* ) url="ftp://$url"; ;;
                    *.tar.gz | *.tgz ) url="ftpsearch:$url" ;;
                    *" "* ) url="google:$url" ;;
                    [0-9]* ) url="rfc:$url" ;;
                    * ) url="leo:$url" ;;
                esac
                ;;
        esac
        case "$url" in
            http://* | https://* | ftp://* | file://* )
                : # URL is already fully qualified
                ;;
            google:* ) 
                #   expand Google query
                url=`echo "$url" | sed -e 's;^google:;;' | tr ' ' '+'`
                url="http://www.google.com/search?q=$url";
                ;;
            leo:* ) 
                #   expand Leo Dictionary query
                url=`echo "$url" | sed -e 's;^leo:;;' | tr ' ' '+'`
                url="http://dict.leo.org/?search=$url";
                ;;
            ftpsearch:* ) 
                #   expand FTPSearch query
                url=`echo "$url" | sed -e 's;^ftpsearch:;;' | sed -e 's; 
;%20;g'`
                url="http://www.alltheweb.com/search?advanced=1&cat=ftp&q=$url";
                ;;
            rfc:* )
                #   expand Zvon.org RFC query
                url=`echo "$url" | sed -e 's;^rfc:;;'`
                url="http://zvon.org/tmRFC/RFC$url/Output/index.html";
                ;;
            whois:* )
                #   expand Geektools.com WHOIS query
                url=`echo "$url" | sed -e 's;^whois:;;'`
                url="http://www.geektools.com/cgi-bin/proxy.cgi?query=$url";
                ;;
            jargon:* )
                #   expand UMEC Jargon File query
                url=`echo "$url" | sed -e 's;^jargon:;;' | tr ' ' '+'`
                url="http://www.tf.hut.fi/cgi-bin/jargon?search=$url";
                ;;
            /* ) 
                #   expand absolute filename into file URL
                url="file://$url"
                ;;
            * ) 
                #   expand relative filename into file URL
                url="file://`pwd`/$url"
                ;;
        esac
    fi

    if [ ".$first" = .yes -a ".$restart" = .yes ]; then
        #   handling of first URL if restarting is necessary
        verbose "running new process"
        if [ ".$url" = ".about:blank" ]; then
            verbose "exec: $mozilla_bin >>$opt_l 2>&1 &"
            $mozilla_bin >>$opt_l 2>&1 &
        else
            verbose "exec: $mozilla_bin \"$url\" >>$opt_l 2>&1 &"
            $mozilla_bin "$url" >>$opt_l 2>&1 &
        fi
    else
        #   delayed waiting for process to be finally remotely available
        #   if it was started from scratch for the handling of the first
        #   URL. This way we wait only if necessary, i.e., if more than
        #   one URL was given.
        if [ ".$first" = .no -a ".$restart" = .yes ]; then
            verbose "waiting for new process to be available remotely"
            sleep 4 # give it a little bit of time to fully startup
            i=0
            while [ $i -lt 10 ]; do
                $mozilla_bin -remote "ping()" >>$opt_l 2>&1
                if [ $? -eq 0 ]; then
                    break
                fi
                sleep 1 # give it a little bit more time to startup
                i=`expr $i + 1`
            done
        fi

        #   try to activate (and bring to foreground) the Mozilla window
        $wmctrl_bin -a "Mozilla" >$opt_l 2>&1 || true

        #   determine remote command
        if [ ".$opt_w" = .yes ]; then
            if [ ".$url" = ".about:blank" ]; then
                cmd="xfeDoCommand(openBrowser)"
            else
                cmd="openURL($url, new-window)"
            fi
        elif [ ".$opt_t" = .yes ]; then
            cmd="openURL($url, new-tab)"
        else
            cmd="openURL($url)"
        fi

        #   perform remote command
        verbose "sending remote command to running process"
        verbose "exec: $mozilla_bin -remote \"$cmd\" >>$opt_l 2>&1"
        $mozilla_bin -remote "$cmd" >>$opt_l 2>&1
    fi
    first=no
done
----8<------------------8<-----------------------8<------------------8<---

-- 
Matthias Kurz; Fuldastr. 3; D-28199 Bremen; VOICE +49 421 53 600 47
  >> Im prämotorischen Cortex kann jeder ein Held sein. (bdw) <<
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
User Communication List                      openpkg-users@openpkg.org

Reply via email to