Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jhthorsen/app-single
An application to run a single instance of a command
https://github.com/jhthorsen/app-single
Last synced: 27 days ago
JSON representation
An application to run a single instance of a command
- Host: GitHub
- URL: https://github.com/jhthorsen/app-single
- Owner: jhthorsen
- Created: 2014-07-27T09:09:23.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-10-02T11:28:32.000Z (about 10 years ago)
- Last Synced: 2024-10-16T11:58:42.590Z (3 months ago)
- Language: Perl
- Size: 199 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README
- Changelog: Changes
Awesome Lists containing this project
README
NAME
App::single - An application to run a single instance of a commandVERSION
0.06DESCRIPTION
App::single is an application which allow you to run a single instance
of a command. This is useful when you want to run a process from crontab
. Example:* * * * * /usr/local/bin/single autossh example.com sleep 86400 2>/dev/null 1>/dev/null
The way it works is that it makes a temporarily file which include
information about the process. Information written to the file includes
the PID of the process, so the second time "single" is started with the
same arguments it will check if the PID is alive.NOTE: This script is not atomic, but more than good enough for handling
the "crontab" case.SYNOPSIS
$ single
$ single autossh example.com sleep 864000
$ single "echo 123;sleep 86400";NOTE: Including shell characters (such as ">", "|", ";", ...) will
invoke the shell, allowing unsafe user input.ENVIRONMENT
* SINGLE_HUP_SIGNALIt is possible to send a HUP signal to the "single" process, which
will restart the application. The way it restarts the application is
simply by sending the "SINGLE_HUP_SIGNAL" signal to the application.
This is "TERM" by default.INSTALLATION
The easiest way to get this application is by using cpanminus:$ curl -L http://cpanmin.us | perl -n - --sudo App::single
Note: "--sudo" is to install "single" system wide, "-n" is to skip tests
for faster installation.COPYRIGHT AND LICENSE
Copyright (C) 2014, Jan Henning ThorsenThis program is free software, you can redistribute it and/or modify it
under the terms of the Artistic License version 2.0.AUTHOR
Jan Henning Thorsen - "[email protected]"