foreman_god 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/foreman_god/god_config.rb +6 -0
- data/lib/foreman_god/version.rb +1 -1
- data/spec/god_config_spec.rb +2 -1
- metadata +1 -1
@@ -89,6 +89,11 @@ module ForemanGod
|
|
89
89
|
@options[:log] || 'log'
|
90
90
|
end
|
91
91
|
|
92
|
+
def group_name
|
93
|
+
gid = Etc.getpwnam(user_name).gid
|
94
|
+
Etc.getgrgid(gid).name
|
95
|
+
end
|
96
|
+
|
92
97
|
|
93
98
|
def wrap_command(cmd)
|
94
99
|
if user_name
|
@@ -140,6 +145,7 @@ module ForemanGod
|
|
140
145
|
if user_name && (Etc.getlogin != user_name)
|
141
146
|
# Only set the uid if the user is different from the current user
|
142
147
|
w.uid = user_name
|
148
|
+
w.gid = group_name
|
143
149
|
end
|
144
150
|
|
145
151
|
# w.gid = ?
|
data/lib/foreman_god/version.rb
CHANGED
data/spec/god_config_spec.rb
CHANGED
@@ -28,7 +28,7 @@ describe GodConfig do
|
|
28
28
|
watch.log.should == '/dev/null'
|
29
29
|
|
30
30
|
watch.uid.should == nil # The user name is the same as the current user
|
31
|
-
|
31
|
+
watch.gid.should == nil
|
32
32
|
end
|
33
33
|
|
34
34
|
it "should log if log is specified" do
|
@@ -79,6 +79,7 @@ describe GodConfig do
|
|
79
79
|
# We cannot easily test watch.uid in a single-user setup
|
80
80
|
pending "Test watch.uid"
|
81
81
|
#watch.uid.should == user
|
82
|
+
#watch.gid.should == ?
|
82
83
|
end
|
83
84
|
end
|
84
85
|
|