Skip to content

Commit bfd74b9

Browse files
committed
Fix dev-sec#17: Checking postgresql status on Ubuntu
Signed-off-by: Mahdi Fooladgar <[email protected]>
1 parent 1bcdb4d commit bfd74b9

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

controls/postgres_spec.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,16 @@
3838
impact 1.0
3939
title 'Postgresql should be running'
4040
desc 'Postgresql should be running.'
41-
describe service(postgres.service) do
42-
it { should be_installed }
43-
it { should be_running }
44-
it { should be_enabled }
41+
if os[:name] == "ubuntu"
42+
describe command('/etc/init.d/postgresql status') do
43+
its('stdout') { should include 'active' }
44+
end
45+
else
46+
describe service(postgres.service) do
47+
it { should be_installed }
48+
it { should be_running }
49+
it { should be_enabled }
50+
end
4551
end
4652
end
4753

0 commit comments

Comments
 (0)