Jordan Erickson
2022-Jul-15  05:14 UTC
[Icecast] <on-connect> / <on-disconnect> not working
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: > > <mount type="normal"> > ??????? <mount-name>/my_stream</mount-name> > <fallback-mount>/fallbacks/my_fallback.mp3</fallback-mount> > ??????? <fallback-override>1</fallback-override> > ??????? <fallback-when-full>1</fallback-when-full> > *<on-connect>/home/my_username/bin/email_onconnect.sh</on-connect>** > **<on-disconnect>/home/my_username/bin/email_ondisconnect.sh</on-disconnect>* > ??????? <no-yp>1</no-yp> > ??? </mount> > > After putting the new <on-connect> and <on-disconnect> 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 > > <on-connect> calls /home/my_username/bin/email_onconnect.sh which > works from the command line. Likewise, <on-disconnect> 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-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xiph.org/pipermail/icecast/attachments/20220714/46116ec0/attachment.htm>
Hi Jordan, good idea! 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. Thank you! -- Jack Elliott Director of Classical Music Programming KPOV 88.9 FM High Desert Community Radio Bend, OR On 7/14/22 22:14, 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: >> >> <mount type="normal"> >> ??????? <mount-name>/my_stream</mount-name> >> <fallback-mount>/fallbacks/my_fallback.mp3</fallback-mount> >> ??????? <fallback-override>1</fallback-override> >> <fallback-when-full>1</fallback-when-full> >> *<on-connect>/home/my_username/bin/email_onconnect.sh</on-connect>** >> **<on-disconnect>/home/my_username/bin/email_ondisconnect.sh</on-disconnect>* >> ??????? <no-yp>1</no-yp> >> ??? </mount> >> >> After putting the new <on-connect> and <on-disconnect> 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 >> >> <on-connect> calls /home/my_username/bin/email_onconnect.sh which >> works from the command line. Likewise, <on-disconnect> 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: <http://lists.xiph.org/pipermail/icecast/attachments/20220715/dde5ddcb/attachment.htm>
Following. I've also not gotten <on-connect> / <on-disconnect>
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.
        
<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.
Is it possible that by having a fallback-mount (pointing to 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, 
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:
>>
>> <mount type="normal">
>> ??????? <mount-name>/my_stream</mount-name>
>> <fallback-mount>/fallbacks/my_fallback.mp3</fallback-mount>
>> ??????? <fallback-override>1</fallback-override>
>> <fallback-when-full>1</fallback-when-full>
>>
*<on-connect>/home/my_username/bin/email_onconnect.sh</on-connect>**
>>
**<on-disconnect>/home/my_username/bin/email_ondisconnect.sh</on-disconnect>*
>> ??????? <no-yp>1</no-yp>
>> ??? </mount>
>>
>> After putting the new <on-connect> and <on-disconnect>
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
>>
>> <on-connect> calls /home/my_username/bin/email_onconnect.sh which
>> works from the command line. Likewise, <on-disconnect> 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:
<http://lists.xiph.org/pipermail/icecast/attachments/20230916/fdf36724/attachment.htm>
Jack Elliott
2023-Sep-17  14:08 UTC
[Icecast] Edited: <on-connect> / <on-disconnect> not working
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.xiph.org/pipermail/icecast/attachments/20230917/1ce96102/attachment.htm>