Skip to content

Commit

Permalink
crontab: ensure the script is run with bash shell
Browse files Browse the repository at this point in the history
Some distros does not provide a default shell for Keystone user.
We can run the crontab by force shell usage and avoid running
issues.

Change-Id: Ib05522d922fecfbd28aa8a8b092b4d3b47172d00
  • Loading branch information
Emilien Macchi committed Dec 9, 2014
1 parent 0df9701 commit c39fca2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manifests/cron/token_flush.pp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
cron { 'keystone-manage token_flush':
ensure => $ensure,
command => "${sleep}keystone-manage token_flush >>/var/log/keystone/keystone-tokenflush.log 2>&1",
environment => 'PATH=/bin:/usr/bin:/usr/sbin',
environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
user => 'keystone',
minute => $minute,
hour => $hour,
Expand Down
6 changes: 3 additions & 3 deletions spec/classes/keystone_cron_token_flush_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
should contain_cron('keystone-manage token_flush').with(
:ensure => 'present',
:command => 'keystone-manage token_flush >>/var/log/keystone/keystone-tokenflush.log 2>&1',
:environment => 'PATH=/bin:/usr/bin:/usr/sbin',
:environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
:user => 'keystone',
:minute => 1,
:hour => 0,
Expand All @@ -33,7 +33,7 @@
should contain_cron('keystone-manage token_flush').with(
:ensure => 'present',
:command => 'sleep `expr ${RANDOM} \\% 600`; keystone-manage token_flush >>/var/log/keystone/keystone-tokenflush.log 2>&1',
:environment => 'PATH=/bin:/usr/bin:/usr/sbin',
:environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
:user => 'keystone',
:minute => 1,
:hour => 0,
Expand All @@ -55,7 +55,7 @@
should contain_cron('keystone-manage token_flush').with(
:ensure => 'absent',
:command => 'keystone-manage token_flush >>/var/log/keystone/keystone-tokenflush.log 2>&1',
:environment => 'PATH=/bin:/usr/bin:/usr/sbin',
:environment => 'PATH=/bin:/usr/bin:/usr/sbin SHELL=/bin/sh',
:user => 'keystone',
:minute => 1,
:hour => 0,
Expand Down

0 comments on commit c39fca2

Please sign in to comment.