Skip to content

Create .pid files for package builds#49

Merged
jaredmorrow merged 5 commits intomasterfrom
jem-pidfile
May 2, 2013
Merged

Create .pid files for package builds#49
jaredmorrow merged 5 commits intomasterfrom
jem-pidfile

Conversation

@jaredmorrow
Copy link
Contributor

To properly support OS startup / shutdown scripts (sysvinit for example) we would like to enable the creation/deletion of .pid files. The issue with .pid creation in the init files (as is standard) is the system can get into a bad state if for example init is used for runner startup, but then ./runner stop is used for shutdown.

This PR attempts to address that by creating the .pid files in the runner script itself. No attempt was made to make this setup work for devrel (multi-node, single machine) builds because those are typically run as non-root.

jaredmorrow added a commit that referenced this pull request May 2, 2013
@jaredmorrow
Copy link
Contributor Author

Here's a sample run of the latest code

bakers% ls -l /var/run/riak
ls: cannot access /var/run/riak: No such file or directory
bakers% riak ping
Node 'riak@127.0.0.1' not responding to pings.
bakers% riak start
Unable to access /var/run/riak, permission denied, run script as root
bakers% riak stop
Unable to access /var/run/riak, permission denied, run script as root
bakers% sudo riak start
bakers% riak ping
pong
bakers% riak version
1.4wip-62bc7a5a
bakers% riak getpid
18912
bakers% riak start
Unable to access /var/run/riak, permission denied, run script as root
bakers% sudo riak start
Node is already running!
bakers% cat /var/run/riak/riak.pid
18912
bakers% riak stop
Unable to access /var/run/riak, permission denied, run script as root
bakers% sudo riak stop
ok
bakers% riak ping
Node 'riak@127.0.0.1' not responding to pings.
bakers% ls -l /var/run/riak
total 0
bakers%

@Vagabond
Copy link
Contributor

Vagabond commented May 2, 2013

+1 on visual and conceptual review. I didn't actually test it because testing branches of node_package sucks.

jaredmorrow added a commit that referenced this pull request May 2, 2013
Create .pid files for package builds
@jaredmorrow jaredmorrow merged commit 6ef0017 into master May 2, 2013
@jaredmorrow jaredmorrow deleted the jem-pidfile branch May 2, 2013 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants