LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 02-11-2016, 11:11 PM   #1
sr_25
Member
 
Registered: Nov 2005
Location: Colorado
Posts: 124

Rep: Reputation: 15
Trying to get Motion daemon to beep.


I have motion up and running on an old headless Pentium III-500 Mhz with Debian 8.3.

I am using the on_movie_start option which runs a script that simply tries to play a bel sound when motion is detected. This works while running as root but fails as a daemon.
Here is the simple script:
Code:
#!/bin/bash
# on_movie_end-cam1.sh
# 2016-01-28

PATH=/usr/sbin:/usr/bin:/sbin:/bin

Output=$(date '+%b %e %_R:%S ') 
Output+="on_movie_start-cam1.sh "
Output+="BEEP?"
echo "$Output" >> /var/log/motion.log

# on_movie_start then beep.
/bin/echo -ne "\007"
/usr/bin/tput bel > /dev/console
exit
How do I fix this so I get the beep when motion is run as a daemon?
Thanks.

Last edited by sr_25; 02-11-2016 at 11:16 PM. Reason: more info: I should note that the script does execute and the $Output variable is written to the log, but no 'bel'!
 
Old 02-11-2016, 11:23 PM   #2
sr_25
Member
 
Registered: Nov 2005
Location: Colorado
Posts: 124

Original Poster
Rep: Reputation: 15
I tried adding motion to the audio group, but still no audible 'bel' is played when motion is run as a deamon.
Code:
groups motion
motion : motion audio www-data video
 
Old 02-12-2016, 07:00 AM   #3
af7567
Member
 
Registered: Nov 2012
Posts: 204

Rep: Reputation: 67
The audio group isn't really anything to do with the terminal beep. Motion would probably need write access to /dev/console for that tput line to work. I don't know how you could do that without changing the permissions on /dev/console to allow write access from the motion group.

Does the PC have a soundcard with an internal speaker maybe? You could then use the aplay command to play and audio file instead of sending stuff to the console.
 
Old 02-12-2016, 10:14 PM   #4
sr_25
Member
 
Registered: Nov 2005
Location: Colorado
Posts: 124

Original Poster
Rep: Reputation: 15
Yes it has a sound card. I was just trying to do it without installing anything else, but I guess I'll just go that route.

Thanks.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Cities In Motion & Cities In Motion 2 Released For Linux On Steam LXer Syndicated Linux News 0 01-09-2014 09:32 PM
motion daemon not able to send email (debian) NozeDive Linux - Software 3 04-12-2013 01:18 AM
Motion help please (Motion only supports mmap) ?? RaeMarvin Linux - Software 4 09-06-2012 01:25 PM
Flash Videos beep-beep-beep Audio Quantumstate Linux - Desktop 1 07-24-2011 09:57 AM
beep, beep ... waring on java code thuan1975 Linux - Software 0 01-24-2011 02:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 12:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration