voxpupuli / puppet-jira

Atlassian JIRA Puppet Module
https://forge.puppet.com/puppet/jira
Apache License 2.0
62 stars 143 forks source link

jira service not restarted when changing systemd file #315

Closed decibelhertz closed 3 years ago

decibelhertz commented 4 years ago

Affected Puppet, Ruby, OS and module versions/distributions

How to reproduce (e.g Puppet code you use)

Change $javahome

What are you seeing

I believe https://github.com/voxpupuli/puppet-jira/blob/master/manifests/service.pp#L41 should be notify, not before.

What behaviour did you expect instead

Change in JAVA_HOME env var should restart the service, not just refresh systemd.

Output log

--- /usr/lib/systemd/system/jira.service    2020-03-21 14:50:09.262413164 +0000
+++ /tmp/puppet-file20200421-29393-1ymoezr  2020-04-21 14:13:28.910008660 +0000
@@ -4,7 +4,7 @@

 [Service]
 Type=forking
-Environment="JAVA_HOME=/usr/java/jdk1.8.0_201-amd64/jre"
+Environment="JAVA_HOME=/usr/java/jdk8u252-b09-jre"
 PIDFile=/data/atlassian/jira/atlassian-jira-software-8.5.4-standalone/work/catalina.pid
 User=jiraadm
 ExecStart=/data/atlassian/jira/atlassian-jira-software-8.5.4-standalone/bin/start-jira.sh

Notice: /Stage[main]/Jira::Service/File[/usr/lib/systemd/system/jira.service]/content: content changed '{md5}34094cf1388a619351dceaa0d8c38c80' to '{md5}1ef056d186b6f755b24de503b2c5769d'
Info: /Stage[main]/Jira::Service/File[/usr/lib/systemd/system/jira.service]: Scheduling refresh of Exec[refresh_systemd]
Notice: /Stage[main]/Jira::Service/Exec[refresh_systemd]: Triggered 'refresh' from 1 event
Notice: Applied catalog in 5.80 seconds

Ran service jira status -l and found that the service was still running the old version of Java 8.

Any additional information you'd like to impart

Am converting from Oracle JDK to AdoptOpenJDK JRE and the JIRA service needed to be manually restarted. I think this can be avoided with a simple metaparameter change.

dhoppe commented 4 years ago

I think we should use ˋˋˋcamptocamp/systemdˋˋˋ. @bastelfreak Do you agree?

decibelhertz commented 4 years ago

I know you're not asking me, but will point out that it would be consistent with the Vox Pupuli Confluence module to do that... https://forge.puppet.com/puppet/confluence/dependencies

dhoppe commented 4 years ago

Sounds good. It looks like the Confluence module is a little bit smarter, because it does not restart by default.

Are you able to provide a pull request? That would be great.

decibelhertz commented 4 years ago

I'm willing to do a PR (are several PRs?).

Upon code review, there are some organizational issues that I think would help when doing so. My questions would be:

Of less interest, but will point out that I am willing to address while I working:

oranenj commented 3 years ago

I'm currently on a cleanup spree, so it's pretty likely I'll do something to fix this too until I run out of steam :P Let's see.