{"action":"created","issue":{"url":"https://api.github.com/repos/poise/poise-monit/issues/14","repository_url":"https://api.github.com/repos/poise/poise-monit","labels_url":"https://api.github.com/repos/poise/poise-monit/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/poise/poise-monit/issues/14/comments","events_url":"https://api.github.com/repos/poise/poise-monit/issues/14/events","html_url":"https://github.com/poise/poise-monit/issues/14","id":145747332,"number":14,"title":"Unable to specify uid and gid in check","user":{"login":"precurse","id":2087223,"avatar_url":"https://avatars.githubusercontent.com/u/2087223?v=3","gravatar_id":"","url":"https://api.github.com/users/precurse","html_url":"https://github.com/precurse","followers_url":"https://api.github.com/users/precurse/followers","following_url":"https://api.github.com/users/precurse/following{/other_user}","gists_url":"https://api.github.com/users/precurse/gists{/gist_id}","starred_url":"https://api.github.com/users/precurse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/precurse/subscriptions","organizations_url":"https://api.github.com/users/precurse/orgs","repos_url":"https://api.github.com/users/precurse/repos","events_url":"https://api.github.com/users/precurse/events{/privacy}","received_events_url":"https://api.github.com/users/precurse/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-04-04T17:16:06Z","updated_at":"2016-04-04T17:35:59Z","closed_at":null,"body":"Hello,\r\n\r\nI'm trying to specify a user to run a specific script as since it's better practice to run things with the least necessary privileges.  However, when I try to specify it in the check, the cookbook fails to run.\r\n\r\n\r\nExample that works:\r\n```\r\nmonit_check 'nginx' do\r\n  check \"if does not exist then restart\r\n      if does not exist then exec /etc/monit/slack.rb\"\r\n  start_program '/etc/init.d/nginx start'\r\n  stop_program '/etc/init.d/nginx stop'\r\nend\r\n```\r\n\r\nExample that does not work:\r\n```\r\nmonit_check 'nginx' do\r\n  check \"if does not exist then restart\r\n      if does not exist then exec /etc/monit/slack.rb as uid nobody and gid nobody\"\r\n  start_program '/etc/init.d/nginx start'\r\n  stop_program '/etc/init.d/nginx stop'\r\nend\r\n```\r\n\r\nHowever, according to the Monit documentation, this is a valid check: https://mmonit.com/monit/documentation/monit.html#ACTION\r\n\r\n> \r\n> EXEC can be used to execute an arbitrary program and send an alert. If you choose this action you must state the program to be executed and if the program requires arguments you must enclose the program and its arguments in a quoted string. You may optionally specify the uid and gid the executed program should switch to upon start. The program is by default executed only once, on the state change. You can enable program repetition when the error persists for given number of cycles. For instance:\r\n> \r\n>  if failed <test> then exec \"/usr/local/bin/sms.sh\"\r\n>       as uid nobody and gid nobody\r\n>       repeat every 5 cycles\r\n> \r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/poise/poise-monit/issues/comments/205408415","html_url":"https://github.com/poise/poise-monit/issues/14#issuecomment-205408415","issue_url":"https://api.github.com/repos/poise/poise-monit/issues/14","id":205408415,"user":{"login":"precurse","id":2087223,"avatar_url":"https://avatars.githubusercontent.com/u/2087223?v=3","gravatar_id":"","url":"https://api.github.com/users/precurse","html_url":"https://github.com/precurse","followers_url":"https://api.github.com/users/precurse/followers","following_url":"https://api.github.com/users/precurse/following{/other_user}","gists_url":"https://api.github.com/users/precurse/gists{/gist_id}","starred_url":"https://api.github.com/users/precurse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/precurse/subscriptions","organizations_url":"https://api.github.com/users/precurse/orgs","repos_url":"https://api.github.com/users/precurse/repos","events_url":"https://api.github.com/users/precurse/events{/privacy}","received_events_url":"https://api.github.com/users/precurse/received_events","type":"User","site_admin":false},"created_at":"2016-04-04T17:35:59Z","updated_at":"2016-04-04T17:35:59Z","body":"hah, good call.\r\n\r\n```# /opt/monit-5.16/bin/monit  -t -c /etc/monit/monitrc\r\n/etc/monit/conf.d/nginx.conf:5: Requested group not found on the system 'nobody'```\r\n\r\nThanks!"}}