[SOLVED] Automatically run a browser when network is up

Hi,
I have been trying to use netcfg's POST_UP variable to run a graphical browser (midori) automatically once the network is up and running using this script (called thanks to the POST_UP variable in my network's configuration)
#!/bin/sh
if [ "$(ps aux | grep "$USER" | grep midori | grep -v grep | grep -v defunct)" = "" ]
then
midori > /dev/null 2>&1 &
fi
Yes, the condition in the if statement is very hackish (can not currently think of a better way to do this) but it works when I am logged in (graphically) and run netcfg manually.
The only problem is that I have configured my rc.conf to automatically connect to my network at start-up.
NETWORKS=(home)
DAEMONS=(... @net-profiles ...)
As the daemon is backgrounded, the boot process carries on and I am logged in X long before the POST_UP operation is done. Still, when running netcfg like that, midori does not start and I get the following error:
Midori - Cannot open display:
Although I can think of ideas why it is so, I have no idea how to make this work. Any insights ?
Thank you in advance,
yms
Last edited by yms (2011-02-10 22:06:08)

yms wrote:
jOaNbE wrote:The error you are getting is in contradiction to your statement.
Indeed. This is why I am posting. The thing is netcfg is executed and backgrounded and while I am getting a connection, I am logged in and X starts. A few seconds later, the connection is established and when the POST_UP operation is done, there should be no problem with the display ... except there is.
Actually I'm wrong: My statement "The error you are getting is in contradiction to your statement." was intendend as "No, midori is called before an xserver instance started by $USER" which is false. The error is caused by the fact that midori is started by root, who doesn't have a running xserver instance.
I'm also curious as to why UID matters to you (besides avoiding running web browsers as root).
yms wrote:... I have just been asked to automate redundant operations as much as possible including autorunning programs. And the reason I can't run the browser anyways is that it won't load the default tabs properly (as the connection is down).
Are you doing this in a multi user environment or your personal single user laptop? Who asked you to do this? What do you mean by the last sentence in the quote above?

Similar Messages

  • Automatically run an action when a file opens

    select all
    pathfinder | trim
    save
    I created an action and assigned it to F2.
    Will someone share how I can have that action run whenever a files opens, or write a javascript for me.
    This is for Illustrator CS4
    Thanks
    Cedric

    Sorry about that, here is the current code:
    //WHEN SAVING JPG
    var jpgopts = new JPEGSaveOptions();
    jpgopts.embedProfile = true;
    jpgopts.formatOptions = FormatOptions.STANDARDBASELINE;
    jpgopts.matte = MatteType.NONE;
    jpgopts.quality = 10;
    //WHEN SAVING PSD
    psdOpts = new PhotoshopSaveOptions();
    psdOpts.embedColorProfile = true;
    psdOpts.alphaChannels = true;
    psdOpts.layers = true;
    if (app.documents.length > 0) {
    var myDocument = app.activeDocument;
    var theName= myDocument.name.match(/(.*)\.[^\.]+$/)[1];
    var thePath = myDocument.path;
    var theLayer = myDocument.layerSets["Sizes"].artLayers.getByName ("11x11");
    // check if layer is smart object;
    if (theLayer.kind != "LayerKind.SMARTOBJECT") {alert ("selected layer is not a smart object")}
    else {
    // select files;
    if ($.os.search(/windows/i) != -1)
        //var theFiles = File.openDialog ("please select files", "*.png;*.jpg;*.psd;*.tif", true)   
        var folder = new Folder("F:/Input");
        var theFiles = folder.getFiles(/\.(png|jpg|tif|eps|psd)$/i)
    else {var theFiles = File.openDialog ("please select files", getFiles, true)};
    if (theFiles) {
    // work through the array;
      for (var m = 0; m < theFiles.length; m++) {
    // replace smart object;
    theLayer = replaceContents (theFiles[m], theLayer);
    var theNewName = theFiles[m].name.match(/(.*)\.[^\.]+$/)[1];
    myDocument.saveAs((new File("F:/Output/" + theNewName + ".jpg")),jpgopts,true);

  • Automatically run integration procedure when new csv source file arrives

    Hello,
    I have some steps to integrate my data defined as steps in odi package. All data will be loaded from csv file, located in source directory. End users will have smb acces to this folder end they will able to place new csv (with valid, defined name) to this folder. So, odi should check periodically if new file arrived and if new file found - my packege should be executed. Or alternatively - package can run periodically and perform check if source file exists if so, data from it should be integrated.
    What is the best way to do this?

    I would do a package starting with an ODIWaitForFile step ;).
    You can find this tool in the toolbox on the left.

  • Automatic refresh of browser when an incoming call comes in

    If you have to take a phone call and you're in the midst of typing information into a web page you lose all of it because when you hang up the call, it goes back to Safari and refreshes the page.
    Is there anyway to stop this from happening? I just lost a super long comment I was typing on a blog.
    Thanks in advance!

    It does this because it needs sufficient memory for everything else. It clears the cache of that site which then makes it need to refresh. No way to disable this.

  • How can I automatically run animations when the slide is invoked?

    Hi All
    My question is (hopefully) simple,  I have a number of Microsoft Powerpoint presentations that I want to import into Adobe Captivate 6. I want the  slides to automatically run their animations when the slide is invoked either by clicking on the Table of Contents  or by clicking on the Playback Control Panel. In other words, I want the slides to play their animations as soon as they are opened up rather than the viewer having to click on each side to make the animation work. Many thanks in advance for your time and efforts.
    Moon_dogworth

    Hi there,
    Welcome to Adobe Forums
    I apologize but I did not quite understand what exactly you are trying to achieve. If you want certain transition on the slide when the TOC is clicked or the slide is entered then you can choose the transition under the Properties panel on the right side.
    See picture:
    Hope this helps!
    Thanks!

  • Run applet in browser when html file is stored in different dir.

    I have a SiteSelector.class stored in: "D:\DATA\Java Programmes\Networking\"
    and a SiteSelector.html stored in :"D:\DATA\Java Programmes\Networking\HTML files\"
    Here is a part of the code of SiteSelector.html:
    <applet code= "SiteSelector.class"
    width=500
    height=500
    codebase="D:\\DATA\\Java Programmes\\Networking\\"
    archive=""
    alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason."
    >
    <param name = "title0" value = "Java Home Page">
              <param name = "location0" value = "http://java.sun.com/">
    <param name = "title1" value = "Deitel">
              <param name = "location1" value = "http://www.deitel.com/">
              <param name = "title2" value = "JGuru">
    <param name = "location2" value = "http://www.jGuru.com/">
    <param name = "title3" value = "JavaWorld">
    <param name = "location3" value = "http://www.javaworld.com/">
    Your browser is ignoring the <APPLET> tag!
    </applet>
    Since html file and .class file are stored in different directories so in applet tag I specify absolute url in "codebase = ......" to indicate that the browser should look for .class file in "D:\DATA\Java Programmes\Networking\".
    But when I run the Applet in the browser, nothing happens. But when I copy the html file back to "D:\DATA\Java Programmes\Networking\" and change the codebase = "D:\\...." to codebase = "." It works well. Any one can help me to hanld this problem. I want to run the applet in the browser when the html file is stored in different directory. Thank you.
    Message was edited by:
    beckham12a18
    Message was edited by:
    beckham12a18
    Message was edited by:
    beckham12a18
    Message was edited by:
    beckham12a18

    anyone please help me!!!!

  • Blackberry Z10 not sending/receiving emails or able to browse when connected to WiFi only via mobile network?

    I have today moved from Windows Mobile device to BB Z10 and am hvaing difficutlies as cannot send/receive emails or browse when connected to work WiFi and only works via mobile network. WiFi works absolutely fine with all other devices including my previous Windows mobile but am concerned that nothing works when I connect to work WiFi as trying to keep data usage to a minimum.
    Emails are coming in via Exchange Activesync in case that makes a difference and was only able to get that working when turned WiFi off when setting up as well.
    Please help as mobile signal poor at home and have to rely on WiFi connections to get emails and essential i get them as cover a security support queue.........

    Hello michellef,
    Thank you for your question.
    Have you attempted connecting to a different Wi-Fi network as a test? 
    The following post from our Inside BlackBerry Help Blog may assist you with troubleshooting the issue:
    http://helpblog.blackberry.com/2013/02/wi-fi-connectivity-issues/
    Let us know if this helps!
    -FB
    Come follow your BlackBerry Technical Team on Twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.
    Click "Accept as a Solution" for posts that have solved your issue(s)!

  • At times I will close my firefox browser When I go back to open my browser I get a message stating that firefox is running The only way I can get my browser open is to restart my computer Why

    At times I will close my firefox browser When I go back to open my browser I get a message stating that firefox is running The only way I can get my browser open is to restart my computer Why

    Sounds like Firefox is "hanging at exit". That problem is frequently caused by an Extension or a Plugin. Read all of the following articles.<br /><br />
    NOTE: Establish a habit of exiting/closing Firefox with Firefox button > Exit or File > Exit to allow an orderly shutdown of Firefox and closing of all of the files that Firefox has open.
    #Stop the Firefox process:
    #*[http://kb.mozillazine.org/Kill_application Mozillazine - Kill application]
    #*Windows 7 users click [http://www.techrepublic.com/blog/window-on-windows/reap-the-benefits-of-windows-7s-task-manager/2576 here]
    #*Mac users: http://techheavy.com/2011/02/the-mac-task-manager/
    #Why Firefox may hang:
    #*[http://support.mozilla.org/en-US/kb/Firefox+hangs Firefox hangs] (see Hang at exit)
    #*[http://kb.mozillazine.org/Firefox_hangs Firefox hangs (Mozillazine)] (see Hang at exit and Closing Firefox properly)
    #*[https://support.mozilla.org/en-US/kb/Firefox+is+already+running+but+is+not+responding Firefox is already running but is not responding]
    #Use Firefox Safe Mode to find a problem with an Extension or Plugin:
    #*Don't check anything when entering Safe Mode, just continue
    #*If the problem does not occur in Safe Mode it is probably an Extension or Plugin causing the problem
    #*See:
    #**[[Safe Mode]] and [http://kb.mozillazine.org/Safe_Mode Safe Mode (Mozillazine)]
    #**[http://support.mozilla.org/en-US/kb/Troubleshooting+extensions+and+themes Troubleshooting extensions and themes]
    #**[http://support.mozilla.org/en-US/kb/Troubleshooting+plugins Troubleshooting plugins]
    #**[http://support.mozilla.org/en-US/kb/Basic+Troubleshooting Basic Troubleshooting]
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You may need to update some plug-ins. Check your plug-ins and update as necessary:
    *Plug-in check --> http://www.mozilla.org/en-US/plugincheck/
    *'''''Adobe Shockwave for Director Netscape plug-in''''': [https://support.mozilla.org/en-US/kb/Using%20the%20Shockwave%20plugin%20with%20Firefox#w_installing-shockwave Installing ('''''or Updating''''') the Shockwave plugin with Firefox]
    *Adobe PDF Plug-In For Firefox and Netscape: [https://support.mozilla.org/en-US/kb/Using%20the%20Adobe%20Reader%20plugin%20with%20Firefox#w_installing-and-updating-adobe-reader Installing/Updating Adobe Reader in Firefox]
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.org/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]
    *'''''Next Generation Java Plug-in for Mozilla browsers''''': [https://support.mozilla.org/en-US/kb/Using%20the%20Java%20plugin%20with%20Firefox#w_installing-or-updating-java Installing or Updating Java in Firefox]

  • How can I disable the Photos app from automatically running when I plug in my iPhone?

    How can I disable the Photos app from automatically running when I plug in my iPhone?
    I have no intention of ever using Photos, in fact, having to abandon Aperture takes me one step close to moving back to Windows, but I digress.
    I just want to NOT have to kill the Photos app every time I plug in my phone.
    Thanks.

    I am still seeing the option Image Capture, like shown in the screenshot that Rysz posted.   But it is another example of the hide-and-seek Apple likes to play with us.
    The option has to be set for each device individually. With the device connected to USB, you have to click the tiny disclosure triangle in the lower left corner of the sidebar to reveal the option.
    I was perfectly happy with the program I paid for (Aperture), and now to maintain the functionality I have to pay for another application (LightRoom) to get the functionality that I paid for in Aperture.
    Aperture 3.6 is working well with Yosemite. I will use it, as long as I have a Mac, that will run Yosemite or a compatible system.
    Have you looked at Capture One?  It looks much more similar to Aperture than Lightroom.

  • My macbook pro 15inch running on maverick when i try to click on wi-fi says no hardware installed please help i need wifi and and under network staus wi-fi is fail and under network airport is not connected can anybody help the wifi icon has a x and does

    my macbook pro 15inch running on maverick when i try to click on wi-fi says no hardware installed please help i need wifi and and under network staus wi-fi is fail and under network airport is not connected can anybody help the wifi icon has a x and does not even let me turn it on

    Have you attempted to reset the SMC? That would be the first step. Hold the left control, option, shift key and the power button for about 5 seconds and release. Then try to reboot. Might as well reset the PRAM as well. Hold command, option, P, R on start up until the machine restarts. If that doesnt' have any affect we'll have to dig deeper into a potential hardware failure.
    If this method doesn't work, check the webcam that will tell the problem is on the iSight & WiFi cable. If your webcam is ok, then it'll be the WiFi card problem. Hope it can help ;-)
    - xia_us9

  • OS X automatically relaunches the Finder when it is quit and the finder is unresponsive--how to solve this?

    OS X automatically relaunches the Finder when it is quit and the finder is unresponsive--how to solve this?

    Double tap Home button, delete Mail from multitask-bar.
    Do a reset (Hold Sleep/Wake and Home buttons about 10 secs or more till Apple logo appears, ignore the Slide to Power Off that appears)
    Note: You will not lose any data.

  • How do i stop programs from automatically running when i start up my macbook?

    how do i stop programs from automatically running when i start up my macbook?
    programs such as.. email and Skype.
    When i go to system preferences, then users & groups, then to my name, log in items ....this box is clear, i have unchecked everything, yet things still start up......

    sometimes these applications will have a setting in the preferences to not open on login of computer. If you see none of that, you can go into:
    system preferences> Users & Groups > Select your user>Login Items.
    unlock the settings by hitting the lock icon on the bottom left of the window then youll be able to uncheck these things from opening when you log in.
    Hope this is helpful or answers the question.

  • Flex 2 SWF not loading on the web browser when Flash Player 8 is running

    I got a Flex 2 application that is not loading on the web
    browser when the users workstations got Macromedia Flash Player 8
    installed. Please advice on what could be the issue, i got security
    calls included i.e. securty.allowInsucureDomain, crossdomain.xml,
    etc.
    The application shows no issues on web browsers with Flash
    Player 9 installed.

    if you have read developersGuide it says that there somewhere
    http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/js/html/wwhelp.htm?href=Part2_DevAp ps_048_1.html
    here is workaround
    http://kb.adobe.com/selfservice/viewContent.do?externalId=749eaa47&sliceId=1
    flex 9 is complete rewrite (almost) and its lot mor fast and
    effecient) you should't want to use flash 8 if you can anyways, but
    somethimes I guess there is not other way out..

  • [SOLVED] How to automatically run modprobe vboxdrv?

    Hi,
    I wonder how to automatically run at startup module vboxdrv such as for example always before running VirtualBox I have to type sudo modprobe vboxdrv and would like to improve this was done automatically. Please help and thank you
    Last edited by formoza (2014-07-28 18:22:46)

    see the wiki for kernel modules

  • Automatically run query when open webpage

    Hi experts,
    I am newbie in Jdeveloper. I created the webpage following the "Search" tutorial. But now I need to run the query when I open the page, no need to input parameter and click on "Go" button.
    Thanks in advance
    Best Regards
    Hieu

    Hi,
    In controller write the code
    import oracle.apps.fnd.framework.OAApplicationModule;
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processRequest(pageContext, webBean);
    OAApplicationModule am = pageContext.getApplicationModule(webBean);
    am.invokeMethod("callAM");
    In AM create new method
    public void callAM() {
    NewVOImpl vo = getNewVO1();
    vo.executeQuery();
    Thanks
    Jegan

Maybe you are looking for

  • Mid 2009 13" Macbook Pro Battery died

    Hello, I was ready to have my MacBook Pro formatted when I realized that it would not change and it now works with the power cord when connected. How do I know which model/Part number it is? or the information that I need to purchase the battery. I a

  • How do is get back to Read & Write permissions on HDs ?

    Hi gang, I was trying to set up one central folder for 4 iTune users (accounts) in our household. One of the blogs said put in "Shared" folder and set permissions to "Read & Write".  I tried but on "Everybody" is does not offer the "R&W" option, just

  • Airplay both audio and video through different devices

    When is it gonna be possible to airplay audio on my Bose Airplay Speaker and the video on my TV?  Is it about the update of the iOS?

  • JApplet is not working in tomcat server

    Hi All, I am having problem running applet in my tomcat server. When i ran applet using appletviewer, it is working fine. Due to applet restrictions, i signed oracle drivers jar file too. It is still saying oracle drivers not found. Could you please

  • Add numberconverter to inputtext by java code

    my page is dynamically created by java code. how can i add a numberconverter to an inputtext by code? HtmlInputText intext = new HtmlInputText();      NumberConverter ncnv =new NumberConverter();                ncnv.setCurrencyCode("€");