{"action":"created","issue":{"url":"https://api.github.com/repos/Motion-Project/motion/issues/361","repository_url":"https://api.github.com/repos/Motion-Project/motion","labels_url":"https://api.github.com/repos/Motion-Project/motion/issues/361/labels{/name}","comments_url":"https://api.github.com/repos/Motion-Project/motion/issues/361/comments","events_url":"https://api.github.com/repos/Motion-Project/motion/issues/361/events","html_url":"https://github.com/Motion-Project/motion/issues/361","id":216554251,"number":361,"title":"problem with on_event_start and arecord","user":{"login":"Jo-Pitts","id":24887282,"avatar_url":"https://avatars3.githubusercontent.com/u/24887282?v=3","gravatar_id":"","url":"https://api.github.com/users/Jo-Pitts","html_url":"https://github.com/Jo-Pitts","followers_url":"https://api.github.com/users/Jo-Pitts/followers","following_url":"https://api.github.com/users/Jo-Pitts/following{/other_user}","gists_url":"https://api.github.com/users/Jo-Pitts/gists{/gist_id}","starred_url":"https://api.github.com/users/Jo-Pitts/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jo-Pitts/subscriptions","organizations_url":"https://api.github.com/users/Jo-Pitts/orgs","repos_url":"https://api.github.com/users/Jo-Pitts/repos","events_url":"https://api.github.com/users/Jo-Pitts/events{/privacy}","received_events_url":"https://api.github.com/users/Jo-Pitts/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-03-23T19:59:31Z","updated_at":"2017-04-05T04:41:51Z","closed_at":null,"body":"All,\r\nfirstly - I'm not sure if this is the right place for this.\r\nsecondly - I'm no linux expert (by a million miles!)\r\n\r\nI have the following line in my /etc/motion/motion.conf file\r\n`on_event_start sh /media/motion/onevent`\r\n\r\nthe onevent script has the following in it\r\n```\r\n#!/bin/sh\r\nnow=$(date)\r\n\r\necho \"$now - starting recording\"\r\narecord -D plughw:1,0 -f cd /media/motion/bob.wav\r\n\r\nnow=$(date)\r\necho \"$now - ending recording\"\r\n```\r\n\r\nI know that the onevent script is getting run (I tried it with a simple file copy command - which worked).\r\n\r\nHowever, nothing happens with the arecord command when called from on_event_start.  However, if I run the script from the shell (i.e. sudo sh onevent), the recording does work.\r\n\r\nI have chowned the /media/motion folder to the motion user.\r\n\r\nI know that I need to change the arecord parameters to have a date/time stamped file name.  I'm just making this as simple as possible for now to get things working.\r\n\r\nRegards\r\nJo\r\n"},"comment":{"url":"https://api.github.com/repos/Motion-Project/motion/issues/comments/291752478","html_url":"https://github.com/Motion-Project/motion/issues/361#issuecomment-291752478","issue_url":"https://api.github.com/repos/Motion-Project/motion/issues/361","id":291752478,"user":{"login":"Whytey","id":876620,"avatar_url":"https://avatars3.githubusercontent.com/u/876620?v=3","gravatar_id":"","url":"https://api.github.com/users/Whytey","html_url":"https://github.com/Whytey","followers_url":"https://api.github.com/users/Whytey/followers","following_url":"https://api.github.com/users/Whytey/following{/other_user}","gists_url":"https://api.github.com/users/Whytey/gists{/gist_id}","starred_url":"https://api.github.com/users/Whytey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Whytey/subscriptions","organizations_url":"https://api.github.com/users/Whytey/orgs","repos_url":"https://api.github.com/users/Whytey/repos","events_url":"https://api.github.com/users/Whytey/events{/privacy}","received_events_url":"https://api.github.com/users/Whytey/received_events","type":"User","site_admin":false},"created_at":"2017-04-05T04:41:50Z","updated_at":"2017-04-05T04:41:50Z","body":"Adding the user to the Sudo group isn't enough. It needs to be able to run\nthe killall command without needing to authenticate.  This is done through\nediting the sudoers file.\n\nI think ;-)\n\nOn Wed., 5 Apr. 2017, 2:19 pm Daniel Richard G., <notifications@github.com>\nwrote:\n\n> Is there a need to fork the command with &? I would do\n>\n> sudo killall arecord >/home/motion/log 2>&1\n>\n> —\n> You are receiving this because you are subscribed to this thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/Motion-Project/motion/issues/361#issuecomment-291749910>,\n> or mute the thread\n> <https://github.com/notifications/unsubscribe-auth/AA1gTN-Rf7wEQGda0cg8Q58HyRwoLw6oks5rsxZYgaJpZM4MnSVi>\n> .\n>\n"}}
{"actor":{"display_login":"Whytey"}}