check if vb is already open

Bug #1236006 reported by Francesco Apollonio
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Virtualbricks
Fix Released
Medium
Francesco Apollonio

Bug Description

Only one instance of virtualbricks can be executed at the same time, vb has to use a lock file (under /tmp) to check if another instance is already running

Related branches

Revision history for this message
Francesco Apollonio (lorddex) wrote :

fixed r749

Changed in virtualbrick:
assignee: nobody → Francesco Apollonio (lorddex)
status: Confirmed → Fix Committed
Revision history for this message
Marco Giusti (marco-giusti) wrote :

virtualbricks._settings is meant to be private and virtualbricks.scritps.virtualbricks is just a wrapper to virtualbricks.scripts.gui

Maybe that code is better in virtualbricks.app

Changed in virtualbrick:
status: Fix Committed → In Progress
Revision history for this message
Francesco Apollonio (lorddex) wrote : Re: [Bug 1236006] Re: check if vb is already open

OK, I will move the code in the app file

Francesco
Il 08/ott/2013 08:50 "mg" <email address hidden> ha scritto:

> virtualbricks._settings is meant to be private and
> virtualbricks.scritps.virtualbricks is just a wrapper to
> virtualbricks.scripts.gui
>
> Maybe that code is better in virtualbricks.app
>
> ** Changed in: virtualbrick
> Status: Fix Committed => In Progress
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1236006
>
> Title:
> check if vb is already open
>
> Status in Virtualbricks:
> In Progress
>
> Bug description:
> Only one instance of virtualbricks can be executed at the same time,
> vb has to use a lock file (under /tmp) to check if another instance is
> already running
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/virtualbrick/+bug/1236006/+subscriptions
>

Revision history for this message
Marco Giusti (marco-giusti) wrote :

Just a thought, what about a shell script that do that? Something like

    LOCKFILE=/tmp/vb.lock
    if lockfile -r0 $LOCKFILE 2> /dev/null; then
        virtualbricks
    else
        Another Virtualbricks instance is running. If this is an error, please delete $LOCKFILE to start Virtualbricks
    fi

Revision history for this message
Marco Giusti (marco-giusti) wrote :

Enhanced version:

    LOCKFILE=/tmp/vb.lock
    trap "rm -f $LOCKFILE" EXIT SIGINT SIGQUIT SIGTERM
    if lockfile -r0 $LOCKFILE 2> /dev/null; then
        echo $$ > $LOCKFILE
        virtualbricks
    else
        Another Virtualbricks instance is running. If this is an error, please delete $LOCKFILE to start Virtualbricks
    fi

Changed in virtualbrick:
status: In Progress → Fix Committed
Changed in virtualbrick:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.