Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Ensure Jenkins::slave failed. #769

Closed
Protopopys opened this issue Jun 14, 2017 · 2 comments
Closed

Ensure Jenkins::slave failed. #769

Protopopys opened this issue Jun 14, 2017 · 2 comments

Comments

@Protopopys
Copy link

Protopopys commented Jun 14, 2017

Centos 7.3
rtyler-jenkins --version 1.7.0

jenkins_slave.pp :

class profile::jenkins_slave (
  $ssh_jenkins_pub_keys =  undef,
  $slave_name = $::fqdn
)

{
  class {'docker': }
  class { 'jenkins::slave':
    require => [ Class['docker'] ]
  }
}

hieradata:

---
classes:
  - role::jenkins_slave

jenkins::slave::masterurl: '_______'
jenkins::slave::ui_user: 'admin'
jenkins::slave::ui_pass: 'admin'

And i have :

Debug: Executing: '/usr/bin/systemctl is-active jenkins-slave'
Debug: Executing: '/usr/bin/systemctl is-enabled jenkins-slave'
Debug: Executing: '/usr/bin/systemctl unmask jenkins-slave'
Debug: Runing journalctl command to get logs for systemd start failure: journalctl -n 50 --since '5 minutes ago' -u jenkins-slave --no-pager
Debug: Executing: 'journalctl -n 50 --since '5 minutes ago' -u jenkins-slave --no-pager'
Error: Systemd start for jenkins-slave failed!
journalctl log for jenkins-slave:
-- No entries --

Error: /Stage[main]/Jenkins::Slave/Service[jenkins-slave]/ensure: change from stopped to running failed: Systemd start for jenkins-slave failed!
journalctl log for jenkins-slave:
-- No entries --

If i use the command service -

[root@jenkins-slave0 vagrant]# service jenkins-slave status
Jenkins Slave status:
Unit jenkins-slave.service could not be found.
[root@jenkins-slave0 vagrant]# systemctl status jenkins-slave 
Unit jenkins-slave.service could not be found.
[root@jenkins-slave0 vagrant]# systemctl start jenkins-slave 
Failed to start jenkins-slave.service: Unit not found.
[root@jenkins-slave0 vagrant]# service jenkins-slave start
Reloading systemd:                                         [  OK  ]
Starting jenkins-slave (via systemctl):                    [  OK  ]
[root@jenkins-slave0 vagrant]# systemctl status jenkins-slave 
● jenkins-slave.service - SYSV: Jenkins Slave Swarm Client
   Loaded: loaded (/etc/rc.d/init.d/jenkins-slave; bad; vendor preset: disabled)
   Active: active (exited) since Ср 2017-06-14 11:39:18 UTC; 4s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 5296 ExecStart=/etc/rc.d/init.d/jenkins-slave start (code=exited, status=0/SUCCESS)

jenkins-slave0.vagrant.tld systemd[1]: Starting SYSV: Jenkins Slave Swarm Cli.....
jenkins-slave0.vagrant.tld jenkins-slave[5296]: Starting Jenkins Slave...
jenkins-slave0.vagrant.tld systemd[1]: Started SYSV: Jenkins Slave Swarm Client.
Hint: Some lines were ellipsized, use -l to show in full.
@Protopopys
Copy link
Author

The problem is solved if we - systemctl daemon-reload

[root@jenkins-slave0 vagrant]# systemctl start jenkins-slave
Failed to start jenkins-slave.service: Unit not found.
[root@jenkins-slave0 vagrant]# systemctl daemon-reload
[root@jenkins-slave0 vagrant]# systemctl start jenkins-slave
[root@jenkins-slave0 vagrant]# systemctl status jenkins-slave
● jenkins-slave.service - SYSV: Jenkins Slave Swarm Client
   Loaded: loaded (/etc/rc.d/init.d/jenkins-slave; bad; vendor preset: disabled)
   Active: active (exited) since Чт 2017-06-15 07:35:51 UTC; 10s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 5105 ExecStart=/etc/rc.d/init.d/jenkins-slave start (code=exited, status=0/SUCCESS)

июн 15 07:35:51 jenkins-slave0.vagrant.tld systemd[1]: Starting SYSV: Jenkins Slave Swarm C.....
июн 15 07:35:51 jenkins-slave0.vagrant.tld jenkins-slave[5105]: Starting Jenkins Slave...
июн 15 07:35:51 jenkins-slave0.vagrant.tld systemd[1]: Started SYSV: Jenkins Slave Swarm Client.
Hint: Some lines were ellipsized, use -l to show in full.

@Protopopys
Copy link
Author

I solved the problem.
Change from mod 'rtyler-jenkins', '1.7.0'
to mod 'puppet-jenkins', :git => 'https://github.com/jenkinsci/puppet-jenkins.git'

[root@jenkins-slave0 vagrant]# puppet agent -t
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for jenkins-slave0.vagrant.tld
Info: Applying configuration version '1497528278'
Notice: Base profile is applying to this node
Notice: /Stage[main]/Profile::Base/Notify[Base profile]/message: defined 'message' as 'Base profile is applying to this node'
Notice: Applied catalog in 1.02 seconds
[root@jenkins-slave0 vagrant]# ps aux|grep java
jenkins+  5137  0.4  6.0 2126548 30480 ?       Sl   12:02   0:00 /usr/bin/java -jar /home/jenkins-slave/swarm-client-2.2-jar-with-dependencies.jar -mode normal -executors 2 -username admin -passwordEnvVariable JENKINS_PASSWORD -master http://jenkins-master0.vagrant.tld -fsroot /home/jenkins-slave
root      5300  0.0  0.1 112648   976 pts/0    R+   12:05   0:00 grep --color=auto java
[root@jenkins-slave0 vagrant]# 

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant