Skip to content
This repository has been archived by the owner on Feb 21, 2020. It is now read-only.

Added old style start/stop/status standard script to work with system… #64

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ricciocri
Copy link

…d provider.

I'm using this module on Debian 8 (systemd) and I got this error:

Error: Could not start Service[sonarqube]: Execution of '/usr/sbin/service sonar start' returned 6: Failed to start sonar.service: Unit sonar.service failed to load: No such file or directory.
Wrapped exception:
Execution of '/usr/sbin/service sonar start' returned 6: Failed to start sonar.service: Unit sonar.service failed to load: No such file or directory.
Error: /Stage[main]/Sonarqube/Service[sonarqube]/ensure: change from stopped to running failed: Could not start Service[sonarqube]: Execution of '/usr/sbin/service sonar start' returned 6: Failed to start sonar.service: Unit sonar.service failed to load: No such file or directory.

This is because the "standard" scripts for systems with systemd are "service $servicename start|stop|status", this don't work well with the sonar downloaded from the website and the /etc/init.d/ script.

My small changes don't break the code on old systems and make it work also on systemd Linux (tested on debian 8).

@deboj
Copy link

deboj commented Mar 1, 2016

im seeing a similar error :

Error: Could not start Service[sonarqube]: Execution of '/bin/systemctl start sonar' returned 6: Failed to start sonar.service: Unit sonar.service failed to load: No such file or directory.
Error: /Stage[main]/Sonarqube/Service[sonarqube]/ensure: change from stopped to running failed: Could not start Service[sonarqube]: Execution of '/bin/systemctl start sonar' returned 6: Failed to start sonar.service: Unit sonar.service failed to load: No such file or directory.

@Gengar003
Copy link

Centos7 with systemd over here; would be nice to have support for systemd out-of-the-box.

@carlossg
Copy link
Member

carlossg commented Mar 2, 2016

I think this is not the right solution, the systemd startup script (which may be included in sonar or something like https://github.com/wichtounet/systemd-unit-files/blob/master/sonar.service) should be copied to the right location on those OSs with systemd

@dploeger
Copy link

dploeger commented Feb 22, 2017

I think, there's only a "systemctl daemon-reload" missing before the service is started initially.

I fixed it by injecting something like:

exec {
    'sonarqube.reloadsystemd':
      command => '/bin/systemctl daemon-reload',
      require => File["/etc/init.d/sonar"],
      before  => Service['sonarqube']
  }

@dploeger
Copy link

Ah, but that leaves systemd to auto-generate the service unit based on the init script and its currently missing a user setting, so it doesn't start using systemd.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants