An utility or a way to allow only one instance of app running in Gnome desktop

Posted on 2007-08-09
Last Modified: 2013-12-16
I am using Fedora Linux with Gnome. Is there an utility or a way to only allow single instance of an app running on the desktop? (This app itself does not have single instance running option)

I need this feature so I won't accidentally open 2 instances of the same program, overwriting the same file, making it lose the new file content when saved by the other instance of the program with the old content, because this already happened to me and it was very frustrating to lose all my hours of work :(
Question by:santocki
    LVL 57

    Accepted Solution

    Off hand I would suggest renaming the application's program, create a shell script by the same name, and have the shell script check for to see if a "lock" file exists, if the lock file exists, it the script ends, if it does not exist, it creates one and runs the renamed program, when the shell script ends it deletes the lock file.

    This is basically how most other programs works and they create "" files as the lock files.

    You really don't need to rename the program file, you only need to make sure that the directory with the shell script is in a directory that is listed in the path before the directory the program is in.  
    LVL 1

    Expert Comment

    This also sounds like a good time to look at using a configuration managerment system to track changes to your output files.
    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension ( This reminded me of questions tha…
    It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now