Skip to content

Service fails to start on some fresh Ubuntu 14 installs due to symlink conflict #20

@willneumob

Description

@willneumob
Recipe: modules::config
  * apt_package[kmod] action install (up to date)
  * directory[/etc/modules-load.d] action create (up to date)
  * cookbook_file[/etc/modules-load.d/header] action create (up to date)
  * cookbook_file[/etc/init/modules-load.conf] action create (up to date)
  * service[kmod] action nothing (skipped due to action :nothing)
  * service[modules-load] action enable (up to date)
  * service[modules-load] action start

    ================================================================================
    Error executing action `start` on resource 'service[modules-load]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of /sbin/start modules-load ----
    STDOUT:
    STDERR: start: Job failed to start
    ---- End output of /sbin/start modules-load ----
    Ran /sbin/start modules-load returned 1

    Cookbook Trace:
    ---------------
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:78:in `run_action'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block (2 levels) in converge'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `each'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:106:in `block in converge'
    /var/chef/cache/cookbooks/compat_resource/files/lib/chef_compat/monkeypatches/chef/runner.rb:105:in `converge'

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/modules/recipes/config.rb

     56:   service "modules-load" do
     57:     provider Chef::Provider::Service::Upstart
     58:     action [:enable, :start]
     59:     notifies :start, "service[kmod]"
     60:   end
     61: else

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/modules/recipes/config.rb:56:in `from_file'

    service("modules-load") do
      provider Chef::Provider::Service::Upstart
      action [:enable, :start]
      supports {:restart=>false, :reload=>false, :status=>false}
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      service_name "modules-load"
      enabled true
      pattern "modules-load"
      declared_type :service
      cookbook_name "modules"
      recipe_name "config"
    end

If I look at the upstart log, I see:

root@mysystem:~# cat /var/log/upstart/modules-load.log
cat: /etc/modules-load.d/modules.conf: input file is output file
cat: /etc/modules-load.d/modules.conf: input file is output file
cat: /etc/modules-load.d/modules.conf: input file is output file
cat: /etc/modules-load.d/modules.conf: input file is output file
cat: /etc/modules-load.d/modules.conf: input file is output file
cat: /etc/modules-load.d/modules.conf: input file is output file
cat: /etc/modules-load.d/modules.conf: input file is output file

and no other errors.

Looking closer reveals that:

root@mysystem:~# ls -laR /etc/modules*
-rw-r--r-- 1 root root  288 Dec 10 19:48 /etc/modules

/etc/modules-load.d:
total 12
drw-r--r--  2 root root 4096 Dec 10 19:48 .
drwxr-xr-x 85 root root 4096 Dec 10 19:48 ..
-rw-r--r--  1 root root  288 Dec 10 19:31 header
lrwxrwxrwx  1 root root   10 Nov 10 20:14 modules.conf -> ../modules
root@mysystem:~#

It appears that systemd installs this:

root@mysystem:~# dpkg -S /etc/modules-load.d/modules.conf
systemd: /etc/modules-load.d/modules.conf

This is version 0.2.0 (latest) from the Chef cookbook site.

Note that while upstart is the init system, systemd also comes installed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions