After all the discussion last week, I finally decided to put my own connect / disconnect scripts in on my server, as well as make some changes to the house keeping. I'm now running my icecast server under chown, and as a user (instead of nobody). Chown and the user seem to be functioning fine. But, for some reason, Icecast cannot find my connect & disconnect scripts, even though the exist. They are .sh scripts and have 755 permissions. Running the scripts directly from shell work fine. But Icecast will always spit out an error that it can't find the connect or disconnect script. I've even put the scripts in the chown root, but no luck there either. Can someone help me figure out why icecast can't find my scripts? SSH: root at xx [/home/<user>]# icecast -c /home/<user>/icecast/<config>.xml Changed root successfully to "/home/<user>/icecast". Changed groupid to 5##. Changed userid to 5##. error.log: [2013-08-01 20:51:10] WARN main/main YP server handling has been disabled [2013-08-01 20:51:16] EROR source/source_run_script Unable to run command connect.sh (No such file or directory) [2013-08-01 20:51:21] EROR source/source_run_script Unable to run command disconnect (No such file or directory) Thanks for the help Phil By The way, I've extended the bash file to include different e-mail addresses for different feeds. #!/bin/bash # # W2LIE Icecast Connect / Disconnect Parameters File # Use for notification system # # Rev .01 # # #Set the date and Time date="$(date '+%B %d,%Y')" time="$(date +%H%M)" # Set the Connect and Disconnect Subject Lines SUBJECT="Stream $1 connected" # Set our Delivery E-mail Addresses per feed if [[ $1 == "<feed a>" ]] || [[ $1 == "<feed b>" ]]; then email="email at address.tld email at address.tld" elif [[ $1 == "<feed c>" ]]; then email="email at address.tld email at address.tld" elif [[ $1 == "<feed d>" ]]; then email="email at address.tld email at address.tld" elif [[ $1 == "<feed e>" ]]; then email="email at address.tld email at address.tld" elif [[ $1 == "<feed f>" ]]; then email="email at address.tld email at address.tld email at address.tld" elif [[ $1 == "<feed g>" ]]; then email="email at address.tld email at address.tld" elif [[ $1 == "<feed h>" ]]; then email="email at address.tld email at address.tld" elif [[ $1 == "<feed i>" ]] || [[ $1 == "<feed j>" ]]; then email="email at address.tld email at address.tld" else email="email at address.tld" fi # Set the Connect and Disconnect Messages echo -e "Hello,\nThis is an automatic notification from W2LIE.net.\nThe ${1} Live Scanner Feed has connected to the server on ${date} at ${time}hrs.\n\nThank you,\nPhil / w2lie" > /home/<user>/icecast/scripts/${1}_connect.txt # send an email using /bin/mail /bin/mail -s "${SUBJECT}" ${email} < /home/<user>/icecast/scripts/${1}_connect.txt #EOF
Greetings, On Thursday, August 01, 2013 05:05:27 PM Phil - w2lie wrote:> Can someone help me figure out why icecast can't find my scripts? >[...snipped...]> > error.log: > > [2013-08-01 20:51:10] WARN main/main YP server handling has been disabled > [2013-08-01 20:51:16] EROR source/source_run_script Unable to run > command connect.sh (No such file or directory) > [2013-08-01 20:51:21] EROR source/source_run_script Unable to run > command disconnect (No such file or directory)Be very sure that the scripts are available inside the chroot. Also make sure that the path to bash is correct, and that it is available under chroot. I assume you meant "chroot" when you said "chown"> > Thanks for the help > > Phil >Regards, J
GE DR OM Phil, On 08/01/2013 09:05 PM, Phil - w2lie wrote:> After all the discussion last week, I finally decided to put my own > connect / disconnect scripts in on my server, as well as make some > changes to the house keeping. > > I'm now running my icecast server under chown, and as a user (instead of > nobody). Chown and the user seem to be functioning fine.I guess you mean chown and chroot? Or just chown, but no chroot?> But, for some reason, Icecast cannot find my connect & disconnect > scripts, even though the exist. They are .sh scripts and have 755 > permissions. Running the scripts directly from shell work fine. But > Icecast will always spit out an error that it can't find the connect or > disconnect script. I've even put the scripts in the chown root, but no > luck there either. > > Can someone help me figure out why icecast can't find my scripts? > > SSH: > root at xx [/home/<user>]# icecast -c /home/<user>/icecast/<config>.xml > Changed root successfully to "/home/<user>/icecast". > Changed groupid to 5##. > Changed userid to 5##.That looks like chown and chroot.> error.log: > > [2013-08-01 20:51:10] WARN main/main YP server handling has been disabled > [2013-08-01 20:51:16] EROR source/source_run_script Unable to run > command connect.sh (No such file or directory) > [2013-08-01 20:51:21] EROR source/source_run_script Unable to run > command disconnect (No such file or directory)/if/ I read this correctly, then this would mean, that it tries to run connect.sh in the root directory of your chroot, so /connect.sh and when seen from outside /home/<user>/icecast/connect.sh Are there any security features on this system, that might interfere? SELinux? AppArmor? If all else fails, try to run this instead: strace icecast -c /home/<user>/icecast/<config>.xml This might have some hints about what's going wrong. Another approach might be to just try and see for yourself. Something like this should work as root: chroot /home/<user>/icecast/ su user ls -la /connect.sh /connect.sh Hope that helps, 73 es 55 Thomas
Hello Phil, Just to confirm, are you sure the scripts' path in config file is relative to the chroot directory? When you chroot an executable, you are changing the root directory to the configured path, so you have to account for that in the config file. El 01/08/2013 23:05, "Phil - w2lie" <w2lie at w2lie.net> escribi?:> After all the discussion last week, I finally decided to put my own > connect / disconnect scripts in on my server, as well as make some > changes to the house keeping. > > I'm now running my icecast server under chown, and as a user (instead of > nobody). Chown and the user seem to be functioning fine. > > But, for some reason, Icecast cannot find my connect & disconnect > scripts, even though the exist. They are .sh scripts and have 755 > permissions. Running the scripts directly from shell work fine. But > Icecast will always spit out an error that it can't find the connect or > disconnect script. I've even put the scripts in the chown root, but no > luck there either. > > Can someone help me figure out why icecast can't find my scripts? > > SSH: > root at xx [/home/<user>]# icecast -c /home/<user>/icecast/<config>.xml > Changed root successfully to "/home/<user>/icecast". > Changed groupid to 5##. > Changed userid to 5##. > > error.log: > > [2013-08-01 20:51:10] WARN main/main YP server handling has been disabled > [2013-08-01 20:51:16] EROR source/source_run_script Unable to run > command connect.sh (No such file or directory) > [2013-08-01 20:51:21] EROR source/source_run_script Unable to run > command disconnect (No such file or directory) > > > > Thanks for the help > > Phil > > By The way, I've extended the bash file to include different e-mail > addresses for different feeds. > > #!/bin/bash > # > # W2LIE Icecast Connect / Disconnect Parameters File > # Use for notification system > # > # Rev .01 > # > # > > #Set the date and Time > date="$(date '+%B %d,%Y')" > time="$(date +%H%M)" > > > # Set the Connect and Disconnect Subject Lines > SUBJECT="Stream $1 connected" > > > # Set our Delivery E-mail Addresses per feed > if [[ $1 == "<feed a>" ]] || [[ $1 == "<feed b>" ]]; then > email="email at address.tld email at address.tld" > > elif [[ $1 == "<feed c>" ]]; then > email="email at address.tld email at address.tld" > > elif [[ $1 == "<feed d>" ]]; then > email="email at address.tld email at address.tld" > > elif [[ $1 == "<feed e>" ]]; then > email="email at address.tld email at address.tld" > > elif [[ $1 == "<feed f>" ]]; then > email="email at address.tld email at address.tld email at address.tld" > > elif [[ $1 == "<feed g>" ]]; then > email="email at address.tld email at address.tld" > > elif [[ $1 == "<feed h>" ]]; then > email="email at address.tld email at address.tld" > > elif [[ $1 == "<feed i>" ]] || [[ $1 == "<feed j>" ]]; then > email="email at address.tld email at address.tld" > > else email="email at address.tld" > fi > > # Set the Connect and Disconnect Messages > echo -e "Hello,\nThis is an automatic notification from W2LIE.net.\nThe > ${1} Live Scanner Feed has connected to the server on ${date} at > ${time}hrs.\n\nThank you,\nPhil / w2lie" > > /home/<user>/icecast/scripts/${1}_connect.txt > > # send an email using /bin/mail > /bin/mail -s "${SUBJECT}" ${email} < > /home/<user>/icecast/scripts/${1}_connect.txt > > #EOF > > > _______________________________________________ > 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/20130801/590c0979/attachment.htm
Hi All, thanks for the replies so far.. I will try to address as many of them as I can in a group reply: Xabier Oneca -- xOneca wrote: Just to confirm, are you sure the scripts' path in config file is relative to the chroot directory? - Yes, I am working under the new path names in my xml file. The Web, Admin, and Log directories all work as planned. The shell files are in the same path. Jeff, I believe that answers your question as well. "Thomas B. R?cker" wrote: I guess you mean chown and chroot? Or just chown, but no chroot? /if/ I read this correctly, then this would mean, that it tries to run connect.sh in the root directory of your chroot, so /connect.sh and when seen from outside/home/<user>/icecast/connect.sh Are there any security features on this system, that might interfere? SELinux? AppArmor? If all else fails, try to run this instead: strace icecast -c/home/<user>/icecast/<config>.xml =- I was running both options, chroot and chown/grp. I first ran under a chown/chgrp config in my xml. I then added in the chroot flag to see if that had helped. I don't think I gained any ground, because when I try and chroot from shell, I see this: [~]# chroot /home/<user>/icecast chroot: cannot run command `/bin/bash': No such file or directory So let's just assume I should crawl before I can run. From here on out I guess I'll leave chroot flag at 0 My chroot directory was setup as /home/<user>/icecast The scripts are in /home/<user>/icecast so in my xml I just reference /connect.sh as the script to run (no path). When I don't chroot, I call script /home/<user>/icecast/connect.sh and that still can't be located. Yet, running a find ~ -name connect.sh from the user's account shows the full path just fine. SELinux is disabled. I don't believe I am running AppArmor. This is a CentOS VPS (which I probably should have stated earlier). I ran the strace. It is well over my head. If I capture it to a file, would you be willing to look it over for me? I'm no linux noob, but I'm no where near being an expert either. Thank you all for the help so far.. Phil -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/icecast/attachments/20130801/b1267355/attachment-0001.htm