From that.jack.elliott at gmail.com Sat Sep 16 17:51:40 2023 From: that.jack.elliott at gmail.com (Jack Elliott) Date: Sat, 16 Sep 2023 10:51:40 -0700 Subject: [Icecast] / not working In-Reply-To: References: <0ed1e99b-e780-e4a4-c206-5e03543ba496@kpov.org> Message-ID: Following. I've also not gotten / to launch a script that sends me a notification email. The script is located at /home/my_username/bin The script runs from command line. /home/my_username/bin/email_onconnect.sh /home/my_username/bin/email_ondisconnect.sh It is intended to run when a remote source client connects. Is it possible that by having a fallback-mount (pointing to a local mp3) in the mountpoint "blocks" ? IOW, because there is always a source client connected, either the fallback or a remote source client, 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 On 7/14/22 10:14 PM, Jordan Erickson wrote: > Hi Jack, > > Does the user user actually running the Icecast process have access to > the scripts within the /home/my_username/bin directory? Not sure if > Icecast is running as $my_username from what you've said here. I'm > also not sure if Icecast checks access to each script specified in the > config for access during startup/reload. > > > Cheers, > Jordan > > -- > Jordan Erickson > SubJam, SPC -https://subj.am/ > +1 360.603.5039 > > On 7/14/22 08:16, Jack Elliott wrote: >> >> Hi, >> >> Icecast server 2.4.0 running on Linux. >> >> I have a couple of shell scripts that send emails on connect and on >> disconnect. From the command line they work, but when called from >> icecast they do not. >> >> Here is the mount section of my icecast.xml: >> >> >> ??????? /my_stream >> /fallbacks/my_fallback.mp3 >> ??????? 1 >> 1 >> */home/my_username/bin/email_onconnect.sh** >> **/home/my_username/bin/email_ondisconnect.sh* >> ??????? 1 >> ??? >> >> After putting the new and entries into >> icecast.xml I reloaded the config with /etc/init.d/icecast2 reload >> and there was no error written to /var/log/icecast2/error.log >> >> calls /home/my_username/bin/email_onconnect.sh which >> works from the command line. Likewise, calls a >> similar script which also works from the command line. I've tested them. >> >> The permissions for the two scripts: >> >> -rwxr-xr-x 1 my_username my_username 352 Jul 14 07:49 email_onconnect.sh >> -rwxr-xr-x 1 my_username my_username 375 Jul 14 07:49 >> email_ondisconnect.sh >> >> I'd like to get these functions working . . . ideas? >> >> Thank you! >> >> -- >> Jack Elliott >> Director of Classical Music Programming >> KPOV 88.9 FM >> High Desert Community Radio >> Bend, OR >> >> _______________________________________________ >> 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: From that.jack.elliott at gmail.com Sat Sep 16 17:58:20 2023 From: that.jack.elliott at gmail.com (Jack Elliott) Date: Sat, 16 Sep 2023 10:58:20 -0700 Subject: [Icecast] When switching from source client to fallback and back glitches listen client Message-ID: <6f0081b5-3a20-9db3-56c2-bc95002f6df2@kpov.org> Hi, I've noticed that when a source-client disconnects from the mountpoint and the mountpoint switches to its specified fallback-client, some listen-clients disconnect, or close, or otherwise glitch. Same thing when a remote source-client connects, dropping the fallback--the listen-client can glitch. The fallback is an mp3 encoded at the same sample rate and bitrate as the remote source-client. It shouldn't glitch stream players just because it swaps sources, should it? Thank you! -- Jack Elliott Director of Classical Music Programming High Desert Community Radio KPOV Bend, Oregon From jordan at subj.am Sat Sep 16 18:16:33 2023 From: jordan at subj.am (Jordan Erickson) Date: Sat, 16 Sep 2023 11:16:33 -0700 Subject: [Icecast] / not working In-Reply-To: References: <0ed1e99b-e780-e4a4-c206-5e03543ba496@kpov.org> Message-ID: <38a26244-8d0f-297d-7eb1-11ab3ff9f5bb@subj.am> Hey Jack, Have you tried running the script from the commandline as the user running the Icecast daemon? I.E. 'su - icecast2' and then run the script with the full path? You said on 7/15/22: "The icecast2 process is owned by user icecast2, not the Owner of the target scripts. I changed the permissions for the email scripts to rwx for everyone, but no joy. " This could still mean that the icecast2 user doesn't have access further up in the path (for example, /home/my_username dir itself). Cheers, Jordan Erickson https://subj.am/ On 9/16/23 10:51, Jack Elliott wrote: > > Following. I've also not gotten / to > launch a script that sends me a notification email. The script is > located at /home/my_username/bin > > The script runs from command line. > > /home/my_username/bin/email_onconnect.sh > /home/my_username/bin/email_ondisconnect.sh > > It is intended to run when a remote source client connects. > > Is it possible that by having a fallback-mount (pointing to a local > mp3) in the mountpoint "blocks" ? IOW, because there is > always a source client connected, either the fallback or a remote > source client, 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 > On 7/14/22 10:14 PM, Jordan Erickson wrote: >> Hi Jack, >> >> Does the user user actually running the Icecast process have access >> to the scripts within the /home/my_username/bin directory? Not sure >> if Icecast is running as $my_username from what you've said here. I'm >> also not sure if Icecast checks access to each script specified in >> the config for access during startup/reload. >> >> >> Cheers, >> Jordan >> >> -- >> Jordan Erickson >> SubJam, SPC -https://subj.am/ >> +1 360.603.5039 >> >> On 7/14/22 08:16, Jack Elliott wrote: >>> >>> Hi, >>> >>> Icecast server 2.4.0 running on Linux. >>> >>> I have a couple of shell scripts that send emails on connect and on >>> disconnect. From the command line they work, but when called from >>> icecast they do not. >>> >>> Here is the mount section of my icecast.xml: >>> >>> >>> ??????? /my_stream >>> /fallbacks/my_fallback.mp3 >>> 1 >>> 1 >>> */home/my_username/bin/email_onconnect.sh** >>> **/home/my_username/bin/email_ondisconnect.sh* >>> ??????? 1 >>> ??? >>> >>> After putting the new and entries into >>> icecast.xml I reloaded the config with /etc/init.d/icecast2 reload >>> and there was no error written to /var/log/icecast2/error.log >>> >>> calls /home/my_username/bin/email_onconnect.sh which >>> works from the command line. Likewise, calls a >>> similar script which also works from the command line. I've tested them. >>> >>> The permissions for the two scripts: >>> >>> -rwxr-xr-x 1 my_username my_username 352 Jul 14 07:49 email_onconnect.sh >>> -rwxr-xr-x 1 my_username my_username 375 Jul 14 07:49 >>> email_ondisconnect.sh >>> >>> I'd like to get these functions working . . . ideas? >>> >>> Thank you! >>> >>> -- >>> Jack Elliott >>> Director of Classical Music Programming >>> KPOV 88.9 FM >>> High Desert Community Radio >>> Bend, OR >>> >>> _______________________________________________ >>> 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: From that.jack.elliott at gmail.com Sun Sep 17 14:08:14 2023 From: that.jack.elliott at gmail.com (Jack Elliott) Date: Sun, 17 Sep 2023 07:08:14 -0700 Subject: [Icecast] Edited: / not working In-Reply-To: References: <0ed1e99b-e780-e4a4-c206-5e03543ba496@kpov.org> Message-ID: <68d4dadd-108f-933a-fad2-8b14e30772d7@kpov.org> 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: / 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: /home/my_username/bin/email_onconnect.sh /home/my_username/bin/email_ondisconnect.sh 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" ? 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From jordan at subj.am Sun Sep 17 15:25:48 2023 From: jordan at subj.am (Jordan Erickson) Date: Sun, 17 Sep 2023 08:25:48 -0700 Subject: [Icecast] Edited: / not working In-Reply-To: <68d4dadd-108f-933a-fad2-8b14e30772d7@kpov.org> References: <0ed1e99b-e780-e4a4-c206-5e03543ba496@kpov.org> <68d4dadd-108f-933a-fad2-8b14e30772d7@kpov.org> Message-ID: <60932c58-d542-ed99-a719-8870da6dda65@subj.am> Hi Jack, You said: --- Okay now that I am user icecast2, let me see if the script I want the Icecast server to run 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 or 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: / 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: > > /home/my_username/bin/email_onconnect.sh > /home/my_username/bin/email_ondisconnect.sh > > 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" ? 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From that.jack.elliott at gmail.com Sun Sep 17 17:41:56 2023 From: that.jack.elliott at gmail.com (Jack Elliott) Date: Sun, 17 Sep 2023 10:41:56 -0700 Subject: [Icecast] Edited: / not working In-Reply-To: <60932c58-d542-ed99-a719-8870da6dda65@subj.am> References: <0ed1e99b-e780-e4a4-c206-5e03543ba496@kpov.org> <68d4dadd-108f-933a-fad2-8b14e30772d7@kpov.org> <60932c58-d542-ed99-a719-8870da6dda65@subj.am> Message-ID: <29d0a3d3-1b1d-361f-3f6e-355ad1d73db5@kpov.org> 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 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 > or 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: / 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: >> >> /home/my_username/bin/email_onconnect.sh >> /home/my_username/bin/email_ondisconnect.sh >> >> 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" ? 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: From thomas.zumbrunnen at gmail.com Sun Sep 17 17:49:33 2023 From: thomas.zumbrunnen at gmail.com (Thomas Zumbrunnen) Date: Sun, 17 Sep 2023 19:49:33 +0200 Subject: [Icecast] Edited: / not working In-Reply-To: <29d0a3d3-1b1d-361f-3f6e-355ad1d73db5@kpov.org> References: <0ed1e99b-e780-e4a4-c206-5e03543ba496@kpov.org> <68d4dadd-108f-933a-fad2-8b14e30772d7@kpov.org> <60932c58-d542-ed99-a719-8870da6dda65@subj.am> <29d0a3d3-1b1d-361f-3f6e-355ad1d73db5@kpov.org> Message-ID: <192abebe-ee3a-45f8-af67-257177c9a6b3@Spark> 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 : > 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 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 or 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: / 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: > > > /home/my_username/bin/email_onconnect.sh > > > /home/my_username/bin/email_ondisconnect.sh > > > 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" ? 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: From that.jack.elliott at gmail.com Sun Sep 17 18:17:40 2023 From: that.jack.elliott at gmail.com (Jack Elliott) Date: Sun, 17 Sep 2023 11:17:40 -0700 Subject: [Icecast] Edited: / not working In-Reply-To: <192abebe-ee3a-45f8-af67-257177c9a6b3@Spark> References: <0ed1e99b-e780-e4a4-c206-5e03543ba496@kpov.org> <68d4dadd-108f-933a-fad2-8b14e30772d7@kpov.org> <60932c58-d542-ed99-a719-8870da6dda65@subj.am> <29d0a3d3-1b1d-361f-3f6e-355ad1d73db5@kpov.org> <192abebe-ee3a-45f8-af67-257177c9a6b3@Spark> Message-ID: <07547c28-102b-6cb9-348d-d858c6973f2d@kpov.org> Very cool, I haven't encountered the "set -x" debug flag before. However, the output isn't as interesting as I hoped: icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nSubject: Remote host has connected to mountpoint on the Backstream\n\n KPOV Icecast server on IcecastPi has detected a connection on the backstream.' + /usr/bin/msmtpthatjackelliott at kpov.org icecast2 at Icecast-Pi:/home/kpovdjs/bin$ Thank you! -- Jack Elliott Director of Classical Music Programming High Desert Community Radio KPOV Bend, Oregon On 9/17/23 10:49 AM, Thomas Zumbrunnen wrote: > 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 > : >> >> 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 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 or 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: / 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: >>>> >>>> /home/my_username/bin/email_onconnect.sh >>>> /home/my_username/bin/email_ondisconnect.sh >>>> >>>> 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" ? 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: From fredg at paravelsystems.com Mon Sep 18 15:09:28 2023 From: fredg at paravelsystems.com (Fred Gleason) Date: Mon, 18 Sep 2023 11:09:28 -0400 Subject: [Icecast] When switching from source client to fallback and back glitches listen client In-Reply-To: <6f0081b5-3a20-9db3-56c2-bc95002f6df2@kpov.org> References: <6f0081b5-3a20-9db3-56c2-bc95002f6df2@kpov.org> Message-ID: <6BB29E53-E9AA-4074-A6B3-9E3C2E45BF46@paravelsystems.com> On Sep 16, 2023, at 13:58, Jack Elliott wrote: > I've noticed that when a source-client disconnects from the mountpoint and the mountpoint switches to its specified fallback-client, some listen-clients disconnect, or close, or otherwise glitch. Same thing when a remote source-client connects, dropping the fallback--the listen-client can glitch. > > The fallback is an mp3 encoded at the same sample rate and bitrate as the remote source-client. > > It shouldn't glitch stream players just because it swaps sources, should it? I suspect that what is going on is that the two streams (original and fallback) are not precisely synchronized, which means that the decoder will likely lose framing when switching to the fallback bitstream and hence mute or otherwise glitch while reacquiring same. I?m pretty sure that this is a consequence of the basic architecture of the Icecast system. Cheers! |---------------------------------------------------------------------| | Frederick F. Gleason, Jr. | Chief Developer | | | Paravel Systems | |---------------------------------------------------------------------| | A room without books is like a body without a soul. | | | | -- Cicero | |---------------------------------------------------------------------| -------------- next part -------------- An HTML attachment was scrubbed... URL: From that.jack.elliott at gmail.com Wed Sep 20 15:24:29 2023 From: that.jack.elliott at gmail.com (Jack Elliott) Date: Wed, 20 Sep 2023 08:24:29 -0700 Subject: [Icecast] Edited: / not working In-Reply-To: <192abebe-ee3a-45f8-af67-257177c9a6b3@Spark> References: <0ed1e99b-e780-e4a4-c206-5e03543ba496@kpov.org> <68d4dadd-108f-933a-fad2-8b14e30772d7@kpov.org> <60932c58-d542-ed99-a719-8870da6dda65@subj.am> <29d0a3d3-1b1d-361f-3f6e-355ad1d73db5@kpov.org> <192abebe-ee3a-45f8-af67-257177c9a6b3@Spark> Message-ID: Hi all, I am still trying to debug this. Summary, I am using in my icecast.xml to launch an email when a source-client connects. Here is the line in icecast.xml: /home/kpovdjs/bin/email_onconnect.sh The problem is that this script doesn't do anything when icecast runs it. The script works if I run it as user kpovdjs (me). But if I su to user icecast2, it does nothing. "email_onconnect.sh" is: #!/bin/bash set -x #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/kpovdjs/bin/on_connect.txt /usr/bin/msmtpthatjackelliott at kpov.org < /home/kpovdjs/bin/on_connect.txt? >/home/kpovdjs/bin/msmtp.log 2>&1 If I run it as user kpovdjs (me), it sends the email, and this is the debug output: kpovdjs at Icecast-Pi:~/bin $ ./email_onconnect.sh + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nSubject: Remote host has connected to mountpoint? on the Backstream\n\n KPOV Icecast server on IcecastPi has detected a connection on the backstream.' + /usr/bin/msmtpthatjackelliott at kpov.org But as user icecast2, the debug output is the same, but no email sent: icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nSubject: Remote host has connected to mountpoint on the Backstream\n\n KPOV Icecast server on IcecastPi has detected a connection on the backstream.' + /usr/bin/msmtpthatjackelliott at kpov.org For debug purposes, I have rwxrwxrwx permission set from / and down to and including the script. -rwxrwxrwx 1 kpovdjs kpovdjs 414 Sep 17 10:59 email_onconnect.sh For further debug purposes, I made a copy of the .sh script and chowned it to user icecast2. -rwxr-xr-x 1 icecast2 icecast 414 Sep 20 08:08 email_onconnect_usericecast2.sh It also does not send the email when I invoke it as user icecast2. The "set -x" debug output is the same. At this point it seems that this is not a icecast issue, per se, but some sneaky subtle weird annoying little Linux thing. However, if anyone here has an idea on how I might solve it, it would be very much appreciated. Thank you! =========================== Very cool, I haven't encountered the "set -x" debug flag before. However, the output isn't as interesting as I hoped: icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nSubject: Remote host has connected to mountpoint on the Backstream\n\n KPOV Icecast server on IcecastPi has detected a connection on the backstream.' + /usr/bin/msmtpthatjackelliott at kpov.org icecast2 at Icecast-Pi:/home/kpovdjs/bin$ Thank you! -- Jack Elliott Director of Classical Music Programming High Desert Community Radio KPOV Bend, Oregon On 9/17/23 10:49 AM, Thomas Zumbrunnen wrote: > 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 > : >> >> 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 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 or 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: / 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: >>>> >>>> /home/my_username/bin/email_onconnect.sh >>>> /home/my_username/bin/email_ondisconnect.sh >>>> >>>> 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" ? 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 --------------7bquXKfP2f2X3yn1FweF08yV Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Very cool, I haven't encountered the "set -x" debug flag before. However, the output isn't as interesting as I hoped:

icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh
+ printf 'To: thatjackelliott at kpov.org\nFrom: 
kpovcomputer at gmail.com\nSubject: 
Remote host has connected to mountpoint on the Backstream\n\n KPOV 
Icecast server on IcecastPi has detected a connection on the backstream.'
+ /usr/bin/msmtp thatjackelliott at kpov.org
icecast2 at Icecast-Pi:/home/kpovdjs/bin$

Thank you!

-- Jack Elliott
Director of Classical Music Programming
High Desert Community Radio
KPOV Bend, Oregon
On 9/17/23 10:49 AM, Thomas Zumbrunnen wrote:
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
--------------7bquXKfP2f2X3yn1FweF08yV-- From Content-Type: multipart/alternative; boundary="------------cwXTpa91 -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.zumbrunnen at gmail.com Wed Sep 20 15:48:55 2023 From: thomas.zumbrunnen at gmail.com (thomas.zumbrunnen at gmail.com) Date: Wed, 20 Sep 2023 17:48:55 +0200 Subject: [Icecast] Edited: / not working In-Reply-To: References: <0ed1e99b-e780-e4a4-c206-5e03543ba496@kpov.org> <68d4dadd-108f-933a-fad2-8b14e30772d7@kpov.org> <60932c58-d542-ed99-a719-8870da6dda65@subj.am> <29d0a3d3-1b1d-361f-3f6e-355ad1d73db5@kpov.org> <192abebe-ee3a-45f8-af67-257177c9a6b3@Spark> Message-ID: <001601d9ebda$03aa9890$0affc9b0$@gmail.com> Hi I?m using this function successful since years. I dont know how your mount point configuraiton looks like (or I cant see it) Here?s how it works on my side. The Mount Point definition in the XML looks like this: /mount_hi /mount_hi_backup 1 1 /usr/local/bin/icecast/share/web/onconnect.sh /usr/local/bin/icecast/share/web/disconnect.sh The script permission looks like this : -rwxrwxrwx 1 icecast icecast 539 13. Sep 11:42 onconnect.sh And finaly the script. It?s a bit different from yours, since I send alerts over two vectors (Mailing and Telegram Bot notification). #!/bin/bash /bin/echo "$(date '+%y-%m-%d %H:%M:%S') | CONNECTED" $1 >> /var/log/icecast/connectivity.log /usr/local/sbin/telegram-notify --success --text "*M1 | Source CONNECTED* on *$1* check [stream](http:// :8010$1.m3u)" mailx -s "M1 | Source CONNECTED on $1" -r < :8010$1.m3u This check will be repeated every time the behavior of the source stream is changing EOF exit This is it ? maybe it helps a bit. Cheers Tom Von: Icecast Im Auftrag von Jack Elliott Gesendet: Mittwoch, 20. September 2023 17:24 An: Icecast streaming server user discussions Betreff: Re: [Icecast] Edited: / not working Hi all, I am still trying to debug this. Summary, I am using in my icecast.xml to launch an email when a source-client connects. Here is the line in icecast.xml: /home/kpovdjs/bin/email_onconnect.sh The problem is that this script doesn't do anything when icecast runs it. The script works if I run it as user kpovdjs (me). But if I su to user icecast2, it does nothing. "email_onconnect.sh" is: #!/bin/bash set -x # 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/kpovdjs/bin/on_connect.txt /usr/bin/msmtp thatjackelliott at kpov.org < /home/kpovdjs/bin/on_connect.txt >/home/kpovdjs/bin/msmtp.log 2>&1 If I run it as user kpovdjs (me), it sends the email, and this is the debug output: kpovdjs at Icecast-Pi:~/bin $ ./email_onconnect.sh + printf 'To: thatjackelliott at kpov.org\nFrom: kpovcomputer at gmail.com\nSubject: Remote host has connected to mountpoint on the Backstream\n\n KPOV Icecast server on IcecastPi has detected a connection on the backstream.' + /usr/bin/msmtp thatjackelliott at kpov.org But as user icecast2, the debug output is the same, but no email sent: icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh + printf 'To: thatjackelliott at kpov.org\nFrom: kpovcomputer at gmail.com\nSubject: Remote host has connected to mountpoint on the Backstream\n\n KPOV Icecast server on IcecastPi has detected a connection on the backstream.' + /usr/bin/msmtp thatjackelliott at kpov.org For debug purposes, I have rwxrwxrwx permission set from / and down to and including the script. -rwxrwxrwx 1 kpovdjs kpovdjs 414 Sep 17 10:59 email_onconnect.sh For further debug purposes, I made a copy of the .sh script and chowned it to user icecast2. -rwxr-xr-x 1 icecast2 icecast 414 Sep 20 08:08 email_onconnect_usericecast2.sh It also does not send the email when I invoke it as user icecast2. The "set -x" debug output is the same. At this point it seems that this is not a icecast issue, per se, but some sneaky subtle weird annoying little Linux thing. However, if anyone here has an idea on how I might solve it, it would be very much appreciated. Thank you! =========================== Very cool, I haven't encountered the "set -x" debug flag before. However, the output isn't as interesting as I hoped: icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nSubject: Remote host has connected to mountpoint on the Backstream\n\n KPOV Icecast server on IcecastPi has detected a connection on the backstream.' + /usr/bin/msmtpthatjackelliott at kpov.org icecast2 at Icecast-Pi:/home/kpovdjs/bin$ Thank you! -- Jack Elliott Director of Classical Music Programming High Desert Community Radio KPOV Bend, Oregon On 9/17/23 10:49 AM, Thomas Zumbrunnen wrote: 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 : 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 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 or 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: / 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: /home/my_username/bin/email_onconnect.sh /home/my_username/bin/email_ondisconnect.sh 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" ? 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 --------------7bquXKfP2f2X3yn1FweF08yV Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit

Very cool, I haven't encountered the "set -x" debug flag before. However, the output isn't as interesting as I hoped:

icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh
+ printf 'To:  "mailto:thatjackelliott at kpov.org\nFrom">thatjackelliott at kpov.org\nFrom:  "mailto:kpovcomputer at gmail.com\nSubject">kpovcomputer at gmail.com\nSubject: Remote host has connected to mountpoint on the Backstream\n\n KPOV Icecast server on IcecastPi has detected a connection on the backstream.'
+ /usr/bin/msmtp  "mailto:thatjackelliott at kpov.org">thatjackelliott at kpov.org  
icecast2 at Icecast-Pi:/home/kpovdjs/bin$

Thank you!

-- Jack Elliott
Director of Classical Music Programming
High Desert Community Radio
KPOV Bend, Oregon
On 9/17/23 10:49 AM, Thomas Zumbrunnen wrote:
"mid:192abebe-ee3a-45f8-af67-257177c9a6b3 at Spark">
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 "mailto:that.jack.elliott at gmail.com"><that.jack.elliott at gmail.com>:

Hi Jordan,

Here is my script:

#!/bin/bash

#  "mailto:thatjackelliott at kpov.org" moz-do-not-send="true">thatjackelliott at kpov.org  

printf "To:  "mailto:thatjackelliott at kpov.org/nFrom" moz-do-not-send="true">thatjackelliott at kpov.org\nFrom:  "mailto:kpovcomputer at gmail.com/nSubject" moz-do-not-send="true">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  "mailto:thatjackelliott at kpov.org" moz-do-not-send="true">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:
"mid:60932c58-d542-ed99-a719-8870da6dda65 at subj.am"> 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/" moz-do-not-send="true">https://subj.am/

On 9/17/23 07:08, Jack Elliott wrote:
"mid:68d4dadd-108f-933a-fad2-8b14e30772d7 at kpov.org">

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
 "mailto:Icecast at xiph.org" moz-do-not-send="true">Icecast at xiph.org  
 "http://lists.xiph.org/mailman/listinfo/icecast" moz-do-not-send="true">http://lists.xiph.org/mailman/listinfo/icecast


_______________________________________________
Icecast mailing list
 "mailto:Icecast at xiph.org" moz-do-not-send="true">Icecast at xiph.org  
 "http://lists.xiph.org/mailman/listinfo/icecast" moz-do-not-send="true">http://lists.xiph.org/mailman/listinfo/icecast
_______________________________________________
Icecast mailing list
"mailto:Icecast at xiph.org">Icecast at xiph.org
"http://lists.xiph.org/mailman/listinfo/icecast">http://lists.xiph.org/mailman/listinfo/icecast
--------------7bquXKfP2f2X3yn1FweF08yV-- >From Content-Type: multipart/alternative; boundary="------------cwXTpa91 -------------- next part -------------- An HTML attachment was scrubbed... URL: From phschafft at de.loewenfelsen.net Wed Sep 20 15:44:23 2023 From: phschafft at de.loewenfelsen.net (Philipp Schafft) Date: Wed, 20 Sep 2023 15:44:23 +0000 Subject: [Icecast] Edited: / not working In-Reply-To: References: <0ed1e99b-e780-e4a4-c206-5e03543ba496@kpov.org> <68d4dadd-108f-933a-fad2-8b14e30772d7@kpov.org> <60932c58-d542-ed99-a719-8870da6dda65@subj.am> <29d0a3d3-1b1d-361f-3f6e-355ad1d73db5@kpov.org> <192abebe-ee3a-45f8-af67-257177c9a6b3@Spark> Message-ID: <80ffb48ae7ffb2a4922c3e923513a4927d13ca21.camel@de.loewenfelsen.net> Good morning, On Wed, 2023-09-20 at 08:24 -0700, Jack Elliott wrote: > Hi all, > I am still trying to debug this. Summary, I am using in > my icecast.xml to launch an email when a source-client connects. > Here is the line in icecast.xml: > /home/kpovdjs/bin/email_onconnect.sh > The problem is that this script doesn't do anything when icecast runs > it. > The script works if I run it as user kpovdjs (me). But if I su to > user icecast2, it does nothing. > "email_onconnect.sh" is: > #!/bin/bash > set -x > > # thatjackelliott at kpov.org > > printf "To: thatjackelliott at kpov.org\nFrom: kpovcomputer at gmail.com\nS > ubject: 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/kpovdjs/bin/on_connect.txt > /usr/bin/msmtp thatjackelliott at kpov.org < > /home/kpovdjs/bin/on_connect.txt >/home/kpovdjs/bin/msmtp.log 2>&1 Your printf is wrong here. NEVER do something like: printf "bla $blubb bla\n"; ALWAYS do: printf "bla %s bla\n" "$blubb"; That is exactly why we use printf in the first place. This is the reason it exists. Also you can just pipe your output between the commands. No need for a tempfile (which also adds many problems, from permissions to race conditions). > If I run it as user kpovdjs (me), it sends the email, and this is the > debug output: > kpovdjs at Icecast-Pi:~/bin $ ./email_onconnect.sh > + printf 'To: thatjackelliott at kpov.org\nFrom: kpovcomputer at gmail.com\ > nSubject: Remote host has connected to mountpoint on the > Backstream\n\n KPOV Icecast server on IcecastPi has detected a > connection on the backstream.' > + /usr/bin/msmtp thatjackelliott at kpov.org > But as user icecast2, the debug output is the same, but no email > sent: > icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh > + printf 'To: thatjackelliott at kpov.org\nFrom: kpovcomputer at gmail.com\ > nSubject: Remote host has connected to mountpoint on the > Backstream\n\n KPOV Icecast server on IcecastPi has detected a > connection on the backstream.' > + /usr/bin/msmtp thatjackelliott at kpov.org Are you sure /usr/bin/msmtp works as the Icecast user? Have you tried to run that script as the same user as Icecast? e.g.: sudo -u icecast /path/to/script > For debug purposes, I have rwxrwxrwx permission set from / and down > to and including the script. > -rwxrwxrwx 1 kpovdjs kpovdjs 414 Sep 17 10:59 email_onconnect.sh I hope that is a really really bad joke. > For further debug purposes, I made a copy of the .sh script and > chowned it to user icecast2. > -rwxr-xr-x 1 icecast2 icecast 414 Sep 20 08:08 > email_onconnect_usericecast2.sh > It also does not send the email when I invoke it as user icecast2. > The "set -x" debug output is the same. > At this point it seems that this is not a icecast issue, per se, but > some sneaky subtle weird annoying little Linux thing. However, if > anyone here has an idea on how I might solve it, it would be very > much appreciated. Not the wording I would use. You could check Icecast's error.log to see if it reports a problem. Other than that you really first need to establish that the script actually works running as that user. > Thank you! > =========================== > > Very cool, I haven't encountered the "set -x" debug flag before. > However, the output isn't as interesting as I hoped: > > icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh > + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nS > ubject: Remote host has connected to mountpoint on the Backstream\n\n > KPOV Icecast server on IcecastPi has detected a connection on the > backstream.' > + /usr/bin/msmtpthatjackelliott at kpov.org > icecast2 at Icecast-Pi:/home/kpovdjs/bin$ > > Thank you! > > > 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/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 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 or 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/ -- Philipp Schafft (CEO/Gesch?ftsf?hrer) Telephone: +49.3535 490 17 92 Website: https://www.loewenfelsen.net/ Follow us: https://www.linkedin.com/company/loewenfelsen/ Gesch?ftsf?hrer/CEO: Philipp Schafft L?wenfelsen UG (haftungsbeschr?nkt) Registration number: Bickinger Stra?e 21 HRB 12308 CB 04916 Herzberg (Elster) VATIN/USt-ID: Germany DE305133015 From dik23 at hotmail.com Wed Sep 20 16:27:59 2023 From: dik23 at hotmail.com (Dik ....) Date: Wed, 20 Sep 2023 16:27:59 +0000 Subject: [Icecast] When switching from source client to fallback and back glitches listen client In-Reply-To: <6BB29E53-E9AA-4074-A6B3-9E3C2E45BF46@paravelsystems.com> References: <6f0081b5-3a20-9db3-56c2-bc95002f6df2@kpov.org> <6BB29E53-E9AA-4074-A6B3-9E3C2E45BF46@paravelsystems.com> Message-ID: I suggest you look at Liquidsoap. Particularly mksafe which can merge files together into a single stream and stop clients from disconnecting https://www.liquidsoap.info/doc-2.2.0/quick_start.html#that-source-is-fallible ________________________________ From: Icecast on behalf of Fred Gleason Sent: 18 September 2023 16:09 To: thatjackelliott at kpov.org ; Icecast streaming server user discussions Subject: Re: [Icecast] When switching from source client to fallback and back glitches listen client On Sep 16, 2023, at 13:58, Jack Elliott > wrote: I've noticed that when a source-client disconnects from the mountpoint and the mountpoint switches to its specified fallback-client, some listen-clients disconnect, or close, or otherwise glitch. Same thing when a remote source-client connects, dropping the fallback--the listen-client can glitch. The fallback is an mp3 encoded at the same sample rate and bitrate as the remote source-client. It shouldn't glitch stream players just because it swaps sources, should it? I suspect that what is going on is that the two streams (original and fallback) are not precisely synchronized, which means that the decoder will likely lose framing when switching to the fallback bitstream and hence mute or otherwise glitch while reacquiring same. I?m pretty sure that this is a consequence of the basic architecture of the Icecast system. Cheers! |---------------------------------------------------------------------| | Frederick F. Gleason, Jr. | Chief Developer | | | Paravel Systems | |---------------------------------------------------------------------| | A room without books is like a body without a soul. | | | | -- Cicero | |---------------------------------------------------------------------| -------------- next part -------------- An HTML attachment was scrubbed... URL: From that.jack.elliott at gmail.com Wed Sep 20 17:32:21 2023 From: that.jack.elliott at gmail.com (Jack Elliott) Date: Wed, 20 Sep 2023 10:32:21 -0700 Subject: [Icecast] Edited: / not working In-Reply-To: <80ffb48ae7ffb2a4922c3e923513a4927d13ca21.camel@de.loewenfelsen.net> References: <0ed1e99b-e780-e4a4-c206-5e03543ba496@kpov.org> <68d4dadd-108f-933a-fad2-8b14e30772d7@kpov.org> <60932c58-d542-ed99-a719-8870da6dda65@subj.am> <29d0a3d3-1b1d-361f-3f6e-355ad1d73db5@kpov.org> <192abebe-ee3a-45f8-af67-257177c9a6b3@Spark> <80ffb48ae7ffb2a4922c3e923513a4927d13ca21.camel@de.loewenfelsen.net> Message-ID: <6bba1eff-a503-7e04-444e-97143efdbee8@kpov.org> Thank you, Philipp Schafft, Okay my amateur bash script is badly written and I will clean it up. But I don't think my clumsy scripting explains why I can run the script as user kpovdjs, but not as user icecast2? It uses /usr/bin/msptp and kpovdjs at Icecast-Pi:~/bin $ ls -l /usr/bin/msmtp -rwxr-xr-x 1 root root 83848 Jun 19? 2014 /usr/bin/msmtp So that isn't a problem. And the script: kpovdjs at Icecast-Pi:~/bin $ ls -l email_onconnect.sh -rwxrwxrwx 1 kpovdjs kpovdjs 422 Sep 20 10:08 email_onconnect.sh Yes, I have tried running the script as user kpovdjs and it works. And the same command as user icecast2 does not work and does not make an error message. Thomas Zumbrunnen wonders about my mount point definition, this is it: ? ??????? /stream ??????? /fallbacks/Generic_Silence_192kbps_48kHz.mp3 ??????? 1 ??????? 1 ???????? 65535 ??????? /home/kpovdjs/bin/email_onconnect.sh ??????? /home/kpovdjs/bin/email_ondisconnect.sh ??????? 1 ??? Thank you, everyone! -- Jack Elliott Director of Classical Music Programming High Desert Community Radio KPOV Bend, Oregon On 9/20/23 8:44 AM, Philipp Schafft wrote: > Good morning, > > On Wed, 2023-09-20 at 08:24 -0700, Jack Elliott wrote: >> Hi all, >> I am still trying to debug this. Summary, I am using in >> my icecast.xml to launch an email when a source-client connects. >> Here is the line in icecast.xml: >> /home/kpovdjs/bin/email_onconnect.sh >> The problem is that this script doesn't do anything when icecast runs >> it. >> The script works if I run it as user kpovdjs (me). But if I su to >> user icecast2, it does nothing. >> "email_onconnect.sh" is: >> #!/bin/bash >> set -x >> >> #thatjackelliott at kpov.org >> >> printf "To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nS >> ubject: 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/kpovdjs/bin/on_connect.txt >> /usr/bin/msmtpthatjackelliott at kpov.org < >> /home/kpovdjs/bin/on_connect.txt >/home/kpovdjs/bin/msmtp.log 2>&1 > > Your printf is wrong here. > NEVER do something like: printf "bla $blubb bla\n"; > ALWAYS do: printf "bla %s bla\n" "$blubb"; > > That is exactly why we use printf in the first place. This is the > reason it exists. > > Also you can just pipe your output between the commands. No need for a > tempfile (which also adds many problems, from permissions to race > conditions). > > >> If I run it as user kpovdjs (me), it sends the email, and this is the >> debug output: >> kpovdjs at Icecast-Pi:~/bin $ ./email_onconnect.sh >> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\ >> nSubject: Remote host has connected to mountpoint on the >> Backstream\n\n KPOV Icecast server on IcecastPi has detected a >> connection on the backstream.' >> + /usr/bin/msmtpthatjackelliott at kpov.org >> But as user icecast2, the debug output is the same, but no email >> sent: >> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh >> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\ >> nSubject: Remote host has connected to mountpoint on the >> Backstream\n\n KPOV Icecast server on IcecastPi has detected a >> connection on the backstream.' >> + /usr/bin/msmtpthatjackelliott at kpov.org > Are you sure /usr/bin/msmtp works as the Icecast user? > Have you tried to run that script as the same user as Icecast? > e.g.: sudo -u icecast /path/to/script > > >> For debug purposes, I have rwxrwxrwx permission set from / and down >> to and including the script. >> -rwxrwxrwx 1 kpovdjs kpovdjs 414 Sep 17 10:59 email_onconnect.sh > I hope that is a really really bad joke. > > >> For further debug purposes, I made a copy of the .sh script and >> chowned it to user icecast2. >> -rwxr-xr-x 1 icecast2 icecast 414 Sep 20 08:08 >> email_onconnect_usericecast2.sh >> It also does not send the email when I invoke it as user icecast2. >> The "set -x" debug output is the same. >> At this point it seems that this is not a icecast issue, per se, but >> some sneaky subtle weird annoying little Linux thing. However, if >> anyone here has an idea on how I might solve it, it would be very >> much appreciated. > Not the wording I would use. > > You could check Icecast's error.log to see if it reports a problem. > > Other than that you really first need to establish that the script > actually works running as that user. > > >> Thank you! >> =========================== >> >> Very cool, I haven't encountered the "set -x" debug flag before. >> However, the output isn't as interesting as I hoped: >> >> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh >> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nS >> ubject: Remote host has connected to mountpoint on the Backstream\n\n >> KPOV Icecast server on IcecastPi has detected a connection on the >> backstream.' >> + /usr/bin/msmtpthatjackelliott at kpov.org >> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ >> >> Thank you! >> >>> 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/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 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 or 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/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jordan at subj.am Wed Sep 20 17:35:16 2023 From: jordan at subj.am (Jordan Erickson) Date: Wed, 20 Sep 2023 10:35:16 -0700 Subject: [Icecast] Edited: / not working In-Reply-To: <6bba1eff-a503-7e04-444e-97143efdbee8@kpov.org> References: <0ed1e99b-e780-e4a4-c206-5e03543ba496@kpov.org> <68d4dadd-108f-933a-fad2-8b14e30772d7@kpov.org> <60932c58-d542-ed99-a719-8870da6dda65@subj.am> <29d0a3d3-1b1d-361f-3f6e-355ad1d73db5@kpov.org> <192abebe-ee3a-45f8-af67-257177c9a6b3@Spark> <80ffb48ae7ffb2a4922c3e923513a4927d13ca21.camel@de.loewenfelsen.net> <6bba1eff-a503-7e04-444e-97143efdbee8@kpov.org> Message-ID: <05b27e6e-c2bf-8867-330d-b12a8880d3ad@subj.am> Hi Jack, Have you tried, as the icecast2 user, interactively using the msmtp command instead of with your script? Try this, it will narrow down the variables. Also, check to see if your iceast2 user has the required group membership(s), if any, to send mail from that machine. Cheers, Jordan Erickson https://subj.am/ On 9/20/23 10:32, Jack Elliott wrote: > > Thank you, Philipp Schafft, > > Okay my amateur bash script is badly written and I will clean it up. > > But I don't think my clumsy scripting explains why I can run the > script as user kpovdjs, but not as user icecast2? > > It uses /usr/bin/msptp and > > kpovdjs at Icecast-Pi:~/bin $ ls -l /usr/bin/msmtp > -rwxr-xr-x 1 root root 83848 Jun 19? 2014 /usr/bin/msmtp > > So that isn't a problem. > > And the script: > > kpovdjs at Icecast-Pi:~/bin $ ls -l email_onconnect.sh > -rwxrwxrwx 1 kpovdjs kpovdjs 422 Sep 20 10:08 email_onconnect.sh > > Yes, I have tried running the script as user kpovdjs and it works. And > the same command as user icecast2 does not work and does not make an > error message. > > Thomas Zumbrunnen wonders about my mount point definition, this is it: > > ? > ??????? /stream > ??????? /fallbacks/Generic_Silence_192kbps_48kHz.mp3 > ??????? 1 > ??????? 1 > ???????? 65535 > ??????? /home/kpovdjs/bin/email_onconnect.sh > ??????? /home/kpovdjs/bin/email_ondisconnect.sh > ??????? 1 > ??? > > Thank you, everyone! > > -- > Jack Elliott > Director of Classical Music Programming > High Desert Community Radio > KPOV Bend, Oregon > On 9/20/23 8:44 AM, Philipp Schafft wrote: >> Good morning, >> >> On Wed, 2023-09-20 at 08:24 -0700, Jack Elliott wrote: >>> Hi all, >>> I am still trying to debug this. Summary, I am using in >>> my icecast.xml to launch an email when a source-client connects. >>> Here is the line in icecast.xml: >>> /home/kpovdjs/bin/email_onconnect.sh >>> The problem is that this script doesn't do anything when icecast runs >>> it. >>> The script works if I run it as user kpovdjs (me). But if I su to >>> user icecast2, it does nothing. >>> "email_onconnect.sh" is: >>> #!/bin/bash >>> set -x >>> >>> #thatjackelliott at kpov.org >>> >>> printf "To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nS >>> ubject: 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/kpovdjs/bin/on_connect.txt >>> /usr/bin/msmtpthatjackelliott at kpov.org < >>> /home/kpovdjs/bin/on_connect.txt >/home/kpovdjs/bin/msmtp.log 2>&1 >> Your printf is wrong here. >> NEVER do something like: printf "bla $blubb bla\n"; >> ALWAYS do: printf "bla %s bla\n" "$blubb"; >> >> That is exactly why we use printf in the first place. This is the >> reason it exists. >> >> Also you can just pipe your output between the commands. No need for a >> tempfile (which also adds many problems, from permissions to race >> conditions). >> >> >>> If I run it as user kpovdjs (me), it sends the email, and this is the >>> debug output: >>> kpovdjs at Icecast-Pi:~/bin $ ./email_onconnect.sh >>> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\ >>> nSubject: Remote host has connected to mountpoint on the >>> Backstream\n\n KPOV Icecast server on IcecastPi has detected a >>> connection on the backstream.' >>> + /usr/bin/msmtpthatjackelliott at kpov.org >>> But as user icecast2, the debug output is the same, but no email >>> sent: >>> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh >>> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\ >>> nSubject: Remote host has connected to mountpoint on the >>> Backstream\n\n KPOV Icecast server on IcecastPi has detected a >>> connection on the backstream.' >>> + /usr/bin/msmtpthatjackelliott at kpov.org >> Are you sure /usr/bin/msmtp works as the Icecast user? >> Have you tried to run that script as the same user as Icecast? >> e.g.: sudo -u icecast /path/to/script >> >> >>> For debug purposes, I have rwxrwxrwx permission set from / and down >>> to and including the script. >>> -rwxrwxrwx 1 kpovdjs kpovdjs 414 Sep 17 10:59 email_onconnect.sh >> I hope that is a really really bad joke. >> >> >>> For further debug purposes, I made a copy of the .sh script and >>> chowned it to user icecast2. >>> -rwxr-xr-x 1 icecast2 icecast 414 Sep 20 08:08 >>> email_onconnect_usericecast2.sh >>> It also does not send the email when I invoke it as user icecast2. >>> The "set -x" debug output is the same. >>> At this point it seems that this is not a icecast issue, per se, but >>> some sneaky subtle weird annoying little Linux thing. However, if >>> anyone here has an idea on how I might solve it, it would be very >>> much appreciated. >> Not the wording I would use. >> >> You could check Icecast's error.log to see if it reports a problem. >> >> Other than that you really first need to establish that the script >> actually works running as that user. >> >> >>> Thank you! >>> =========================== >>> >>> Very cool, I haven't encountered the "set -x" debug flag before. >>> However, the output isn't as interesting as I hoped: >>> >>> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh >>> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nS >>> ubject: Remote host has connected to mountpoint on the Backstream\n\n >>> KPOV Icecast server on IcecastPi has detected a connection on the >>> backstream.' >>> + /usr/bin/msmtpthatjackelliott at kpov.org >>> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ >>> >>> Thank you! >>> >>>> 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/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 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 or 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/ > > _______________________________________________ > Icecast mailing list > Icecast at xiph.org > http://lists.xiph.org/mailman/listinfo/icecast -------------- next part -------------- An HTML attachment was scrubbed... URL: From that.jack.elliott at gmail.com Wed Sep 20 18:11:06 2023 From: that.jack.elliott at gmail.com (Jack Elliott) Date: Wed, 20 Sep 2023 11:11:06 -0700 Subject: [Icecast] Edited: / not working In-Reply-To: <05b27e6e-c2bf-8867-330d-b12a8880d3ad@subj.am> References: <0ed1e99b-e780-e4a4-c206-5e03543ba496@kpov.org> <68d4dadd-108f-933a-fad2-8b14e30772d7@kpov.org> <60932c58-d542-ed99-a719-8870da6dda65@subj.am> <29d0a3d3-1b1d-361f-3f6e-355ad1d73db5@kpov.org> <192abebe-ee3a-45f8-af67-257177c9a6b3@Spark> <80ffb48ae7ffb2a4922c3e923513a4927d13ca21.camel@de.loewenfelsen.net> <6bba1eff-a503-7e04-444e-97143efdbee8@kpov.org> <05b27e6e-c2bf-8867-330d-b12a8880d3ad@subj.am> Message-ID: <07e86cdd-66f1-308c-eea8-eb133c744205@kpov.org> Hi Jordan, thank you for the suggestion to try msmtp directly as user icecast2 First I try as user kpovdjs (me): kpovdjs at Icecast-Pi:~/bin $ echo "hello there username." | msmtp -a gmailthatjackelliott at kpov.org This does send the email. Now su to user icecast2 icecast2 at Icecast-Pi:/home/kpovdjs/bin$ echo "hello there username." | msmtp -a gmailthatjackelliott at kpov.org msmtp: account gmail not found: no configuration file available Interesting. For user kpovdjs, msmtp finds account information in /home/kpovdjs/.msmtprc But as user icecast2, there is no .msmtprc file in /home/icecast2 In fact, there is no icecast2 folder in /home So I create /home/icecast2 I copy my user .msmtprc to /home/icecast2 icecast2 at Icecast-Pi:/home/kpovdjs$ ls -la /home/icecast2 total 12 drwxr-xr-x 2 icecast2 root 4096 Sep 20 10:57 . drwxr-xr-x 5 root???? root 4096 Sep 20 10:51 .. -rw-r--r-- 1 icecast2 root? 332 Sep 20 10:57 .msmtprc Now I try again: icecast2 at Icecast-Pi:/home/kpovdjs$ echo "hello there username." | msmtp -a gmailthatjackelliott at kpov.org msmtp: account gmail not found: no configuration file available If msmtp cannot find its rc file in /home/icecast2, then maybe there is a way to specify the location. -- Jack Elliott Director of Classical Music Programming High Desert Community Radio KPOV Bend, Oregon On 9/20/23 10:35 AM, Jordan Erickson wrote: > Hi Jack, > > Have you tried, as the icecast2 user, interactively using the msmtp > command instead of with your script? Try this, it will narrow down the > variables. Also, check to see if your iceast2 user has the required > group membership(s), if any, to send mail from that machine. > > > Cheers, > Jordan Erickson > > https://subj.am/ > On 9/20/23 10:32, Jack Elliott wrote: >> >> Thank you, Philipp Schafft, >> >> Okay my amateur bash script is badly written and I will clean it up. >> >> But I don't think my clumsy scripting explains why I can run the >> script as user kpovdjs, but not as user icecast2? >> >> It uses /usr/bin/msptp and >> >> kpovdjs at Icecast-Pi:~/bin $ ls -l /usr/bin/msmtp >> -rwxr-xr-x 1 root root 83848 Jun 19? 2014 /usr/bin/msmtp >> >> So that isn't a problem. >> >> And the script: >> >> kpovdjs at Icecast-Pi:~/bin $ ls -l email_onconnect.sh >> -rwxrwxrwx 1 kpovdjs kpovdjs 422 Sep 20 10:08 email_onconnect.sh >> >> Yes, I have tried running the script as user kpovdjs and it works. >> And the same command as user icecast2 does not work and does not make >> an error message. >> >> Thomas Zumbrunnen wonders about my mount point definition, this is it: >> >> ? >> ??????? /stream >> ??????? /fallbacks/Generic_Silence_192kbps_48kHz.mp3 >> ??????? 1 >> ??????? 1 >> ???????? 65535 >> ??????? /home/kpovdjs/bin/email_onconnect.sh >> ??????? /home/kpovdjs/bin/email_ondisconnect.sh >> ??????? 1 >> ??? >> >> Thank you, everyone! >> >> -- >> Jack Elliott >> Director of Classical Music Programming >> High Desert Community Radio >> KPOV Bend, Oregon >> On 9/20/23 8:44 AM, Philipp Schafft wrote: >>> Good morning, >>> >>> On Wed, 2023-09-20 at 08:24 -0700, Jack Elliott wrote: >>>> Hi all, >>>> I am still trying to debug this. Summary, I am using in >>>> my icecast.xml to launch an email when a source-client connects. >>>> Here is the line in icecast.xml: >>>> /home/kpovdjs/bin/email_onconnect.sh >>>> The problem is that this script doesn't do anything when icecast runs >>>> it. >>>> The script works if I run it as user kpovdjs (me). But if I su to >>>> user icecast2, it does nothing. >>>> "email_onconnect.sh" is: >>>> #!/bin/bash >>>> set -x >>>> >>>> #thatjackelliott at kpov.org >>>> >>>> printf "To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nS >>>> ubject: 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/kpovdjs/bin/on_connect.txt >>>> /usr/bin/msmtpthatjackelliott at kpov.org < >>>> /home/kpovdjs/bin/on_connect.txt >/home/kpovdjs/bin/msmtp.log 2>&1 >>> Your printf is wrong here. >>> NEVER do something like: printf "bla $blubb bla\n"; >>> ALWAYS do: printf "bla %s bla\n" "$blubb"; >>> >>> That is exactly why we use printf in the first place. This is the >>> reason it exists. >>> >>> Also you can just pipe your output between the commands. No need for a >>> tempfile (which also adds many problems, from permissions to race >>> conditions). >>> >>> >>>> If I run it as user kpovdjs (me), it sends the email, and this is the >>>> debug output: >>>> kpovdjs at Icecast-Pi:~/bin $ ./email_onconnect.sh >>>> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\ >>>> nSubject: Remote host has connected to mountpoint on the >>>> Backstream\n\n KPOV Icecast server on IcecastPi has detected a >>>> connection on the backstream.' >>>> + /usr/bin/msmtpthatjackelliott at kpov.org >>>> But as user icecast2, the debug output is the same, but no email >>>> sent: >>>> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh >>>> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\ >>>> nSubject: Remote host has connected to mountpoint on the >>>> Backstream\n\n KPOV Icecast server on IcecastPi has detected a >>>> connection on the backstream.' >>>> + /usr/bin/msmtpthatjackelliott at kpov.org >>> Are you sure /usr/bin/msmtp works as the Icecast user? >>> Have you tried to run that script as the same user as Icecast? >>> e.g.: sudo -u icecast /path/to/script >>> >>> >>>> For debug purposes, I have rwxrwxrwx permission set from / and down >>>> to and including the script. >>>> -rwxrwxrwx 1 kpovdjs kpovdjs 414 Sep 17 10:59 email_onconnect.sh >>> I hope that is a really really bad joke. >>> >>> >>>> For further debug purposes, I made a copy of the .sh script and >>>> chowned it to user icecast2. >>>> -rwxr-xr-x 1 icecast2 icecast 414 Sep 20 08:08 >>>> email_onconnect_usericecast2.sh >>>> It also does not send the email when I invoke it as user icecast2. >>>> The "set -x" debug output is the same. >>>> At this point it seems that this is not a icecast issue, per se, but >>>> some sneaky subtle weird annoying little Linux thing. However, if >>>> anyone here has an idea on how I might solve it, it would be very >>>> much appreciated. >>> Not the wording I would use. >>> >>> You could check Icecast's error.log to see if it reports a problem. >>> >>> Other than that you really first need to establish that the script >>> actually works running as that user. >>> >>> >>>> Thank you! >>>> =========================== >>>> >>>> Very cool, I haven't encountered the "set -x" debug flag before. >>>> However, the output isn't as interesting as I hoped: >>>> >>>> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh >>>> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nS >>>> ubject: Remote host has connected to mountpoint on the Backstream\n\n >>>> KPOV Icecast server on IcecastPi has detected a connection on the >>>> backstream.' >>>> + /usr/bin/msmtpthatjackelliott at kpov.org >>>> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ >>>> >>>> Thank you! >>>> >>>>> 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/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 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 or 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/ >> >> _______________________________________________ >> 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: From jordan at subj.am Wed Sep 20 18:18:49 2023 From: jordan at subj.am (Jordan Erickson) Date: Wed, 20 Sep 2023 11:18:49 -0700 Subject: [Icecast] Edited: / not working In-Reply-To: <07e86cdd-66f1-308c-eea8-eb133c744205@kpov.org> References: <0ed1e99b-e780-e4a4-c206-5e03543ba496@kpov.org> <68d4dadd-108f-933a-fad2-8b14e30772d7@kpov.org> <60932c58-d542-ed99-a719-8870da6dda65@subj.am> <29d0a3d3-1b1d-361f-3f6e-355ad1d73db5@kpov.org> <192abebe-ee3a-45f8-af67-257177c9a6b3@Spark> <80ffb48ae7ffb2a4922c3e923513a4927d13ca21.camel@de.loewenfelsen.net> <6bba1eff-a503-7e04-444e-97143efdbee8@kpov.org> <05b27e6e-c2bf-8867-330d-b12a8880d3ad@subj.am> <07e86cdd-66f1-308c-eea8-eb133c744205@kpov.org> Message-ID: <29b3f775-60c6-7178-f159-353448546f3b@subj.am> You need to put that msmtp config file in Icecast user's configured home directory. Look in /etc/passwd for that or just 'cd ~' as Icecast user. It's likely not /home/icecast2 if you had to create it yourself manually. Cheers, Jordan Erickson https://subj.am/ On 9/20/23 11:11, Jack Elliott wrote: > > Hi Jordan, thank you for the suggestion to try msmtp directly as user > icecast2 > > First I try as user kpovdjs (me): > > kpovdjs at Icecast-Pi:~/bin $ echo "hello there username." | msmtp -a gmailthatjackelliott at kpov.org > > This does send the email. > > Now su to user icecast2 > > icecast2 at Icecast-Pi:/home/kpovdjs/bin$ echo "hello there username." | msmtp -a gmailthatjackelliott at kpov.org > msmtp: account gmail not found: no configuration file available > > Interesting. For user kpovdjs, msmtp finds account information in > /home/kpovdjs/.msmtprc > > But as user icecast2, there is no .msmtprc file in /home/icecast2 > > In fact, there is no icecast2 folder in /home > > So I create /home/icecast2 > > I copy my user .msmtprc to /home/icecast2 > > icecast2 at Icecast-Pi:/home/kpovdjs$ ls -la /home/icecast2 > total 12 > drwxr-xr-x 2 icecast2 root 4096 Sep 20 10:57 . > drwxr-xr-x 5 root???? root 4096 Sep 20 10:51 .. > -rw-r--r-- 1 icecast2 root? 332 Sep 20 10:57 .msmtprc > > Now I try again: > > icecast2 at Icecast-Pi:/home/kpovdjs$ echo "hello there username." | msmtp -a gmailthatjackelliott at kpov.org > msmtp: account gmail not found: no configuration file available > > If msmtp cannot find its rc file in /home/icecast2, then maybe there > is a way to specify the location. > > -- > Jack Elliott > Director of Classical Music Programming > High Desert Community Radio > KPOV Bend, Oregon > On 9/20/23 10:35 AM, Jordan Erickson wrote: >> Hi Jack, >> >> Have you tried, as the icecast2 user, interactively using the msmtp >> command instead of with your script? Try this, it will narrow down >> the variables. Also, check to see if your iceast2 user has the >> required group membership(s), if any, to send mail from that machine. >> >> >> Cheers, >> Jordan Erickson >> >> https://subj.am/ >> On 9/20/23 10:32, Jack Elliott wrote: >>> >>> Thank you, Philipp Schafft, >>> >>> Okay my amateur bash script is badly written and I will clean it up. >>> >>> But I don't think my clumsy scripting explains why I can run the >>> script as user kpovdjs, but not as user icecast2? >>> >>> It uses /usr/bin/msptp and >>> >>> kpovdjs at Icecast-Pi:~/bin $ ls -l /usr/bin/msmtp >>> -rwxr-xr-x 1 root root 83848 Jun 19? 2014 /usr/bin/msmtp >>> >>> So that isn't a problem. >>> >>> And the script: >>> >>> kpovdjs at Icecast-Pi:~/bin $ ls -l email_onconnect.sh >>> -rwxrwxrwx 1 kpovdjs kpovdjs 422 Sep 20 10:08 email_onconnect.sh >>> >>> Yes, I have tried running the script as user kpovdjs and it works. >>> And the same command as user icecast2 does not work and does not >>> make an error message. >>> >>> Thomas Zumbrunnen wonders about my mount point definition, this is it: >>> >>> ? >>> ??????? /stream >>> ??????? /fallbacks/Generic_Silence_192kbps_48kHz.mp3 >>> ??????? 1 >>> ??????? 1 >>> ???????? 65535 >>> ??????? /home/kpovdjs/bin/email_onconnect.sh >>> ??????? /home/kpovdjs/bin/email_ondisconnect.sh >>> ??????? 1 >>> ??? >>> >>> Thank you, everyone! >>> >>> -- >>> Jack Elliott >>> Director of Classical Music Programming >>> High Desert Community Radio >>> KPOV Bend, Oregon >>> On 9/20/23 8:44 AM, Philipp Schafft wrote: >>>> Good morning, >>>> >>>> On Wed, 2023-09-20 at 08:24 -0700, Jack Elliott wrote: >>>>> Hi all, >>>>> I am still trying to debug this. Summary, I am using in >>>>> my icecast.xml to launch an email when a source-client connects. >>>>> Here is the line in icecast.xml: >>>>> /home/kpovdjs/bin/email_onconnect.sh >>>>> The problem is that this script doesn't do anything when icecast runs >>>>> it. >>>>> The script works if I run it as user kpovdjs (me). But if I su to >>>>> user icecast2, it does nothing. >>>>> "email_onconnect.sh" is: >>>>> #!/bin/bash >>>>> set -x >>>>> >>>>> #thatjackelliott at kpov.org >>>>> >>>>> printf "To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nS >>>>> ubject: 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/kpovdjs/bin/on_connect.txt >>>>> /usr/bin/msmtpthatjackelliott at kpov.org < >>>>> /home/kpovdjs/bin/on_connect.txt >/home/kpovdjs/bin/msmtp.log 2>&1 >>>> Your printf is wrong here. >>>> NEVER do something like: printf "bla $blubb bla\n"; >>>> ALWAYS do: printf "bla %s bla\n" "$blubb"; >>>> >>>> That is exactly why we use printf in the first place. This is the >>>> reason it exists. >>>> >>>> Also you can just pipe your output between the commands. No need for a >>>> tempfile (which also adds many problems, from permissions to race >>>> conditions). >>>> >>>> >>>>> If I run it as user kpovdjs (me), it sends the email, and this is the >>>>> debug output: >>>>> kpovdjs at Icecast-Pi:~/bin $ ./email_onconnect.sh >>>>> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\ >>>>> nSubject: Remote host has connected to mountpoint on the >>>>> Backstream\n\n KPOV Icecast server on IcecastPi has detected a >>>>> connection on the backstream.' >>>>> + /usr/bin/msmtpthatjackelliott at kpov.org >>>>> But as user icecast2, the debug output is the same, but no email >>>>> sent: >>>>> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh >>>>> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\ >>>>> nSubject: Remote host has connected to mountpoint on the >>>>> Backstream\n\n KPOV Icecast server on IcecastPi has detected a >>>>> connection on the backstream.' >>>>> + /usr/bin/msmtpthatjackelliott at kpov.org >>>> Are you sure /usr/bin/msmtp works as the Icecast user? >>>> Have you tried to run that script as the same user as Icecast? >>>> e.g.: sudo -u icecast /path/to/script >>>> >>>> >>>>> For debug purposes, I have rwxrwxrwx permission set from / and down >>>>> to and including the script. >>>>> -rwxrwxrwx 1 kpovdjs kpovdjs 414 Sep 17 10:59 email_onconnect.sh >>>> I hope that is a really really bad joke. >>>> >>>> >>>>> For further debug purposes, I made a copy of the .sh script and >>>>> chowned it to user icecast2. >>>>> -rwxr-xr-x 1 icecast2 icecast 414 Sep 20 08:08 >>>>> email_onconnect_usericecast2.sh >>>>> It also does not send the email when I invoke it as user icecast2. >>>>> The "set -x" debug output is the same. >>>>> At this point it seems that this is not a icecast issue, per se, but >>>>> some sneaky subtle weird annoying little Linux thing. However, if >>>>> anyone here has an idea on how I might solve it, it would be very >>>>> much appreciated. >>>> Not the wording I would use. >>>> >>>> You could check Icecast's error.log to see if it reports a problem. >>>> >>>> Other than that you really first need to establish that the script >>>> actually works running as that user. >>>> >>>> >>>>> Thank you! >>>>> =========================== >>>>> >>>>> Very cool, I haven't encountered the "set -x" debug flag before. >>>>> However, the output isn't as interesting as I hoped: >>>>> >>>>> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh >>>>> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nS >>>>> ubject: Remote host has connected to mountpoint on the Backstream\n\n >>>>> KPOV Icecast server on IcecastPi has detected a connection on the >>>>> backstream.' >>>>> + /usr/bin/msmtpthatjackelliott at kpov.org >>>>> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ >>>>> >>>>> Thank you! >>>>> >>>>>> 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/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 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 or 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/ >>> >>> _______________________________________________ >>> 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: From marcusantoniouslee at gmail.com Wed Sep 20 19:33:35 2023 From: marcusantoniouslee at gmail.com (Mark Lee) Date: Wed, 20 Sep 2023 15:33:35 -0400 Subject: [Icecast] Edited: / not working In-Reply-To: References: <0ed1e99b-e780-e4a4-c206-5e03543ba496@kpov.org> <68d4dadd-108f-933a-fad2-8b14e30772d7@kpov.org> <60932c58-d542-ed99-a719-8870da6dda65@subj.am> <29d0a3d3-1b1d-361f-3f6e-355ad1d73db5@kpov.org> <192abebe-ee3a-45f8-af67-257177c9a6b3@Spark> Message-ID: Hi, does the bash script send the email if you execute it in the terminal? On Wed, Sept 20, 2023, 11:24 a.m. Jack Elliott wrote: > Hi all, > > I am still trying to debug this. Summary, I am using in my > icecast.xml to launch an email when a source-client connects. > > Here is the line in icecast.xml: > > /home/kpovdjs/bin/email_onconnect.sh > > The problem is that this script doesn't do anything when icecast runs it. > > The script works if I run it as user kpovdjs (me). But if I su to user > icecast2, it does nothing. > > "email_onconnect.sh" is: > > #!/bin/bash > set -x > > # 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/kpovdjs/bin/on_connect.txt > /usr/bin/msmtp thatjackelliott at kpov.org < /home/kpovdjs/bin/on_connect.txt >/home/kpovdjs/bin/msmtp.log 2>&1 > > If I run it as user kpovdjs (me), it sends the email, and this is the > debug output: > > kpovdjs at Icecast-Pi:~/bin $ ./email_onconnect.sh > + printf 'To: thatjackelliott at kpov.org\nFrom: kpovcomputer at gmail.com\nSubject: Remote host has connected to mountpoint on the Backstream\n\n KPOV Icecast server on IcecastPi has detected a connection on the backstream.' > + /usr/bin/msmtp thatjackelliott at kpov.org > > But as user icecast2, the debug output is the same, but no email sent: > > icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh > + printf 'To: thatjackelliott at kpov.org\nFrom: kpovcomputer at gmail.com\nSubject: Remote host has connected to mountpoint on the Backstream\n\n KPOV Icecast server on IcecastPi has detected a connection on the backstream.' > + /usr/bin/msmtp thatjackelliott at kpov.org > > For debug purposes, I have rwxrwxrwx permission set from / and down to and > including the script. > > -rwxrwxrwx 1 kpovdjs kpovdjs 414 Sep 17 10:59 email_onconnect.sh > > For further debug purposes, I made a copy of the .sh script and chowned it > to user icecast2. > > -rwxr-xr-x 1 icecast2 icecast 414 Sep 20 08:08 email_onconnect_usericecast2.sh > > It also does not send the email when I invoke it as user icecast2. The > "set -x" debug output is the same. > > At this point it seems that this is not a icecast issue, per se, but some > sneaky subtle weird annoying little Linux thing. However, if anyone here > has an idea on how I might solve it, it would be very much appreciated. > > Thank you! > > =========================== > > > Very cool, I haven't encountered the "set -x" debug flag before. However, > the output isn't as interesting as I hoped: > > icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh > + printf ' > To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nSubject: Remote > host has connected to mountpoint on the Backstream\n\n KPOV Icecast server > on IcecastPi has detected a connection on the backstream.' > + /usr/bin/msmtpthatjackelliott at kpov.org > icecast2 at Icecast-Pi:/home/kpovdjs/bin$ > > Thank you! > > -- > Jack Elliott > Director of Classical Music Programming > High Desert Community Radio > KPOV Bend, Oregon > > On 9/17/23 10:49 AM, Thomas Zumbrunnen wrote: > > 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 > : > > > 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 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 > or 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: / 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: > > /home/my_username/bin/email_onconnect.sh > /home/my_username/bin/email_ondisconnect.sh > > 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" ? 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 > > --------------7bquXKfP2f2X3yn1FweF08yV > Content-Type: text/html; charset=UTF-8 > Content-Transfer-Encoding: 8bit > > > > > > >

Very cool, I haven't encountered the "set -x" debug flag before. > However, the output isn't as interesting as I hoped:
>

>
icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh
> + printf 'To:  "mailto:thatjackelliott at kpov.org\nFrom" 
> >thatjackelliott at kpov.org\nFrom:  href="mailto:kpovcomputer at gmail.com\nSubject"
> >kpovcomputer at gmail.com\nSubject:
> Remote host has connected to mountpoint on the Backstream\n\n KPOV Icecast
> server on IcecastPi has detected a connection on the backstream.'
> + /usr/bin/msmtp  "mailto:thatjackelliott at kpov.org" >
> thatjackelliott at kpov.org
> icecast2 at Icecast-Pi:/home/kpovdjs/bin$
> 
>

Thank you!
>

>
-- Jack Elliott
> Director of Classical Music Programming
> High Desert Community Radio
> KPOV Bend, Oregon
>
On 9/17/23 10:49 AM, Thomas Zumbrunnen > wrote:
>
>
cite="mid:192abebe-ee3a-45f8-af67-257177c9a6b3 at Spark"> > > >
>
Hi
>
> For debuging purpose put
> set style="color:#242424;background-color:#f9f9f9;font-family:source-code-pro, > Menlo, Monaco, Courier New, Courier, monospace;font-size: > 14px"> -x in the row after style="color:#643820;font-family:source-code-pro, Menlo, > Monaco, Courier New, Courier, monospace;font-size: > 14px">#!/bin/bash style="font-size: 14px">
>
and execute the script. Post the whole output here. style="font-size: 14px">
>

>
Cheers
>
Tom
>
>
Am 17. Sept. 2023, 19:42 +0200 > schrieb Jack Elliott "mailto:that.jack.elliott at gmail.com" >& > lt;that.jack.elliott at gmail.com>:
>
>

Hi Jordan,
>

>

Here is my script:

>
#!/bin/bash
>
> #  "mailto:thatjackelliott at kpov.org" 
> moz-do-not-send="true">thatjackelliott at kpov.org
>
> printf "To:  "mailto:thatjackelliott at kpov.org/nFrom" 
> moz-do-not-send="true">thatjackelliott at kpov.org\nFrom:  class="moz-txt-link-abbreviated" href=
> "mailto:kpovcomputer at gmail.com/nSubject" 
> moz-do-not-send="true">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  href="mailto:thatjackelliott at kpov.org" 
> moz-do-not-send="true">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:
>
>
cite="mid:60932c58-d542-ed99-a719-8870da6dda65 at subj.am"> > > 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/"  moz-do-not-send="true">
> https://subj.am/
>
> 
>
On 9/17/23 07:08, Jack Elliott > wrote:
>
>
cite="mid:68d4dadd-108f-933a-fad2-8b14e30772d7 at kpov.org"> > >

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
>
>
>
 wrap="">_______________________________________________
> Icecast mailing list
>  "mailto:Icecast at xiph.org"  moz-do-not-send="true">
> Icecast at xiph.org
>  "http://lists.xiph.org/mailman/listinfo/icecast"
>  moz-do-not-send="true">
> http://lists.xiph.org/mailman/listinfo/icecast
> 
>
>
>
>
>
 wrap="">_______________________________________________
> Icecast mailing list
>  "mailto:Icecast at xiph.org"  moz-do-not-send="true">
> Icecast at xiph.org
>  "http://lists.xiph.org/mailman/listinfo/icecast"
>  moz-do-not-send="true">
> http://lists.xiph.org/mailman/listinfo/icecast
> 
>
> _______________________________________________
> Icecast mailing list
> >Icecast at xiph.org
> "http://lists.xiph.org/mailman/listinfo/icecast" > > > http://lists.xiph.org/mailman/listinfo/icecast
>
>
>
> > > > --------------7bquXKfP2f2X3yn1FweF08yV-- > From Content-Type: multipart/alternative; > boundary="------------cwXTpa91 > > _______________________________________________ > Icecast mailing list > Icecast at xiph.org > http://lists.xiph.org/mailman/listinfo/icecast > -------------- next part -------------- An HTML attachment was scrubbed... URL: From that.jack.elliott at gmail.com Wed Sep 20 20:28:53 2023 From: that.jack.elliott at gmail.com (Jack Elliott) Date: Wed, 20 Sep 2023 13:28:53 -0700 Subject: [Icecast] SOLVED Re: Edited: / not working In-Reply-To: <29b3f775-60c6-7178-f159-353448546f3b@subj.am> References: <0ed1e99b-e780-e4a4-c206-5e03543ba496@kpov.org> <68d4dadd-108f-933a-fad2-8b14e30772d7@kpov.org> <60932c58-d542-ed99-a719-8870da6dda65@subj.am> <29d0a3d3-1b1d-361f-3f6e-355ad1d73db5@kpov.org> <192abebe-ee3a-45f8-af67-257177c9a6b3@Spark> <80ffb48ae7ffb2a4922c3e923513a4927d13ca21.camel@de.loewenfelsen.net> <6bba1eff-a503-7e04-444e-97143efdbee8@kpov.org> <05b27e6e-c2bf-8867-330d-b12a8880d3ad@subj.am> <07e86cdd-66f1-308c-eea8-eb133c744205@kpov.org> <29b3f775-60c6-7178-f159-353448546f3b@subj.am> Message-ID: <541dadbd-7de8-a2a9-c7a2-44203aa37678@kpov.org> Thank you, Jordan. It now works. For the next icecast user who needs to get an script to run, I am leaving this here. Okay, icecast2 is not human user, so no /home directory for it. /etc/passwd tells me: icecast2:x:112:119::/usr/share/icecast2:/bin/false So I copy the working (for my user kpovdjs) /home/kpovdjs/.msmtprc file to /usr/share/icecast2 , and change owner to user icecast2 kpovdjs at Icecast-Pi:~ $ ls -la /usr/share/icecast2 total 20 drwxr-xr-x 4 root root 4096 Sep 20 11:31 . drwxr-xr-x 205 root root 4096 Jul 13 2022 .. drwxr-xr-x 2 root root 4096 Apr 22 2017 admin -rw-rw-rw- 1 icecast2 root 332 Sep 20 11:31 .msmtprc drwxr-xr-x 3 kpovdjs root 4096 May 12 2017 web So, icecast2 at Icecast-Pi:/home/kpovdjs$ echo "hello there username." | msmtp -a gmailthatjackelliott at kpov.org msmtp: /usr/share/icecast2/.msmtprc: must have no more than user read/write permissions But now msmtp finds the rc file! So chmod 600 to .msmtprc to get -rw-------?? 1 icecast2 root? 332 Sep 20 11:31 .msmtprc and try again . . . and . . . it works! email received. One minor permissions issue, msmtp: cannot log to /home/kpovdjs/bin/msmtp_logfile.log: cannot open: Permission denied So as owner of the logfile.log: chmod 666 /home/kpovdjs/bin/msmtp_logfile.log And all is good. Many thanks to you and the others who helped me debug this routine. Have a good day! -- Jack Elliott Director of Classical Music Programming High Desert Community Radio KPOV Bend, Oregon On 9/20/23 11:18 AM, Jordan Erickson wrote: > You need to put that msmtp config file in Icecast user's configured > home directory. Look in /etc/passwd for that or just 'cd ~' as Icecast > user. It's likely not /home/icecast2 if you had to create it yourself > manually. > > > Cheers, > Jordan Erickson > > https://subj.am/ > On 9/20/23 11:11, Jack Elliott wrote: >> >> Hi Jordan, thank you for the suggestion to try msmtp directly as user >> icecast2 >> >> First I try as user kpovdjs (me): >> >> kpovdjs at Icecast-Pi:~/bin $ echo "hello there username." | msmtp -a gmailthatjackelliott at kpov.org >> >> This does send the email. >> >> Now su to user icecast2 >> >> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ echo "hello there username." | msmtp -a gmailthatjackelliott at kpov.org >> msmtp: account gmail not found: no configuration file available >> >> Interesting. For user kpovdjs, msmtp finds account information in >> /home/kpovdjs/.msmtprc >> >> But as user icecast2, there is no .msmtprc file in /home/icecast2 >> >> In fact, there is no icecast2 folder in /home >> >> So I create /home/icecast2 >> >> I copy my user .msmtprc to /home/icecast2 >> >> icecast2 at Icecast-Pi:/home/kpovdjs$ ls -la /home/icecast2 >> total 12 >> drwxr-xr-x 2 icecast2 root 4096 Sep 20 10:57 . >> drwxr-xr-x 5 root???? root 4096 Sep 20 10:51 .. >> -rw-r--r-- 1 icecast2 root? 332 Sep 20 10:57 .msmtprc >> >> Now I try again: >> >> icecast2 at Icecast-Pi:/home/kpovdjs$ echo "hello there username." | msmtp -a gmailthatjackelliott at kpov.org >> msmtp: account gmail not found: no configuration file available >> >> If msmtp cannot find its rc file in /home/icecast2, then maybe there >> is a way to specify the location. >> >> -- >> Jack Elliott >> Director of Classical Music Programming >> High Desert Community Radio >> KPOV Bend, Oregon >> On 9/20/23 10:35 AM, Jordan Erickson wrote: >>> Hi Jack, >>> >>> Have you tried, as the icecast2 user, interactively using the msmtp >>> command instead of with your script? Try this, it will narrow down >>> the variables. Also, check to see if your iceast2 user has the >>> required group membership(s), if any, to send mail from that machine. >>> >>> >>> Cheers, >>> Jordan Erickson >>> >>> https://subj.am/ >>> On 9/20/23 10:32, Jack Elliott wrote: >>>> >>>> Thank you, Philipp Schafft, >>>> >>>> Okay my amateur bash script is badly written and I will clean it up. >>>> >>>> But I don't think my clumsy scripting explains why I can run the >>>> script as user kpovdjs, but not as user icecast2? >>>> >>>> It uses /usr/bin/msptp and >>>> >>>> kpovdjs at Icecast-Pi:~/bin $ ls -l /usr/bin/msmtp >>>> -rwxr-xr-x 1 root root 83848 Jun 19? 2014 /usr/bin/msmtp >>>> >>>> So that isn't a problem. >>>> >>>> And the script: >>>> >>>> kpovdjs at Icecast-Pi:~/bin $ ls -l email_onconnect.sh >>>> -rwxrwxrwx 1 kpovdjs kpovdjs 422 Sep 20 10:08 email_onconnect.sh >>>> >>>> Yes, I have tried running the script as user kpovdjs and it works. >>>> And the same command as user icecast2 does not work and does not >>>> make an error message. >>>> >>>> Thomas Zumbrunnen wonders about my mount point definition, this is it: >>>> >>>> ? >>>> ??????? /stream >>>> ??????? /fallbacks/Generic_Silence_192kbps_48kHz.mp3 >>>> ??????? 1 >>>> ??????? 1 >>>> ???????? 65535 >>>> ??????? /home/kpovdjs/bin/email_onconnect.sh >>>> ??????? /home/kpovdjs/bin/email_ondisconnect.sh >>>> ??????? 1 >>>> ??? >>>> >>>> Thank you, everyone! >>>> >>>> -- >>>> Jack Elliott >>>> Director of Classical Music Programming >>>> High Desert Community Radio >>>> KPOV Bend, Oregon >>>> On 9/20/23 8:44 AM, Philipp Schafft wrote: >>>>> Good morning, >>>>> >>>>> On Wed, 2023-09-20 at 08:24 -0700, Jack Elliott wrote: >>>>>> Hi all, >>>>>> I am still trying to debug this. Summary, I am using in >>>>>> my icecast.xml to launch an email when a source-client connects. >>>>>> Here is the line in icecast.xml: >>>>>> /home/kpovdjs/bin/email_onconnect.sh >>>>>> The problem is that this script doesn't do anything when icecast runs >>>>>> it. >>>>>> The script works if I run it as user kpovdjs (me). But if I su to >>>>>> user icecast2, it does nothing. >>>>>> "email_onconnect.sh" is: >>>>>> #!/bin/bash >>>>>> set -x >>>>>> >>>>>> #thatjackelliott at kpov.org >>>>>> >>>>>> printf "To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nS >>>>>> ubject: 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/kpovdjs/bin/on_connect.txt >>>>>> /usr/bin/msmtpthatjackelliott at kpov.org < >>>>>> /home/kpovdjs/bin/on_connect.txt >/home/kpovdjs/bin/msmtp.log 2>&1 >>>>> Your printf is wrong here. >>>>> NEVER do something like: printf "bla $blubb bla\n"; >>>>> ALWAYS do: printf "bla %s bla\n" "$blubb"; >>>>> >>>>> That is exactly why we use printf in the first place. This is the >>>>> reason it exists. >>>>> >>>>> Also you can just pipe your output between the commands. No need for a >>>>> tempfile (which also adds many problems, from permissions to race >>>>> conditions). >>>>> >>>>> >>>>>> If I run it as user kpovdjs (me), it sends the email, and this is the >>>>>> debug output: >>>>>> kpovdjs at Icecast-Pi:~/bin $ ./email_onconnect.sh >>>>>> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\ >>>>>> nSubject: Remote host has connected to mountpoint on the >>>>>> Backstream\n\n KPOV Icecast server on IcecastPi has detected a >>>>>> connection on the backstream.' >>>>>> + /usr/bin/msmtpthatjackelliott at kpov.org >>>>>> But as user icecast2, the debug output is the same, but no email >>>>>> sent: >>>>>> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh >>>>>> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\ >>>>>> nSubject: Remote host has connected to mountpoint on the >>>>>> Backstream\n\n KPOV Icecast server on IcecastPi has detected a >>>>>> connection on the backstream.' >>>>>> + /usr/bin/msmtpthatjackelliott at kpov.org >>>>> Are you sure /usr/bin/msmtp works as the Icecast user? >>>>> Have you tried to run that script as the same user as Icecast? >>>>> e.g.: sudo -u icecast /path/to/script >>>>> >>>>> >>>>>> For debug purposes, I have rwxrwxrwx permission set from / and down >>>>>> to and including the script. >>>>>> -rwxrwxrwx 1 kpovdjs kpovdjs 414 Sep 17 10:59 email_onconnect.sh >>>>> I hope that is a really really bad joke. >>>>> >>>>> >>>>>> For further debug purposes, I made a copy of the .sh script and >>>>>> chowned it to user icecast2. >>>>>> -rwxr-xr-x 1 icecast2 icecast 414 Sep 20 08:08 >>>>>> email_onconnect_usericecast2.sh >>>>>> It also does not send the email when I invoke it as user icecast2. >>>>>> The "set -x" debug output is the same. >>>>>> At this point it seems that this is not a icecast issue, per se, but >>>>>> some sneaky subtle weird annoying little Linux thing. However, if >>>>>> anyone here has an idea on how I might solve it, it would be very >>>>>> much appreciated. >>>>> Not the wording I would use. >>>>> >>>>> You could check Icecast's error.log to see if it reports a problem. >>>>> >>>>> Other than that you really first need to establish that the script >>>>> actually works running as that user. >>>>> >>>>> >>>>>> Thank you! >>>>>> =========================== >>>>>> >>>>>> Very cool, I haven't encountered the "set -x" debug flag before. >>>>>> However, the output isn't as interesting as I hoped: >>>>>> >>>>>> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh >>>>>> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nS >>>>>> ubject: Remote host has connected to mountpoint on the Backstream\n\n >>>>>> KPOV Icecast server on IcecastPi has detected a connection on the >>>>>> backstream.' >>>>>> + /usr/bin/msmtpthatjackelliott at kpov.org >>>>>> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ >>>>>> >>>>>> Thank you! >>>>>> >>>>>>> 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/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 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 or 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/ >>>> >>>> _______________________________________________ >>>> 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 > > > _______________________________________________ > Icecast mailing list > Icecast at xiph.org > http://lists.xiph.org/mailman/listinfo/icecast -------------- next part -------------- An HTML attachment was scrubbed... URL: From jordan at subj.am Wed Sep 20 20:43:46 2023 From: jordan at subj.am (Jordan Erickson) Date: Wed, 20 Sep 2023 13:43:46 -0700 Subject: [Icecast] SOLVED Re: Edited: / not working In-Reply-To: <541dadbd-7de8-a2a9-c7a2-44203aa37678@kpov.org> References: <0ed1e99b-e780-e4a4-c206-5e03543ba496@kpov.org> <68d4dadd-108f-933a-fad2-8b14e30772d7@kpov.org> <60932c58-d542-ed99-a719-8870da6dda65@subj.am> <29d0a3d3-1b1d-361f-3f6e-355ad1d73db5@kpov.org> <192abebe-ee3a-45f8-af67-257177c9a6b3@Spark> <80ffb48ae7ffb2a4922c3e923513a4927d13ca21.camel@de.loewenfelsen.net> <6bba1eff-a503-7e04-444e-97143efdbee8@kpov.org> <05b27e6e-c2bf-8867-330d-b12a8880d3ad@subj.am> <07e86cdd-66f1-308c-eea8-eb133c744205@kpov.org> <29b3f775-60c6-7178-f159-353448546f3b@subj.am> <541dadbd-7de8-a2a9-c7a2-44203aa37678@kpov.org> Message-ID: Hey Jack, good work. Now your next task is to please, *please* clean up all user/file permissions so if anyone at all has access to a shell on this system they can't simply wreak havoc on all your hard work :) Cheers, Jordan Erickson https://subj.am/ On 9/20/23 13:28, Jack Elliott wrote: > > Thank you, Jordan. > > It now works. For the next icecast user who needs to get an > script to run, I am leaving this here. > > Okay, icecast2 is not human user, so no /home directory for it. > > /etc/passwd tells me: > > icecast2:x:112:119::/usr/share/icecast2:/bin/false > > So I copy the working (for my user kpovdjs) /home/kpovdjs/.msmtprc > file to /usr/share/icecast2 , and change owner to user icecast2 > > kpovdjs at Icecast-Pi:~ $ ls -la /usr/share/icecast2 > total 20 > drwxr-xr-x 4 root root 4096 Sep 20 11:31 . > drwxr-xr-x 205 root root 4096 Jul 13 2022 .. > drwxr-xr-x 2 root root 4096 Apr 22 2017 admin > -rw-rw-rw- 1 icecast2 root 332 Sep 20 11:31 .msmtprc > drwxr-xr-x 3 kpovdjs root 4096 May 12 2017 web > > So, > > icecast2 at Icecast-Pi:/home/kpovdjs$ echo "hello there username." | msmtp -a gmailthatjackelliott at kpov.org > msmtp: /usr/share/icecast2/.msmtprc: must have no more than user read/write permissions > > But now msmtp finds the rc file! So chmod 600 to .msmtprc to get > > -rw-------?? 1 icecast2 root? 332 Sep 20 11:31 .msmtprc > > and try again . . . and . . . it works! email received. One minor > permissions issue, > > msmtp: cannot log to /home/kpovdjs/bin/msmtp_logfile.log: cannot open: Permission denied > > So as owner of the logfile.log: > > chmod 666 /home/kpovdjs/bin/msmtp_logfile.log > > And all is good. > > Many thanks to you and the others who helped me debug this routine. > Have a good day! > > -- > Jack Elliott > Director of Classical Music Programming > High Desert Community Radio > KPOV Bend, Oregon > On 9/20/23 11:18 AM, Jordan Erickson wrote: >> You need to put that msmtp config file in Icecast user's configured >> home directory. Look in /etc/passwd for that or just 'cd ~' as >> Icecast user. It's likely not /home/icecast2 if you had to create it >> yourself manually. >> >> >> Cheers, >> Jordan Erickson >> >> https://subj.am/ >> On 9/20/23 11:11, Jack Elliott wrote: >>> >>> Hi Jordan, thank you for the suggestion to try msmtp directly as >>> user icecast2 >>> >>> First I try as user kpovdjs (me): >>> >>> kpovdjs at Icecast-Pi:~/bin $ echo "hello there username." | msmtp -a gmailthatjackelliott at kpov.org >>> >>> This does send the email. >>> >>> Now su to user icecast2 >>> >>> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ echo "hello there username." | msmtp -a gmailthatjackelliott at kpov.org >>> msmtp: account gmail not found: no configuration file available >>> >>> Interesting. For user kpovdjs, msmtp finds account information in >>> /home/kpovdjs/.msmtprc >>> >>> But as user icecast2, there is no .msmtprc file in /home/icecast2 >>> >>> In fact, there is no icecast2 folder in /home >>> >>> So I create /home/icecast2 >>> >>> I copy my user .msmtprc to /home/icecast2 >>> >>> icecast2 at Icecast-Pi:/home/kpovdjs$ ls -la /home/icecast2 >>> total 12 >>> drwxr-xr-x 2 icecast2 root 4096 Sep 20 10:57 . >>> drwxr-xr-x 5 root???? root 4096 Sep 20 10:51 .. >>> -rw-r--r-- 1 icecast2 root? 332 Sep 20 10:57 .msmtprc >>> >>> Now I try again: >>> >>> icecast2 at Icecast-Pi:/home/kpovdjs$ echo "hello there username." | msmtp -a gmailthatjackelliott at kpov.org >>> msmtp: account gmail not found: no configuration file available >>> >>> If msmtp cannot find its rc file in /home/icecast2, then maybe there >>> is a way to specify the location. >>> >>> -- >>> Jack Elliott >>> Director of Classical Music Programming >>> High Desert Community Radio >>> KPOV Bend, Oregon >>> On 9/20/23 10:35 AM, Jordan Erickson wrote: >>>> Hi Jack, >>>> >>>> Have you tried, as the icecast2 user, interactively using the msmtp >>>> command instead of with your script? Try this, it will narrow down >>>> the variables. Also, check to see if your iceast2 user has the >>>> required group membership(s), if any, to send mail from that machine. >>>> >>>> >>>> Cheers, >>>> Jordan Erickson >>>> >>>> https://subj.am/ >>>> On 9/20/23 10:32, Jack Elliott wrote: >>>>> >>>>> Thank you, Philipp Schafft, >>>>> >>>>> Okay my amateur bash script is badly written and I will clean it up. >>>>> >>>>> But I don't think my clumsy scripting explains why I can run the >>>>> script as user kpovdjs, but not as user icecast2? >>>>> >>>>> It uses /usr/bin/msptp and >>>>> >>>>> kpovdjs at Icecast-Pi:~/bin $ ls -l /usr/bin/msmtp >>>>> -rwxr-xr-x 1 root root 83848 Jun 19? 2014 /usr/bin/msmtp >>>>> >>>>> So that isn't a problem. >>>>> >>>>> And the script: >>>>> >>>>> kpovdjs at Icecast-Pi:~/bin $ ls -l email_onconnect.sh >>>>> -rwxrwxrwx 1 kpovdjs kpovdjs 422 Sep 20 10:08 email_onconnect.sh >>>>> >>>>> Yes, I have tried running the script as user kpovdjs and it works. >>>>> And the same command as user icecast2 does not work and does not >>>>> make an error message. >>>>> >>>>> Thomas Zumbrunnen wonders about my mount point definition, this is it: >>>>> >>>>> ? >>>>> ??????? /stream >>>>> ??????? /fallbacks/Generic_Silence_192kbps_48kHz.mp3 >>>>> ??????? 1 >>>>> ??????? 1 >>>>> ???????? 65535 >>>>> ??????? /home/kpovdjs/bin/email_onconnect.sh >>>>> ??????? /home/kpovdjs/bin/email_ondisconnect.sh >>>>> ??????? 1 >>>>> ??? >>>>> >>>>> Thank you, everyone! >>>>> >>>>> -- >>>>> Jack Elliott >>>>> Director of Classical Music Programming >>>>> High Desert Community Radio >>>>> KPOV Bend, Oregon >>>>> On 9/20/23 8:44 AM, Philipp Schafft wrote: >>>>>> Good morning, >>>>>> >>>>>> On Wed, 2023-09-20 at 08:24 -0700, Jack Elliott wrote: >>>>>>> Hi all, >>>>>>> I am still trying to debug this. Summary, I am using in >>>>>>> my icecast.xml to launch an email when a source-client connects. >>>>>>> Here is the line in icecast.xml: >>>>>>> /home/kpovdjs/bin/email_onconnect.sh >>>>>>> The problem is that this script doesn't do anything when icecast runs >>>>>>> it. >>>>>>> The script works if I run it as user kpovdjs (me). But if I su to >>>>>>> user icecast2, it does nothing. >>>>>>> "email_onconnect.sh" is: >>>>>>> #!/bin/bash >>>>>>> set -x >>>>>>> >>>>>>> #thatjackelliott at kpov.org >>>>>>> >>>>>>> printf "To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nS >>>>>>> ubject: 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/kpovdjs/bin/on_connect.txt >>>>>>> /usr/bin/msmtpthatjackelliott at kpov.org < >>>>>>> /home/kpovdjs/bin/on_connect.txt >/home/kpovdjs/bin/msmtp.log 2>&1 >>>>>> Your printf is wrong here. >>>>>> NEVER do something like: printf "bla $blubb bla\n"; >>>>>> ALWAYS do: printf "bla %s bla\n" "$blubb"; >>>>>> >>>>>> That is exactly why we use printf in the first place. This is the >>>>>> reason it exists. >>>>>> >>>>>> Also you can just pipe your output between the commands. No need for a >>>>>> tempfile (which also adds many problems, from permissions to race >>>>>> conditions). >>>>>> >>>>>> >>>>>>> If I run it as user kpovdjs (me), it sends the email, and this is the >>>>>>> debug output: >>>>>>> kpovdjs at Icecast-Pi:~/bin $ ./email_onconnect.sh >>>>>>> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\ >>>>>>> nSubject: Remote host has connected to mountpoint on the >>>>>>> Backstream\n\n KPOV Icecast server on IcecastPi has detected a >>>>>>> connection on the backstream.' >>>>>>> + /usr/bin/msmtpthatjackelliott at kpov.org >>>>>>> But as user icecast2, the debug output is the same, but no email >>>>>>> sent: >>>>>>> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh >>>>>>> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\ >>>>>>> nSubject: Remote host has connected to mountpoint on the >>>>>>> Backstream\n\n KPOV Icecast server on IcecastPi has detected a >>>>>>> connection on the backstream.' >>>>>>> + /usr/bin/msmtpthatjackelliott at kpov.org >>>>>> Are you sure /usr/bin/msmtp works as the Icecast user? >>>>>> Have you tried to run that script as the same user as Icecast? >>>>>> e.g.: sudo -u icecast /path/to/script >>>>>> >>>>>> >>>>>>> For debug purposes, I have rwxrwxrwx permission set from / and down >>>>>>> to and including the script. >>>>>>> -rwxrwxrwx 1 kpovdjs kpovdjs 414 Sep 17 10:59 email_onconnect.sh >>>>>> I hope that is a really really bad joke. >>>>>> >>>>>> >>>>>>> For further debug purposes, I made a copy of the .sh script and >>>>>>> chowned it to user icecast2. >>>>>>> -rwxr-xr-x 1 icecast2 icecast 414 Sep 20 08:08 >>>>>>> email_onconnect_usericecast2.sh >>>>>>> It also does not send the email when I invoke it as user icecast2. >>>>>>> The "set -x" debug output is the same. >>>>>>> At this point it seems that this is not a icecast issue, per se, but >>>>>>> some sneaky subtle weird annoying little Linux thing. However, if >>>>>>> anyone here has an idea on how I might solve it, it would be very >>>>>>> much appreciated. >>>>>> Not the wording I would use. >>>>>> >>>>>> You could check Icecast's error.log to see if it reports a problem. >>>>>> >>>>>> Other than that you really first need to establish that the script >>>>>> actually works running as that user. >>>>>> >>>>>> >>>>>>> Thank you! >>>>>>> =========================== >>>>>>> >>>>>>> Very cool, I haven't encountered the "set -x" debug flag before. >>>>>>> However, the output isn't as interesting as I hoped: >>>>>>> >>>>>>> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ ./email_onconnect.sh >>>>>>> + printf 'To:thatjackelliott at kpov.org\nFrom:kpovcomputer at gmail.com\nS >>>>>>> ubject: Remote host has connected to mountpoint on the Backstream\n\n >>>>>>> KPOV Icecast server on IcecastPi has detected a connection on the >>>>>>> backstream.' >>>>>>> + /usr/bin/msmtpthatjackelliott at kpov.org >>>>>>> icecast2 at Icecast-Pi:/home/kpovdjs/bin$ >>>>>>> >>>>>>> Thank you! >>>>>>> >>>>>>>> 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/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 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 or 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/ >>>>> >>>>> _______________________________________________ >>>>> 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 >> >> >> _______________________________________________ >> 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: From that.jack.elliott at gmail.com Thu Sep 21 13:57:22 2023 From: that.jack.elliott at gmail.com (Jack Elliott) Date: Thu, 21 Sep 2023 06:57:22 -0700 Subject: [Icecast] When switching from source client to fallback and back glitches listen client In-Reply-To: References: <6f0081b5-3a20-9db3-56c2-bc95002f6df2@kpov.org> <6BB29E53-E9AA-4074-A6B3-9E3C2E45BF46@paravelsystems.com> Message-ID: @Dik .... Thank you for the suggestion. I've glanced over the documentation for Liquidsoap a few times and it looks like a powerful tool with a learning curve. I didn't see a good reason to use it for our simple needs, but if it's what I have to use to paper over the rough switching from a live remote host's Icecast stream to a local fallback file, then I reckon I'll need to get into it. This forum is not the place for Liquidsoap so I'll shift over to a more appropriate place to learn more. -- Jack Elliott Director of Classical Music Programming High Desert Community Radio KPOV Bend, Oregon On 9/20/23 9:27 AM, Dik .... wrote: > I suggest you look at Liquidsoap.? Particularly mksafe which can merge > files together into a single stream and stop clients from disconnecting > > https://www.liquidsoap.info/doc-2.2.0/quick_start.html#that-source-is-fallible > > > ------------------------------------------------------------------------ > *From:* Icecast on behalf of Fred Gleason > > *Sent:* 18 September 2023 16:09 > *To:* thatjackelliott at kpov.org ; Icecast > streaming server user discussions > *Subject:* Re: [Icecast] When switching from source client to fallback > and back glitches listen client > On Sep 16, 2023, at 13:58, Jack Elliott > wrote: > >> I've noticed that when a source-client disconnects from the >> mountpoint and the mountpoint switches to its specified >> fallback-client, some listen-clients disconnect, or close, or >> otherwise glitch. Same thing when a remote source-client connects, >> dropping the fallback--the listen-client can glitch. >> >> The fallback is an mp3 encoded at the same sample rate and bitrate as >> the remote source-client. >> >> It shouldn't glitch stream players just because it swaps sources, >> should it? > > I suspect that what is going on is that the two streams (original and > fallback) are not precisely synchronized, which means that the decoder > will likely lose framing when switching to the fallback bitstream and > hence mute or otherwise glitch while reacquiring same. I?m pretty sure > that this is a consequence of the basic architecture of the Icecast > system. > > Cheers! > > > |---------------------------------------------------------------------| > | Frederick F. Gleason, Jr. | ? ? ? ? ? ? Chief Developer ? ? ? ? ? | > | ? ? ? ? ? ? ? ? ? ? | ? ? ? ? ? ? Paravel Systems ? ? | > |---------------------------------------------------------------------| > | ? A room without books is like a body without a soul. ? ? | > | ? ? | > | ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? -- Cicero ? | > |---------------------------------------------------------------------| > > _______________________________________________ > Icecast mailing list > Icecast at xiph.org > http://lists.xiph.org/mailman/listinfo/icecast -------------- next part -------------- An HTML attachment was scrubbed... URL: