kuzushi 0.0.41 → 0.0.42
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/kuzushi.rb +7 -5
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.42
|
data/lib/kuzushi.rb
CHANGED
@@ -109,18 +109,20 @@ class Kuzushi
|
|
109
109
|
file = []
|
110
110
|
file << "start on stopped rc RUNLEVEL=[2345]"
|
111
111
|
file << "stop on runlevel [!2345]"
|
112
|
+
filt << ""
|
112
113
|
file << "respawn" unless service.respawn == false
|
113
114
|
if service.user
|
114
|
-
file << "exec su -c '#{service.command}' #{service.user}" ## TODO add shell escaping here
|
115
|
+
file << "exec su - -c '#{service.command}' #{service.user}" ## TODO add shell escaping here
|
115
116
|
else
|
116
117
|
file << "exec #{service.command}"
|
117
118
|
end
|
118
|
-
|
119
|
+
filt << ""
|
120
|
+
file.join("\n")
|
119
121
|
end
|
120
122
|
|
121
123
|
def process_services(service)
|
122
124
|
task "installing service #{service.name}" do
|
123
|
-
put_file(service_file(service), "/etc/init/#{service.name}.conf")
|
125
|
+
put_file(service_file(service), "/etc/init/#{service.name}.conf", 0600)
|
124
126
|
shell "service #{service.name} start"
|
125
127
|
end
|
126
128
|
end
|
@@ -387,11 +389,11 @@ class Kuzushi
|
|
387
389
|
FileUtils.cp(src, dest)
|
388
390
|
end
|
389
391
|
|
390
|
-
def put_file(data, dest)
|
392
|
+
def put_file(data, dest, mode = 0700)
|
391
393
|
FileUtils.mkdir_p(File.dirname(dest))
|
392
394
|
File.open(dest,"w") do |f|
|
393
395
|
f.write(data)
|
394
|
-
f.chmod(
|
396
|
+
f.chmod(mode)
|
395
397
|
end
|
396
398
|
end
|
397
399
|
|