/srv/irclogs.ubuntu.com/2012/01/08/#upstart.txt

venugopalI am using daemib which is launched using upstart initctl start command. From this daemon I am trying to launch firefox browser with user permission using command "sudo -u <username> xdg-open http://www.google.com"15:53
venugopalThis launching in user mode and everything is fine  on ubuntu 11.04. But on ubuntu 10.04, 10.10 version it is still launching in root mode..  15:54
venugopalCan anyone tell if there is any patch available for these two lower versions..15:55
venugopal?15:55
venugopalcan anyone help me with this issue?16:22
JanCI'm not sure why you need a system job to launch Firefox?  (you probably can't even be sure that there is an X session with that user logged in at that moment?)16:44
venugopalJanC, This how my daemon works. It is responsible of displaying the basic UI and In this case I am sure that there is an X session with that user logged in..17:15
venugopalSince this is triggered from user input..17:16
JanCand the daemon can't run as the user?17:17
JanCactually, why not let the user process that starts the daemon also start the browser?17:19
venugopalno daemon can't run as user. since it needs root permissions.17:20
venugopalbut from the daemon I want to launch the browser with user permissions as seperate process..17:21
venugopalJanC, Is there any way to get this working??17:27
venugopalBut the samething is working finr on ubuntu 11.04 version..17:27
JanCso how does the user start the daemon?17:28
venugopaldaemon is start by "initctl start" command17:29
venugopal*started17:30
venugopalfrom /etc/init/script17:30
JanCso why not make a script that runs "initctl start", waits until the daemon is started, then starts Firefox?17:30
venugopalactuall initctl start is called while installing my debian package in postinst script.17:32
venugopalfirefox is started from daemon when user selects a button in UI displayed by daemon.17:32
venugopalso I have to launch the firefox from the daemon only.. 17:33
venugopalJanC, Any way to fix this?17:55
JanCugh17:55
JanCvenugopal: not sure what you are trying to do, but to me it sounds like you try doing things the wrong way...17:57
venugopalJanC, My daemon is started from init scripst using initctl command, responsible for displaying UI and depending on UI events it wants to launch the firefox with user permission using xdg-open command.18:00
venugopalYes, wrong thing here is daemon shouldn't contain any UI.. But that's the way client has request us.. they don't want seperate app for UI.. so we don't other way. 18:01
JanCvenugopal: tell them they are nuts  :P18:02
JanCactually, why does that daemon need root?18:03
venugopalIt is an antivirus software and need root access to monitor the iptable details and monitor applications trying to access internet..  18:04
venugopalbut the same logic is working fine on ubuntu 11.04 and only problem is with 10.04, 10.10 versions..18:06
venugopalJanC, Any pointers?18:28
JanCyes: use separate programs18:31
JanCBTW: running GUI apps from postinst scripts is *not done* (because there really is no way to do it properly)18:33
JanCfor example, you don't know which user installed the package, so you can't know on who's display you have to show it18:34
JanC(if there is an X display at all)18:36
venugopalbut I am sure on whos display I have to show the UI.. 18:43

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!