Git Product home page Git Product logo

cronutils's Issues

Incorrect timeout message

Original issue 1 created by jaqx0r on 2011-12-09T07:54:55.000Z:

In line 142 must be "Waited %timeout seconds...", now is "Waited 5 seconds..."

runlock and runstat fails on absolute command paths

runlock can't handle absolute command paths, and is explicit about why:

$ runlock /usr/bin/true
/tmp/cronutils-kseistrup//usr/bin/true.pid: No such file or directory

runstat probably has the same problem, but is more subtle about why it fails:

$ runstat /usr/bin/true
mkstemp: No such file or directory

Both commands should probably either create the missing path in /tmp/cronutils-$USER before running command, or substitute the directory separator with some other character, although the latter solution may lead to ambiguous filenames (e.g., /path/to/command โ†’ path_to_command vs. the command path_to_command in $PATH).

Another solution could be to create a lockfile sha256(command + args) and symlink it to $(basename $command).$PID to enable the user to find the file.

Sanitizing command paths for double separators and more is probably also a good idea:

$ pwd                             # we're just at home, having fun
/home/kseistrup
$ ../../usr/bin/date +%Y          # ugly, but it works
2021
$ runlock ../../usr/bin/date +%Y  # runlock will attempt to create a lockfile outside tmp/cronutils-$USER
/tmp/cronutils-kseistrup/../../usr/bin/date.pid: Permission denied
$ runlock /usr/bin/true           # yields unpretty double slash in lock filename

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.