Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 15611 - The Phoenix startup script (net-www/phoenix-bin/files/phoenix) does not take into account multiple users
Summary: The Phoenix startup script (net-www/phoenix-bin/files/phoenix) does not take ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: phoen][x
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-02-13 01:31 UTC by Cameron Lerch
Modified: 2003-03-05 08:13 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cameron Lerch 2003-02-13 01:31:21 UTC
The Phoenix startup script (net-www/phoenix-bin/files/phoenix) does not consider
the situation where multiple users are running Phoenix. This is an obvious bug
as the script simply looks for a pid. If a pid is found, it assumes that Phoenix
is already running (without considering which user it is running under). Here is
the proper way to do this (as per mozilla startup script):

#!/bin/sh

export MOZILLA_FIVE_HOME="/usr/lib/phoenix"
PHOENIX_PATH="/usr/lib/phoenix"
PHOENIX_CLIENT_PROGRAM="/usr/lib/phoenix/mozilla-xremote-client"

$PHOENIX_CLIENT_PROGRAM "ping()"

if [ "$?" -eq "2" ]; then
        # No phoenix running
        ${PHOENIX_PATH}/phoenix $@
else
        # phoenix running - open a new window
        ${PHOENIX_PATH}/phoenix -remote "openURL($@ ,new-window)"
fi

Reproducible: Always
Steps to Reproduce:
1. User A starts Phoenix
2. User B attempts to start Phoenix and uh oh.
3.
Actual Results:  
Phoenix failed to start

Expected Results:  
Phoenix starts

I've created the fix and posted it in the "details" section. Please submit.
Comment 1 Seth Chandler 2003-02-13 02:42:33 UTC
alright, so heres the problem with THAT...you run mozilla and phoenix at the same time....

not with this script....

Comment 2 Seth Chandler 2003-02-13 02:43:03 UTC
also...phoenix is alive again, or so i thought from seeing him talk online last night...
Comment 3 phoen][x 2003-02-18 11:26:29 UTC
Exactly my thought, sethbc. What happens if you run mozilla and launch phoenix with that script? It'll spawn a new mozilla window. :/

Thats why i used the hackish pid-magic in my version.

Both versions have a flaw, so lets think of a better one.

-phoen][x-
Comment 4 Wayne Davison 2003-03-02 11:00:17 UTC
Switching from pidof to a user-specific ps combined with grep should be an
improvement from the current script:

#!/bin/sh

export MOZILLA_FIVE_HOME="/usr/lib/phoenix"
PHOENIX_PATH="/usr/lib/phoenix"

if [ -z "`/bin/ps x | /bin/grep \"[0-9] ${PHOENIX_PATH}/phoenix-bin\"`" ]; then
    # No phoenix running
    ${PHOENIX_PATH}/phoenix $@
else
    # phoenix running - open a new window
    ${PHOENIX_PATH}/phoenix -remote "openURL($@ ,new-window)"
fi
Comment 5 phoen][x 2003-03-05 08:13:14 UTC
Nifty one, Waine.

I have added it a minute ago.

Thanks for the contributions, guys.

-phoen][x-