New process w/o current parent?
I have a web server and I want it to play a sound when someone posts a query. I figured I could do it with CGI, so using a small proggy named wavplay (plays a wave file on command line) I wrote a bash script to execute it. However, when the script is executed it returns all text properly (including the text outputed by wavplay when working properly) but the sound isn't heard.
I can only assume it's because the script is running in a restricted mode as a child to apache and it's output is limited to stdout. The best solution I can think of is to somehow tell the kernel to execute a new process that would not be a child to httpd, but I dont know how to do this.
Any ideas?
--script:--
#! /bin/bash
#
echo "Content-type: text/html"
echo ""
echo "<html><head><title>Test Page</title></head><body>"
wavplay /var/www/html/demo.wav
echo "<br><br>Sound played.<br>"
echo "</body></html>"
--output:--
Pathname: /var/www/html/demo.wav Sampling Rate: 44100 Hz Mode: Stereo Samples: 486339 Bits: 16
Sound played.
(what it should be)
|