Stop trying to start gerrit every time

We only want to start it when we've installed or upgraded.
The initial-init and init are designed to either one of them run,
one if there is no init script (initial install) the other if there
is (upgrade). The things they trigger should only run in response
to those actions.

Change-Id: I3bcaaed07bcf6239e053789b9b6241cbf652e7d4
This commit is contained in:
Monty Taylor 2014-04-18 11:35:46 -07:00
parent 9c650cc731
commit 566e936d98

View File

@ -512,12 +512,14 @@ class gerrit(
user => 'gerrit2', user => 'gerrit2',
command => '/usr/bin/java -jar /home/gerrit2/review_site/bin/gerrit.war init -d /home/gerrit2/review_site --batch --no-auto-start', command => '/usr/bin/java -jar /home/gerrit2/review_site/bin/gerrit.war init -d /home/gerrit2/review_site --batch --no-auto-start',
subscribe => File['/home/gerrit2/review_site/bin/gerrit.war'], subscribe => File['/home/gerrit2/review_site/bin/gerrit.war'],
refreshonly => true,
require => [Package['openjdk-7-jre-headless'], require => [Package['openjdk-7-jre-headless'],
User['gerrit2'], User['gerrit2'],
Mysql::Db['reviewdb'], Mysql::Db['reviewdb'],
File['/home/gerrit2/review_site/etc/gerrit.config'], File['/home/gerrit2/review_site/etc/gerrit.config'],
File['/home/gerrit2/review_site/etc/secure.config']], File['/home/gerrit2/review_site/etc/secure.config']],
notify => Exec['install-core-plugins'], notify => Exec['install-core-plugins'],
unless => '/usr/bin/test -f /etc/init.d/gerrit',
logoutput => true, logoutput => true,
} }
@ -536,6 +538,7 @@ class gerrit(
File['/home/gerrit2/review_site/etc/gerrit.config'], File['/home/gerrit2/review_site/etc/gerrit.config'],
File['/home/gerrit2/review_site/etc/secure.config']], File['/home/gerrit2/review_site/etc/secure.config']],
notify => Exec['install-core-plugins'], notify => Exec['install-core-plugins'],
onlyif => '/usr/bin/test -f /etc/init.d/gerrit',
logoutput => true, logoutput => true,
} }
@ -547,7 +550,7 @@ class gerrit(
require => [Package['unzip'], require => [Package['unzip'],
File['/home/gerrit2/review_site/plugins']], File['/home/gerrit2/review_site/plugins']],
notify => Exec['gerrit-start'], notify => Exec['gerrit-start'],
unless => '/usr/bin/test -f /etc/init.d/gerrit', refreshonly => true,
logoutput => true, logoutput => true,
} }