{"action":"created","issue":{"url":"https://api.github.com/repos/edestecd/puppet-clamav/issues/6","labels_url":"https://api.github.com/repos/edestecd/puppet-clamav/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/edestecd/puppet-clamav/issues/6/comments","events_url":"https://api.github.com/repos/edestecd/puppet-clamav/issues/6/events","html_url":"https://github.com/edestecd/puppet-clamav/issues/6","id":65432358,"number":6,"title":"Changing uid while process is clamav-daemon is already running","user":{"login":"wojciej1","id":3244472,"avatar_url":"https://avatars.githubusercontent.com/u/3244472?v=3","gravatar_id":"","url":"https://api.github.com/users/wojciej1","html_url":"https://github.com/wojciej1","followers_url":"https://api.github.com/users/wojciej1/followers","following_url":"https://api.github.com/users/wojciej1/following{/other_user}","gists_url":"https://api.github.com/users/wojciej1/gists{/gist_id}","starred_url":"https://api.github.com/users/wojciej1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wojciej1/subscriptions","organizations_url":"https://api.github.com/users/wojciej1/orgs","repos_url":"https://api.github.com/users/wojciej1/repos","events_url":"https://api.github.com/users/wojciej1/events{/privacy}","received_events_url":"https://api.github.com/users/wojciej1/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/edestecd/puppet-clamav/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/edestecd/puppet-clamav/labels/needs%20more%20info","name":"needs more info","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-03-31T11:41:00Z","updated_at":"2015-04-01T12:16:44Z","closed_at":null,"body":"Hi,\r\nI have notice the following issue while applying the puppet-clamav\r\n\r\nError: Could not set uid on user[clamav]: Execution of '/usr/sbin/usermod -u 496 clamav' returned 8: usermod: user clamav is currently used by process 13666\r\n\r\nError: /Stage[main]/Clamav::User/User[clamav]/uid: change from 114 to 496 failed: Could not set uid on user[clamav]: Execution of '/usr/sbin/usermod -u 496 clamav' returned 8: usermod: user clamav is currently used by process 13666\r\n\r\nDebug: Class[Clamav::User]: The container Stage[main] will propagate my refresh event\r\nNotice: /Stage[main]/Clamav/Package[clamav]: Dependency User[clamav] has failures: true\r\nWarning: /Stage[main]/Clamav/Package[clamav]: Skipping because of failed dependencies\r\n\r\nFrom my perspective it looks like puppet firstly start the daemon and then tries to change privileges on the user.\r\nI have workaround this by not installing clamav::clamd class  ( cause I do not need it anyway)\r\n\r\nversion: OS\r\nDistributor ID: Ubuntu\r\nDescription:    Ubuntu 14.04.1 LTS\r\nRelease:        14.04\r\nCodename:       trusty\r\n\r\nVersion puppet:\r\nVersion: 3.4.3-1ubuntu1\r\n\r\n\r\n\r\nHowever I just wanted you to know.\r\nThanks for a good job.\r\n\r\nRegards\r\nJaroslaw Wojciechowski\r\n"},"comment":{"url":"https://api.github.com/repos/edestecd/puppet-clamav/issues/comments/88455637","html_url":"https://github.com/edestecd/puppet-clamav/issues/6#issuecomment-88455637","issue_url":"https://api.github.com/repos/edestecd/puppet-clamav/issues/6","id":88455637,"user":{"login":"edestecd","id":107281,"avatar_url":"https://avatars.githubusercontent.com/u/107281?v=3","gravatar_id":"","url":"https://api.github.com/users/edestecd","html_url":"https://github.com/edestecd","followers_url":"https://api.github.com/users/edestecd/followers","following_url":"https://api.github.com/users/edestecd/following{/other_user}","gists_url":"https://api.github.com/users/edestecd/gists{/gist_id}","starred_url":"https://api.github.com/users/edestecd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edestecd/subscriptions","organizations_url":"https://api.github.com/users/edestecd/orgs","repos_url":"https://api.github.com/users/edestecd/repos","events_url":"https://api.github.com/users/edestecd/events{/privacy}","received_events_url":"https://api.github.com/users/edestecd/received_events","type":"User","site_admin":false},"created_at":"2015-04-01T12:16:44Z","updated_at":"2015-04-01T12:16:44Z","body":"OK, now I can see why you are having both of your issues.\r\n\r\n* ```Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration:```\r\nThis error is caused by including both the main clamav class and those subclasses.\r\nThe main clamav class already includes the subclasses for you.  Have a look here: [clamav](https://github.com/edestecd/puppet-clamav/blob/master/manifests/init.pp)  So, you can't do both.  \r\nEither:  \r\nonly include the main clamav class (preferred)  \r\nOR  \r\nonly include the subclasses\r\n* ```Error: /Stage[main]/Clamav::User/User[clamav]/uid: change from 114 to 496 failed: Could not set uid on user[clamav]:```  This error is caused by including the subclasses, instead of using the main clamav class.  The main clamav class makes the other classes require the clamav::user class to solve this problem for you.  That is why it is preferred to just use the main class only.  As far as I know, there is no way in Foreman to add require or before dependencies on class.\r\n\r\n\r\nI recommend you remove the subclasses and pass all your params through the main clamav class.\r\nYou can override/set the params in Foreman by going here:\r\nConfigure -> Puppet classes -> search clamav -> Smart Class Parameter Tab\r\nChange these here to include the classes...  \r\nmanage clamd\r\nmanage freshclam\r\nmanage user\r\n\r\n![screen shot 2015-04-01 at 8 13 42 am](https://cloud.githubusercontent.com/assets/107281/6940676/2ad4a9f6-d847-11e4-914f-8ff47dc56d63.png)\r\n\r\n"}}