Jack Elliott
2023-Sep-17 17:41 UTC
[Icecast] Edited: <on-connect> / <on-disconnect> not working
Hi Jordan, Here is my script: #!/bin/bash #thatjackelliott at kpov.org printf "To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nSubject: Remote host has connected to mountpoint $1 on the Backstream\n\n KPOV Icecast server on IcecastPi has detected a connection on the backstream." > /home/my_username/bin/on_connect.txt /usr/bin/msmtpthatjackelliott at kpov.org < /home/my_username/bin/on_connect.txt >/home/my_username/bin/msmtp.log 2>&1 This script has rwx set for everyone (for debugging). Thank you! -- Jack Elliott Director of Classical Music Programming High Desert Community Radio KPOV Bend, Oregon On 9/17/23 8:25 AM, Jordan Erickson wrote:> Hi Jack, > > You said: > > --- > Okay now that I am user icecast2, let me see if the script I want the > Icecast server to run <on-connect> runs, so . . . > icecast2 at icecast-Pi: $ ./email_onconnect.sh > > and the prompt returns immediately, no error message, but no email > received. But if I su back to my_username and try the script, it runs > and an email is received. > > --- > > This tells me that your script is not doing what it needs to do as the > Icecast user. Since you're doing it outside of Icecast, it's not the > <on-connect> or <on-disconnect> triggers that are failing. It would be > helpful if you could paste your script (sensitive info like passwords > removed) here. > > > Cheers, > Jordan > https://subj.am/ > > On 9/17/23 07:08, Jack Elliott wrote: >> >> Hi, I posted yesterday that I was following this thread, and a nice >> listmember offered some suggestions to debug it. I replied directly >> to him, taking the thread off the list. This was not my intention, >> I'm bringing it back to the list to seek additional help because this >> issue has not been resolved. >> >> So, summary: >> >> The OS is Linux. >> >> Issue: <on-connect> / <on-disconnect> does not launch a bash script >> that sends notification emails. >> >> The script is located in /home/my_username/bin >> >> The script runs from command line and sends the email with me as >> user. So the script is coded right. But icecast does not launch the >> script. >> >> I have given rwx permission to everyone from / down to and including >> the script itself for debugging. >> >> Here is the code I have in the mount definition in icecast.xml: >> >> <on-connect>/home/my_username/bin/email_onconnect.sh</on-connect> >> <on-disconnect>/home/my_username/bin/email_ondisconnect.sh</on-disconnect> >> >> It is intended to run when a remote source client connects. The >> mountpoint works fine, our remote hosts routinely use it to stream >> their radio shows to the station to be put on the air. >> >> So. Is it possible that by having a fallback-mount (a local mp3) in >> the mountpoint "blocks" <on-connect>? IOW, because there is always a >> source client connected?either the fallback or a remote source >> client?that there is no connecting event to trigger the command? >> >> Thank you! >> >> -- >> Jack Elliott >> Director of Classical Music Programming >> High Desert Community Radio >> KPOV Bend, Oregon >> >> _______________________________________________ >> Icecast mailing list >> Icecast at xiph.org >> http://lists.xiph.org/mailman/listinfo/icecast > > > _______________________________________________ > Icecast mailing list > Icecast at xiph.org > http://lists.xiph.org/mailman/listinfo/icecast-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/icecast/attachments/20230917/672abcab/attachment.htm>
Thomas Zumbrunnen
2023-Sep-17 17:49 UTC
[Icecast] Edited: <on-connect> / <on-disconnect> not working
Hi For debuging purpose put set?-x in the row?after?#!/bin/bash and execute the script. Post the whole output here. Cheers Tom Am 17. Sept. 2023, 19:42 +0200 schrieb Jack Elliott <that.jack.elliott at gmail.com>:> Hi Jordan, > Here is my script: > #!/bin/bash > > # thatjackelliott at kpov.org > > printf "To: thatjackelliott at kpov.org\nFrom: kpovcomputer at gmail.com\nSubject: Remote host has connected to mountpoint $1 on the Backstream\n\n KPOV Icecast server on IcecastPi has detected a connection on the backstream." > /home/my_username/bin/on_connect.txt > /usr/bin/msmtp thatjackelliott at kpov.org < /home/my_username/bin/on_connect.txt >/home/my_username/bin/msmtp.log 2>&1 > This script has rwx set for everyone (for debugging). > Thank you! > -- > Jack Elliott > Director of Classical Music Programming > High Desert Community Radio > KPOV Bend, Oregon > On 9/17/23 8:25 AM, Jordan Erickson wrote: > > Hi Jack, > > > > You said: > > > > --- > > Okay now that I am user icecast2, let me see if the script I want the Icecast server to run <on-connect> runs, so . . . > > icecast2 at icecast-Pi: $ ./email_onconnect.sh > > and the prompt returns immediately, no error message, but no email received. But if I su back to my_username and try the script, it runs and an email is received. > > --- > > > > This tells me that your script is not doing what it needs to do as the Icecast user. Since you're doing it outside of Icecast, it's not the <on-connect> or <on-disconnect> triggers that are failing. It would be helpful if you could paste your script (sensitive info like passwords removed) here. > > > > > > Cheers, > > Jordan > > https://subj.am/ > > > > On 9/17/23 07:08, Jack Elliott wrote: > > > Hi, I posted yesterday that I was following this thread, and a nice listmember offered some suggestions to debug it. I replied directly to him, taking the thread off the list. This was not my intention, I'm bringing it back to the list to seek additional help because this issue has not been resolved. > > > So, summary: > > > The OS is Linux. > > > Issue: <on-connect> / <on-disconnect> does not launch a bash script that sends notification emails. > > > The script is located in /home/my_username/bin > > > The script runs from command line and sends the email with me as user. So the script is coded right. But icecast does not launch the script. > > > I have given rwx permission to everyone from / down to and including the script itself for debugging. > > > Here is the code I have in the mount definition in icecast.xml: > > > <on-connect>/home/my_username/bin/email_onconnect.sh</on-connect> > > > <on-disconnect>/home/my_username/bin/email_ondisconnect.sh</on-disconnect> > > > It is intended to run when a remote source client connects. The mountpoint works fine, our remote hosts routinely use it to stream their radio shows to the station to be put on the air. > > > So. Is it possible that by having a fallback-mount (a local mp3) in the mountpoint "blocks" <on-connect>? IOW, because there is always a source client connected?either the fallback or a remote source client?that there is no connecting event to trigger the command? > > > Thank you! > > > -- > > > Jack Elliott > > > Director of Classical Music Programming > > > High Desert Community Radio > > > KPOV Bend, Oregon > > > > > > _______________________________________________ > > > Icecast mailing list > > > Icecast at xiph.org > > > http://lists.xiph.org/mailman/listinfo/icecast > > > > > > _______________________________________________ > > Icecast mailing list > > Icecast at xiph.org > > http://lists.xiph.org/mailman/listinfo/icecast > _______________________________________________ > Icecast mailing list > Icecast at xiph.org > http://lists.xiph.org/mailman/listinfo/icecast-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/icecast/attachments/20230917/bc130b7f/attachment.htm>