Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Do not use dpkg_autostart for preventing Jenkins post install autostart #594

Open
stuszynski opened this issue Apr 11, 2017 · 2 comments
Open

Comments

@stuszynski
Copy link

stuszynski commented Apr 11, 2017

Hi. I know it's a bit overkill but we step into the following issue a couple of days ago:

Cookbook version

5.0

Chef-client version

Chef: 12.17.44

Platform Details

Ubuntu 16.04.2 LTS

Scenario:

Current version of Jenkins cookbook is using a dpkg_autostart cookbook that, in fact, creates a /usr/sbin/policy-rc.d which breaks a default configuration of logrotate producing output to STDERR and makes cron ti send to us an alert each night when a postrotate occur (e.g. rsyslog )

The dpkg_autostart cookbook wasn't updated for about 2 years. I'm not sure if it still compatible with e.g. Ubuntu 16.04

Steps to Reproduce:

After installation from packages on ubuntu 16.04:

root@test:~# invoke-rc.d rsyslog rotate > /dev/null
invoke-rc.d: action rotate is unknown, but proceeding anyway.

Expected Result:

Find another way to prevent Jenkins to autostart after installation or manually control /usr/sbin/policy-rc.d file with compatibility for Ubuntu 16.04.

@StephenKing
Copy link
Contributor

Same here on Debian 8. This was added by @cheeseplus in commit: 36df55f.

It's not clear to me from the commit message, what the actual issue was. I assume this avoids Jenkins starting up without our config / an additional restart of the service[jenkins]. Could this work also without dpkg_autostart? The template[/etc/default/jenkins] triggers an immediate restart.

@npmeyer
Copy link

npmeyer commented May 22, 2020

The dkpg_autostart cookbook is broken on Chef 16, which in turn makes this one unusable on Chef 16 as well:

================================================================================
Recipe Compile Error in /opt/kitchen/cache/cookbooks/omnibus/recipes/default.rb
================================================================================

NoMethodError
-------------
undefined method `dpkg_autostart' for cookbook: jenkins, recipe: _master_package :Chef::Recipe

Cookbook Trace:
---------------
  /opt/kitchen/cache/cookbooks/jenkins/recipes/_master_package.rb:35:in `from_file'
  /opt/kitchen/cache/cookbooks/jenkins/recipes/master.rb:31:in `from_file'
  /opt/kitchen/cache/cookbooks/omnibus/recipes/default.rb:51:in `from_file'

Relevant File Content:
----------------------
/opt/kitchen/cache/cookbooks/jenkins/recipes/_master_package.rb:

 28:    apt_repository 'jenkins' do
 29:      uri          node['jenkins']['master']['repository']
 30:      distribution 'binary/'
 31:      key          node['jenkins']['master']['repository_key']
 32:      keyserver    node['jenkins']['master']['repository_keyserver'] unless node['jenkins']['master']['repository_keyserver'].nil?
 33:    end
 34:
 35>>   dpkg_autostart 'jenkins' do
 36:      allow false
 37:    end
 38:  when 'rhel', 'amazon'
 39:    yum_repository 'jenkins-ci' do
 40:      baseurl node['jenkins']['master']['repository']
 41:      gpgkey  node['jenkins']['master']['repository_key']
 42:    end
 43:  end
 44:

System Info:
------------
chef_version=16.1.0
platform=ubuntu
platform_version=18.04
ruby=ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]
program_name=/opt/chef/bin/chef-client
executable=/opt/chef/bin/chef-client

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

No branches or pull requests

5 participants