RexOps / rex-jobcontrol

Simple Webinterface to control Rex
10 stars 6 forks source link

vars.db.lock - multiple rex execution #13

Open Azryel opened 9 years ago

Azryel commented 9 years ago

Hello,

I use a tasks scheduler i made to run a lot of simultaneous rex jobs in threads. I run into problems when i try to execute it through crontab. This is what i get in mail after execution : Permission denied at /usr/share/perl5/vendor_perl/Rex/Shared/Var/Array.pm line 138.

which refers to : sysopen( my $dblock, "vars.db.lock", O_RDONLY | O_CREAT ) or die($!);

I don't understand what this file is used for and where/when it is created. I run rex with the "-F" flag to avoid the rexfile lock to be significant (even though it still gets created).

It doesn't seem to get in the way of my tasks, they still get executed fine. I get the logs through a web interface i also made and which reports rex errors. It logs the "Permission denied" error after the tasks have been successfully executed, not before.

I can't reproduce the error via the user's cli, only through his crontab.

Could you give me a hint what this "vars.db" file is and what it is used for ?

Thank you very much :) Daryl

mbroadhead commented 7 years ago

@Azryel and Daryl, Have a look at the perldoc for Rex::Shared::Var. The following is from version 1.5.0-3-g06d9602:

NAME
    Rex::Shared::Var - Share variables across Rex tasks

DESCRIPTION
    Share variables across Rex tasks with the help of Storable, using a
    "vars.db.$PID" file in the local directory, where $PID is the PID of the
    parent process.
...

You could also try upgrading to the latest release (currently 1.4.1), which may have fixed the issue.