{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/2081","labels_url":"https://api.github.com/repos/ansible/ansible/issues/2081/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/2081/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/2081/events","html_url":"https://github.com/ansible/ansible/issues/2081","id":10982409,"number":2081,"title":"Daemon invoking script fails when run through ansible","user":{"login":"willthames","id":391807,"avatar_url":"https://avatars.githubusercontent.com/u/391807?v=3","gravatar_id":"","url":"https://api.github.com/users/willthames","html_url":"https://github.com/willthames","followers_url":"https://api.github.com/users/willthames/followers","following_url":"https://api.github.com/users/willthames/following{/other_user}","gists_url":"https://api.github.com/users/willthames/gists{/gist_id}","starred_url":"https://api.github.com/users/willthames/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willthames/subscriptions","organizations_url":"https://api.github.com/users/willthames/orgs","repos_url":"https://api.github.com/users/willthames/repos","events_url":"https://api.github.com/users/willthames/events{/privacy}","received_events_url":"https://api.github.com/users/willthames/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2013-02-14T03:02:07Z","updated_at":"2015-08-13T08:17:00Z","closed_at":"2013-02-14T03:20:02Z","body":"Ideally I'd have more diagnostics than I do, and I can probably engage support to assist if I know what to ask. The user I'm trying to run the tasks as has very limited sudo privileges, hence running sudo from the action, rather than use sudo_user. \r\n\r\nBasically the following doesn't work (the command executes, the script runs, but then the process kicked off by the script immediately dies)\r\n\r\n`action: command sudo -u tomcatuser /path/to/tomcat/start/script`\r\n\r\nUsing raw or shell modules doesn't make any appreciable difference. \r\n\r\nHowever, all of the following methods do work as expected. \r\n\r\n* on the server\r\n`sudo -u tomcatuser /path/to/tomcat/start/script`\r\n`python ./ansible/tmp/ansible-lots-of-numbers-here/command`\r\n\r\n* local command line\r\n`ssh user@server sudo -u tomcatuser /path/to/tomcat/start/script`\r\n\r\n* local ansible task\r\n`local_action: command ssh user@server sudo -u tomcatuser /path/to/tomcat/start/script`\r\n\r\n\r\nWhile I appreciate this is an interaction between the start script and ansible, I'd be interested if anyone had any insight as to what the difference between running the task through ansible and running it remotely, and whether there are any other tests I can perform without needing to be able to run the command via strace or similar. "},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/130571717","html_url":"https://github.com/ansible/ansible/issues/2081#issuecomment-130571717","issue_url":"https://api.github.com/repos/ansible/ansible/issues/2081","id":130571717,"user":{"login":"junneyang","id":6802322,"avatar_url":"https://avatars.githubusercontent.com/u/6802322?v=3","gravatar_id":"","url":"https://api.github.com/users/junneyang","html_url":"https://github.com/junneyang","followers_url":"https://api.github.com/users/junneyang/followers","following_url":"https://api.github.com/users/junneyang/following{/other_user}","gists_url":"https://api.github.com/users/junneyang/gists{/gist_id}","starred_url":"https://api.github.com/users/junneyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/junneyang/subscriptions","organizations_url":"https://api.github.com/users/junneyang/orgs","repos_url":"https://api.github.com/users/junneyang/repos","events_url":"https://api.github.com/users/junneyang/events{/privacy}","received_events_url":"https://api.github.com/users/junneyang/received_events","type":"User","site_admin":false},"created_at":"2015-08-13T08:17:00Z","updated_at":"2015-08-13T08:17:00Z","body":"ansible's 'script' module\r\nhow to daemonize a cmomand?"}}