daemonite 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/daemonite.gemspec +1 -1
- data/lib/daemonite.rb +7 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d8dd415ba23cfc44e6fa21802971ccaac6797957
|
4
|
+
data.tar.gz: 74922ccfb54147bc3624da1bceff8c81b1cd3e29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 85e18b83a5e1efc943cac2393c2e8c6c342b6f521936fa730b054926b74695ae5d6647216e622f13a0d005d878b65676d1f4b8484938a920e4a34bbc9432c6dd
|
7
|
+
data.tar.gz: e9fc593596f15e36c4a32ddd05f851f209234d6e7c68286ec3da91b4d99b30269c99cd1a71cdebbf0342136994b7f4a52ff671e341d0c7acd64dd4c53fe50306
|
data/daemonite.gemspec
CHANGED
data/lib/daemonite.rb
CHANGED
@@ -41,6 +41,7 @@ module Daemonism
|
|
41
41
|
Dir.chdir(opts[:basepath])
|
42
42
|
|
43
43
|
# set more default options and do other stuff
|
44
|
+
opts[:repeat] = nil
|
44
45
|
instance_exec(opts,&block) if block_given?
|
45
46
|
|
46
47
|
########################################################################################################################
|
@@ -70,7 +71,6 @@ module Daemonism
|
|
70
71
|
@at_exit = nil
|
71
72
|
end
|
72
73
|
########################################################################################################################
|
73
|
-
opts[:repeat] = nil
|
74
74
|
opts[:runtime_proc].call(opts) unless opts[:runtime_proc].nil?
|
75
75
|
|
76
76
|
########################################################################################################################
|
@@ -86,11 +86,11 @@ module Daemonism
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
if opts[:cmdl_operation] == "info" && status.call == false
|
89
|
-
puts "Server #{opts[:cmdl_info].nil? ? '
|
89
|
+
puts "Server #{opts[:cmdl_info].nil? ? '' : '(' + opts[:cmdl_info].to_s + ') '}not running"
|
90
90
|
exit
|
91
91
|
end
|
92
92
|
if opts[:cmdl_operation] == "info" && status.call == true
|
93
|
-
puts "Server #{opts[:cmdl_info].nil? ? '
|
93
|
+
puts "Server #{opts[:cmdl_info].nil? ? '' : '(' + opts[:cmdl_info].to_s + ') '}running as #{pid}"
|
94
94
|
begin
|
95
95
|
stats = `ps -o "vsz,rss,lstart,time" -p #{pid}`.split("\n")[1].strip.split(/ +/)
|
96
96
|
puts "Virtual: #{"%0.2f" % (stats[0].to_f/1024)} MiB"
|
@@ -102,7 +102,7 @@ module Daemonism
|
|
102
102
|
exit
|
103
103
|
end
|
104
104
|
if %w{start}.include?(opts[:cmdl_operation]) && status.call == true
|
105
|
-
puts "Server #{opts[:cmdl_info].nil? ? '
|
105
|
+
puts "Server #{opts[:cmdl_info].nil? ? '' : '(' + opts[:cmdl_info].to_s + ') '}already started"
|
106
106
|
exit
|
107
107
|
end
|
108
108
|
|
@@ -111,9 +111,9 @@ module Daemonism
|
|
111
111
|
########################################################################################################################
|
112
112
|
if %w{stop restart}.include?(opts[:cmdl_operation])
|
113
113
|
if status.call == false
|
114
|
-
puts "Server #{opts[:cmdl_info].nil? ? '
|
114
|
+
puts "Server #{opts[:cmdl_info].nil? ? '' : '(' + opts[:cmdl_info].to_s + ') '}maybe not started?"
|
115
115
|
else
|
116
|
-
puts "Server #{opts[:cmdl_info].nil? ? '
|
116
|
+
puts "Server #{opts[:cmdl_info].nil? ? '' : '(' + opts[:cmdl_info].to_s + ') '}stopped"
|
117
117
|
puts "Waiting while server goes down ..."
|
118
118
|
while status.call
|
119
119
|
Process.kill "SIGTERM", pid
|
@@ -130,7 +130,7 @@ module Daemonism
|
|
130
130
|
ro[2].call(status.call) if opts[:cmdl_operation] == ro[0]
|
131
131
|
end
|
132
132
|
|
133
|
-
puts "Server #{opts[:cmdl_info].nil? ? '
|
133
|
+
puts "Server #{opts[:cmdl_info].nil? ? '' : '(' + opts[:cmdl_info].to_s + ') '}started as PID:#{Process.pid}"
|
134
134
|
Process.daemon(opts[:basepath]) unless opts[:verbose]
|
135
135
|
File.write(opts[:basepath] + '/' + opts[:pidfile],Process.pid) # after daemon, so that we get the forked pid
|
136
136
|
Dir.chdir(opts[:basepath])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daemonite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Juergen eTM Mangler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Daemonite - Process.daemon and argparse wrapper for loopies.
|
14
14
|
email: juergen.mangler@gmail.com
|