Skip to content

Commit

Permalink
Add demo illustrating PIDs, before/after kexec.
Browse files Browse the repository at this point in the history
  • Loading branch information
smblott-github committed Jan 17, 2014
1 parent dad3100 commit d315ac1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

.PHONY: build test demo demovp
.PHONY: build test demo demovp demovp-pids demos

build:
node-gyp clean
Expand All @@ -18,3 +18,12 @@ demovp:
$(MAKE) build
cd demo && node demovp.js

demovp-pids:
$(MAKE) build
cd demo && node demovp-pids.js

demos:
$(MAKE) build
cd demo && node demo.js
cd demo && node demovp.js
cd demo && node demovp-pids.js
6 changes: 6 additions & 0 deletions demo/demovp-pids.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var kexec = require('../')

console.log(process.pid+' - PID before exec')

kexec('sh', [ '-c', 'echo "$$ - PID after exec"' ] );

0 comments on commit d315ac1

Please sign in to comment.