Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

failing on linux_user #479

Open
danhiris opened this issue Jul 5, 2017 · 0 comments
Open

failing on linux_user #479

danhiris opened this issue Jul 5, 2017 · 0 comments
Labels

Comments

@danhiris
Copy link

danhiris commented Jul 5, 2017

This linux_user resource is getting called by the instance recipe and it's failing due to the directory already being there.
After running this again, it worked because the directory of the user was changed but the problem is due to not being able to move the user's home contents over to an already existing directory.
Is the -m option in conjunction with -d really necessary?

  • logstash_instance[logstash] action create (up to date)
    • directory[/opt/logstash/logstash] action delete (up to date)

    • linux_user[logstash] action create

      ================================================================================
      Error executing action create on resource 'linux_user[logstash]'

      Mixlib::ShellOut::ShellCommandFailed

      Expected process to exit with [0], but received '12'
      ---- Begin output of ["usermod", "-d", "/var/lib/logstash", "-m", "logstash"] ----
      STDOUT:
      STDERR: usermod: directory /var/lib/logstash exists
      ---- End output of ["usermod", "-d", "/var/lib/logstash", "-m", "logstash"] ----
      Ran ["usermod", "-d", "/var/lib/logstash", "-m", "logstash"] returned 12

      Resource Declaration:

      In /var/chef/cache/cookbooks/logstash/providers/instance.rb

      79: ur = user ls[:user] do
      80: home ls[:homedir]
      81: system true
      82: action :create
      83: manage_home true
      84: uid ls[:uid]
      85: end
      86: new_resource.updated_by_last_action(ur.updated_by_last_action?)

      Compiled Resource:

      Declared in /var/chef/cache/cookbooks/logstash/providers/instance.rb:79:in `block in class_from_file'

      linux_user("logstash") do
      action [:create]
      supports {:manage_home=>false, :non_unique=>false}
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      username "logstash"
      uid nil
      gid nil
      home "/var/lib/logstash"
      system true
      manage_home true
      iterations 27855
      declared_type :user
      cookbook_name "usf_mw_logstash"
      end

      Platform:

      x86_64-linux

@martinb3 martinb3 added the bug label Jul 6, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants