fileminer 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/fileminer-genconf +38 -1
- data/lib/fileminer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0480c78fcf49be0ff2ebc29d2993bc45852daec6e8cfd96568a68f515d52845c'
|
4
|
+
data.tar.gz: 39cd25174e8e6dc8eab9aca064ec0bcd9a2ba86e69432543e10bda02a20a2fc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2e9dc70729d14f0fa35774d33b34420516ca0fa82a5bbc3d0c2fdf531292d621c3d2def2a2ca77fa890ef5d255cdde0c29d5c673fa0e7a22834df03bdd5b541
|
7
|
+
data.tar.gz: 01d0d80f2ac6462ae99d6decb6c1d752be5d6905081bc1448051bf0afe9940ec5967eb3e19cf41fa4fd0be36ab12674e7f26a8f5843592a34267f0e463514577
|
data/bin/fileminer-genconf
CHANGED
@@ -67,6 +67,39 @@ user=root
|
|
67
67
|
end
|
68
68
|
end
|
69
69
|
|
70
|
+
def gen_systemd_conf(options)
|
71
|
+
wrapper_home = File.join ENV['GEM_HOME'], 'wrappers'
|
72
|
+
content = <<-EOS
|
73
|
+
[Unit]
|
74
|
+
Description=FileMiner Service
|
75
|
+
After=network.target
|
76
|
+
|
77
|
+
[Service]
|
78
|
+
Type=simple
|
79
|
+
PIDFile=/run/fileminer.pid
|
80
|
+
SuccessExitStatus=0
|
81
|
+
KillSignal=SIGINT
|
82
|
+
ExecStart=#{wrapper_home}/fileminer
|
83
|
+
User=root
|
84
|
+
Restart=on-abort
|
85
|
+
|
86
|
+
[Install]
|
87
|
+
WantedBy=multi-user.target
|
88
|
+
EOS
|
89
|
+
if options.key? :out
|
90
|
+
out = options[:out]
|
91
|
+
dst = out.nil? ? '/usr/lib/systemd/system/fileminer.service' : File.absolute_path(out)
|
92
|
+
unless dst.end_with?('.service')
|
93
|
+
dst = File.join dst, 'fileminer.service'
|
94
|
+
end
|
95
|
+
dst_dir = File.dirname dst
|
96
|
+
Dir.mkdirs dst_dir unless Dir.exists? dst_dir
|
97
|
+
File.open(dst, 'w') { |io| io.write content }
|
98
|
+
else
|
99
|
+
puts content
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
70
103
|
|
71
104
|
options = Hash.new
|
72
105
|
OptionParser.new do |opts|
|
@@ -78,6 +111,8 @@ OptionParser.new do |opts|
|
|
78
111
|
opts.separator ' fileminer-genconf -t fileminer -o Generate config on /etc/fileminer/fileminer.yml'
|
79
112
|
opts.separator ' fileminer-genconf -t supervisor -o -l Generate ./fileminer.ini with logfile on'
|
80
113
|
opts.separator ' /var/log/fileminer/stderr.log'
|
114
|
+
opts.separator ' fileminer-genconf -t systemd -o Generate systemd config on'
|
115
|
+
opts.separator ' /usr/lib/systemd/system/fileminer.service'
|
81
116
|
opts.separator ''
|
82
117
|
opts.separator 'Options:'
|
83
118
|
|
@@ -90,7 +125,7 @@ OptionParser.new do |opts|
|
|
90
125
|
|
91
126
|
# type
|
92
127
|
options[:type] = :fileminer
|
93
|
-
opts.on('-t', '--type fileminer|supervisor', [:fileminer, :supervisor],
|
128
|
+
opts.on('-t', '--type fileminer|supervisor|systemd', [:fileminer, :supervisor, :systemd],
|
94
129
|
'Type of the config file to be generated', 'Default is fileminer') do |value|
|
95
130
|
options[:type] = value
|
96
131
|
end
|
@@ -117,4 +152,6 @@ when :fileminer
|
|
117
152
|
gen_fileminer_conf options
|
118
153
|
when :supervisor
|
119
154
|
gen_supervisor_conf options
|
155
|
+
when :systemd
|
156
|
+
gen_systemd_conf options
|
120
157
|
end
|
data/lib/fileminer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fileminer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fang MinJie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-17 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
FileMiner is a simple file/log transfer tool implemented in Ruby.
|