Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Tiny Clojure library to get current process ID and save/read PID files.

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 src
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 project.clj
README.md

clj-pid

Tiny Clojure library to get current process ID and save/read PID files.

Install

Available from Clojars.

Usage

(use ['clj-pid.core :as 'pid])

(def pid-file "/var/run/my-daemon.pid")

;; Get current process PID
(pid/current) ; => "39350"

;; Save pid file
(pid/save pid-file)

;; Delete pid file
(pid/delete pid-file) ; => true / false

;; Delete pid file on JVM shutdown
(pid/delete-on-shutdown! pid-file)

License

Copyright (C) 2013 Dima Sabanin

Distributed under the Eclipse Public License, the same as Clojure.

Something went wrong with that request. Please try again.