Opened 14 years ago

Closed 14 years ago

#478 closed defect (fixed)

deegree start user confusion

Reported by: wildintellect Owned by: jmays
Priority: minor Milestone:
Component: OSGeoLive Keywords: deegree, 3.0
Cc: live-demo@…

Description

deegree for some reason didn't like launching without sudo privaleges. However when run this way firefox is launched as a different user than the regular user and will fail if already open.

Quick hack last line of deegree_start.sh was to add

sudo -u user firefox ...

This is not a permanent solution as that script appears to come from deegree packages.

Change history (12)

comment:1 by jmays, 14 years ago

thanks for this.

I have just added this "sudo -u user" to the script and uploaded it to the deegree download server. This way the quick hack will not be lost.

For a next Version of the LiveDVD (2.x): As this script is only used for the LiveDVD I could upload it to OSGeo SVN. I didn't do it so far, because I wasn't sure of where to ut it. Same holds for deegree_stop.sh

Could someone point me to a suited location?

comment:2 by hamish, 14 years ago

'sudo -u user' as user seems a bit redundant to me. How does that work?

Jody wrote:

For deegree startup and geosever startup firefox often opens before the server is ready to take on requests? At the very least I need to hit refresh once in order to show the initial page...

we should put deegree_start.sh and stop.sh in local svn and perhaps stick a "sleep 5" in there after starting the service but before launching firefox to provide the necessary launch time.

Hamish

comment:3 by jmays, 14 years ago

sudo -u user is necessary here, because as wildintelect has correctly stated: deegree and all its scripts are started as root. therefore firefox will also to be started as root. But this will conflict if "user" has started firefox already.

comment:4 by jmays, 14 years ago

I happily agree to adding the start/stop deegree scripts to osgeo svn. I simply didnt know where exactlsy to put the scripts.

sleepy seconds before firefox gets started is also a nice idea.

in reply to:  4 comment:5 by hamish, 14 years ago

Replying to jmays:

I happily agree to adding the start/stop deegree scripts to osgeo svn. I simply didnt know where exactlsy to put the scripts.

others have used <project>-conf in the main dir, I think we should clean things up by moving those to a new app-conf/ dir in future (ie after the current release deep-freeze thaws).

Hamish

in reply to:  3 comment:6 by hamish, 14 years ago

Replying to jmays:

sudo -u user is necessary here, because as wildintelect has correctly stated: deegree and all its scripts are started as root. therefore firefox will also to be started as root. But this will conflict if "user" has started firefox already.

ah, ok.

as a general rule starting as root is not a good thing to do if you can help it, and for a web-app is a very big no-no. For the live-dvd I guess it doesn't matter much, but for a persistent VM or installed-from-dvd it might. Without knowing anything about it, may I ask why it needs to be run as root? (appolgies if it's a stupid question)

fyi,

export JAVA_OPTS='...'

is a bashism and will fail on Ubuntu where /bin/sh is symlinked to the faster dash.

rather do:

JAVA_OPTS='...'
export JAVA_OPTS

or

JAVA_OPTS='...' ; export JAVA_OPTS

or in can't-fix cases change the shebang to #!/bin/bash

thanks, Hamish

comment:7 by wildintellect, 14 years ago

Well I didn't actually mean the root account (as there isn't one) but by sudo, much in the same way that apache, postgres and any other service has to be started by sudo.

The whole point it that application launched using sudo are of a different user than USER.

We could also try to figure out why the app seems to require sudo to launch properly, but all the Java server stuff so far seems to need it.

comment:8 by hamish, 14 years ago

Type: taskdefect

Hi,

just some notes on how to throw up a custom "please wait" message as part of the script while sleep runs. (Zero feedback leads to the user double clicking the icon again and again, then after the disc finally spins up 4 browsers open at once)

Currently xmessage is the only one of these programs already installed on the live-image.

MSG="Waiting 10 seconds for service to start before launching web browser ..."

# xmessage (x11-utils pkg)
echo "$MSG" | xmessage -timeout 10 -file - &

# kdialog (kdebase-bin package)
kdialog --msgbox "$MSG" &

# gtkdialog (gtkdialog pkg)
...

# gmessage (gmessage pkg)
...

Hamish

comment:9 by camerons, 14 years ago

Keywords: 3.0 added; launcher removed
Owner: changed from live-demo@… to jmays
Priority: majorminor

comment:10 by hamish, 14 years ago

Cc: live-demo@… added

Hi,

when changing a ticket's owner away from the mailing list, please add it back as a CC: so the change history is still copied to the mail list with its many eyeballs. (trac software deficiency..)

thanks, Hamish

comment:11 by jmays, 14 years ago

Keywords: deegree 3.0 → deegree, 3.0

Since the dicussion regarding the user under which the script is run (sudo vs user) did not lead to a change request, I think the only open point in this issue was to move the deegree start script to OSGeo SVN. This has been done now (revision 2959).

This issue may now be closed, right?

comment:12 by camerons, 14 years ago

Resolution: fixed
Status: newclosed

Close this issue, based on recommendation by jmays

Note: See TracTickets for help on using tickets.