Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Programming > Perl Modules

    Sys::RunAlone 0.12

    Download button

    No screenshots available
    Downloads: 299  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.0/5)
    2 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Elizabeth Mattijsen | More programs
    Perl Artistic License / FREE
    May 2nd, 2012, 15:14 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Sys::RunAlone description

    Can make sure only one invocation of a script is active at a time.

    Sys::RunAlone can make sure only one invocation of a script is active at a time.

    SYNOPSIS

    use Sys::RunAlone;
    # code of which there may only be on instance running on system

    Provide a simple way to make sure the script from which this module is loaded, is only running once on the server.

    THEORY OF OPERATION

    The functionality of this module depends on the availability of the DATA handle in the script from which this module is called (more specifically: in the "main" namespace).

    At INIT time, it is checked whethere there is a DATA handle: if not, it exits with an error message on STDERR and an exit value of 2.

    If the DATA handle is available, and it cannot be flocked, it exits with an error message on STDERR and an exit value of 1.

    If there is a DATA handle, and it could be flocked, execution continues without any further interference.

    CAVEATS

    symlinks

    Execution of scripts that are (sym)linked to another script, will all be seen as execution of the same script, even though the error message will only show the specified script name. This could be considered a bug or a feature.

    changing a running script

    If you change the script while it is running, the script will effectively lose its lock on the file. Causing any subsequent run of the same script to be successful, causing two instances of the same script to run at the same time (which is what you wanted to prevent by using Sys::RunAlone in the first place). Therefore, make sure that no instances of the script are running (and won't be started by cronjobs while making changes) if you really want to be 100% sure that only one instance of the script is running at the same time.

    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    script invocation | single instance | Perl module | invocation | instance | Perl

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM