Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/overminddl1/pid_file
https://github.com/overminddl1/pid_file
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/overminddl1/pid_file
- Owner: OvermindDL1
- Created: 2017-08-07T22:53:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-01-20T22:32:10.000Z (almost 3 years ago)
- Last Synced: 2024-04-25T06:43:00.801Z (8 months ago)
- Language: Elixir
- Size: 7.81 KB
- Stars: 31
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PidFile
Manages a simple OS PID file for this BEAM system.
In other words it just makes a file whose sole contents is the Operating System PID of the running BEAM process.
It should also auto-clean old PID files on load, and clear the PID file on a 'proper' shutdown, but even if not a proper shutdown then it will still clear it properly next time.
Hex: https://hex.pm/packages/pid_file
## Installation
```elixir
{:pid_file, "~> 0.2.0"},
```## Setup
### Global Config
Add one of these to your config for it to be managed globally, replacing the values as necessary:
```elixir
config :pid_file, file: "./my_app.pid"
config :pid_file, file: {:SYSTEM, "PIDFILE"}
```### Locally Managed
Add the worker to your supervision tree:
```elixir
worker(PidFile.Worker, [[file: "/run/my_app.pid"]])
```