From 8897ab59088b89770a6754bee7d94156922e19ee Mon Sep 17 00:00:00 2001 From: Emilien Macchi Date: Tue, 9 Dec 2014 10:56:04 -0500 Subject: [PATCH] crontab: ensure the script is run with shell Some distros does not provide a default shell for Nova user. We can run the crontab by force shell usage and avoid running issues. Change-Id: Id222c943ac2f0957e1354a739ca42dde1162d1ae --- manifests/cron/archive_deleted_rows.pp | 2 +- spec/classes/nova_cron_archive_deleted_rows_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/cron/archive_deleted_rows.pp b/manifests/cron/archive_deleted_rows.pp index dfcd272a3..92b769fcf 100644 --- a/manifests/cron/archive_deleted_rows.pp +++ b/manifests/cron/archive_deleted_rows.pp @@ -57,7 +57,7 @@ class nova::cron::archive_deleted_rows ( cron { 'nova-manage db archive_deleted_rows': command => "nova-manage db archive_deleted_rows --max_rows ${max_rows} >>/var/log/nova/nova-rowsflush.log 2>&1", - environment => 'PATH=/bin:/usr/bin:/usr/sbin', + environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh', user => $user, minute => $minute, hour => $hour, diff --git a/spec/classes/nova_cron_archive_deleted_rows_spec.rb b/spec/classes/nova_cron_archive_deleted_rows_spec.rb index b36487908..3d6e8d044 100644 --- a/spec/classes/nova_cron_archive_deleted_rows_spec.rb +++ b/spec/classes/nova_cron_archive_deleted_rows_spec.rb @@ -9,7 +9,7 @@ describe 'nova::cron::archive_deleted_rows' do it 'configures a cron' do should contain_cron('nova-manage db archive_deleted_rows').with( :command => 'nova-manage db archive_deleted_rows --max_rows 100 >>/var/log/nova/nova-rowsflush.log 2>&1', - :environment => 'PATH=/bin:/usr/bin:/usr/sbin', + :environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh', :user => 'nova', :minute => 1, :hour => 0,