Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/fujiwara/consul-lock

runs another program with a Consul session/kv locked.
https://github.com/fujiwara/consul-lock

Last synced: about 1 month ago
JSON representation

runs another program with a Consul session/kv locked.

Awesome Lists containing this project

README

        

# consul-lock

Like the setlock command using Consul session/kv.

This is a conceptual code, not for a production use.

Now, [Consul 0.5](https://hashicorp.com/blog/consul-0-5.html) provides `lock` command. I recommend use it.

## Repository

[github.com/fujiwara/consul-lock](https://github.com/fujiwara/consul-lock)

## Binary releases

[github.com/fujiwara/consul-lock/releases](https://github.com/fujiwara/consul-lock/releases)

## Build & Install

Install to $GOPATH.

$ go get github.com/fujiwara/consul-lock

## Usage

$ consul-lock [-nNxX] KEY program [ arg ... ]

-n: No delay. If KEY is locked by another process, consul-lock gives up.
-N: (Default.) Delay. If KEY is locked by another process, consul-lock waits until it can obtain a new lock.
-x: If KEY is locked, consul-lock exits zero.
-X: (Default.) If KEY is locked, consul-lock prints an error message and exits nonzero.
-lock-delay=15: Consul session LockDelay seconds

## LICENSE

MIT