Re: $BROWSER

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2007-06-17 at 19:43 -0400, Michael Klinosky wrote:
> Todd:
> > Out of curiosity, what app is it?
> 
> BOINC  (a distributed processing system).
> 
> I crunch on SETI, mostly - I love space stuff!
> 
> >> I tried
> >> export BROWSER=Firefox
> >> and
> >> export BROWSER="Firefox %u"
> >> Neither work.
> > 
> > Case-sensitivity may be the problem.  Firefox is not the same as
> > firefox.  You may also need to provide a full path, depending on what
> > the app that's using $BROWSER has set its PATH to.
> 
> OK. Well, I changed it - still not working. Perhaps an error message 
> will help determine the problem:
> 
> [mpk@d500 .BOINC]$ which firefox
> /usr/local/bin/firefox
> [mpk@d500 .BOINC]$ export BROWSER="/usr/local/bin/firefox %u"
> (test function in app)
> [mpk@d500 .BOINC]$ execvp(Firefox, http://setiathome.berkeley.edu/) 
> failed with error 2!
> 
> [mpk@d500 .BOINC]$ export BROWSER=/usr/local/bin/firefox
> (test function in app)
> [mpk@d500 .BOINC]$ execvp(Firefox, http://setiathome.berkeley.edu/) 
> failed with error 2!
> 
> Nothing happens in the browser.
> 
> >> Furthermore, into what file do I put it? (.bash_profile?)
> > 
> > That should work.
> 
> I asked because of another issue I'm working on - where to put a command 
> to run an app only once per session. I put that command into 
> .bash_profile, and then I tried .bashrc. Both times, it would try to run 
> it each time I opened a terminal or switched to the VT.
> 
> Someone suggested .xsession.
> 
> Granted, re-running this isn't a problem - but it just isn't sleek. Or, 
> it's non-geeky.  :)
> 

If you want a command to only run once, I suggest creating a lockfile
and test of the existence of that file.  If you do that, no matter what
mechanism you use to start it (cron, .bash*, .xsession, etc.), it will
always run only once.  Depending on where you start it from, cleaning up
the lockfile will be the tricky part.

If this is for running BOINC, I modified an init script and created a
boincd essentially.  That way BOINC will run when the computer comes up.
I created a user that it runs as, and relocated all of the files
someplace else.


--
Timothy Selivanow



Here's the init script I made:



###SCRIPT###

#!/bin/bash
#
#       /etc/rc.d/init.d/boinc
#
# Starts boinc as a daemon
#
# chkconfig: 345 99 01
# description: BOINC client
# processname: boinc

# Source function library.
. /etc/rc.d/init.d/functions

[ -x /usr/local/bin/boinc ] || exit 0

RETVAL=0
BOINCHOME=/var/lib/boinc

#
# See how we were called.
#

start() {
        # Check if it is already running
        if [ ! -f /var/lock/subsys/boincd ]; then
            echo -n $"Starting BOINC daemon: "
            daemon --user boinc /usr/local/bin/boinc -daemon -redirectio
-dir $BOINCHOME
            RETVAL=$?
            [ $RETVAL -eq 0 ] && touch /var/lock/subsys/boincd
            echo
        fi
        return $RETVAL
}

stop() {
        echo -n $"Stopping BOINC daemon: "
        killproc /usr/local/bin/boinc
        RETVAL=$?
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/boincd
        echo
        return $RETVAL
}


restart() {
        stop
        start
}       

reload() {
        trap "" SIGHUP
        killall -HUP boinc
}       

case "$1" in
start)
        start
        ;;
stop)
        stop
        ;;
reload)
        reload
        ;;
restart)
        restart
        ;;
condrestart)
        if [ -f /var/lock/subsys/boincd ]; then
            restart
        fi
        ;;
status)
        status boinc
        ;;
*)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
        exit 1
esac

exit $RETVAL



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux