Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

on-connect doesn't work

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
ZeroEnna



Joined: 18 Jul 2009
Posts: 10

PostPosted: Tue Dec 29, 2009 7:24 am    Post subject: on-connect doesn't work Reply with quote

Hey guys,

after a very unsecure workaround for streamtranscoding (using oddsock's streamTranscoder), which has to be enable manually (via PHP exec), I would like to automate it.
But on-connect somehow doesn't work. The script isn't executed. Here is the corresponding excerpt from the config.xml:

Code:

<mount>
        <mount-name>/kibofmlive.ogg</mount-name>
        <password>********</password>
        <max-listeners>50</max-listeners>
        <dump-file>/tmp/dump-example1.ogg</dump-file>
        <burst-size>65536</burst-size>
        <fallback-mount>/kibofmbot.ogg</fallback-mount>
        <fallback-override>1</fallback-override>
        <fallback-when-full>1</fallback-when-full>
        <on-connect>/home/******/scstart.sh</on-connect>
        <on-disconnect>/home/*****/date.sh</on-disconnect>
        <intro>/example_intro.ogg</intro>
</mount>



Thank you in advance

Kind Regards

ZeroEnna
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Tue Dec 29, 2009 7:17 pm    Post subject: Reply with quote

Can you confirm that those mount setting do apply, ie the dump file is created for example. If so then can you show me the part of the error log that show that applying. You should see that pathname logged assuming the mount section is not commented out (also what platform are you using)

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ZeroEnna



Joined: 18 Jul 2009
Posts: 10

PostPosted: Wed Dec 30, 2009 5:26 pm    Post subject: Reply with quote

karlH wrote:
Can you confirm that those mount setting do apply, ie the dump file is created for example. If so then can you show me the part of the error log that show that applying. You should see that pathname logged assuming the mount section is not commented out (also what platform are you using)

karl.


Okay, I do have the dump-file! I am using Ubuntu Server 8.04 LTS.

Here is the log file excerpt:

Quote:

[2009-12-30 18:00:04] DBUG connection/connection_complete_source sources count is 1
[2009-12-30 18:00:04] DBUG source/source_apply_mount Applying mount information for "/kibofmlive.ogg"
[2009-12-30 18:00:04] DBUG source/source_apply_mount YP changed to 1
[2009-12-30 18:00:04] WARN stats/stats_event seen non-UTF8 data, probably incorrect metadata (server_description, Mehr Spaß, Mehr Japan, Mehr Musik!)
[2009-12-30 18:00:04] WARN source/source_apply_mount Cannot open intro file "/usr/share/icecast2/web//example_intro.ogg": No such file or directory
[2009-12-30 18:00:04] DBUG source/source_update_settings fallback /kibofmbot.ogg
[2009-12-30 18:00:04] DBUG source/source_update_settings intro file is /example_intro.ogg
[2009-12-30 18:00:04] DBUG source/source_update_settings Dumping stream to /tmp/dump-example1.ogg
[2009-12-30 18:00:04] DBUG source/source_update_settings connect script "/home/zeroenna/scstart.sh"
[2009-12-30 18:00:04] DBUG source/source_update_settings disconnect script "/home/zeroenna/date.sh"
[2009-12-30 18:00:04] DBUG source/source_update_settings public set to 1
[2009-12-30 18:00:04] DBUG source/source_update_settings max listeners to 50
[2009-12-30 18:00:04] DBUG source/source_update_settings queue size to 524288
[2009-12-30 18:00:04] DBUG source/source_update_settings burst size to 65536
[2009-12-30 18:00:04] DBUG source/source_update_settings source timeout to 10
[2009-12-30 18:00:04] DBUG source/source_update_settings fallback_when_full to 1
[2009-12-30 18:00:04] DBUG connection/connection_complete_source source is ready to start
[2009-12-30 18:00:04] DBUG fserve/fserve_add_client_callback Adding client to file serving engine
[2009-12-30 18:00:04] DBUG source/source_init Source creation complete
[2009-12-30 18:00:04] DBUG source/source_run_script Starting command /home/zeroenna/scstart.sh
[2009-12-30 18:00:04] DBUG stats/modify_node_event update node sources (2)
[2009-12-30 18:00:04] DBUG stats/process_source_event new source stat /kibofmlive.ogg
[2009-12-30 18:00:04] DBUG stats/process_source_event new node listenurl (http://kibofm.de:8000/kibofmlive.ogg)
[2009-12-30 18:00:04] DBUG stats/process_source_event new node listener_peak (0)


As far as I can analyse this, it seems everything's alright. But the script is obviously NOT executed, as I don't have a connection to the Shoutcast server running on the same machine under a different port (9000)
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Wed Dec 30, 2009 7:50 pm    Post subject: Reply with quote

[2009-12-30 18:00:04] DBUG source/source_run_script Starting command /home/zeroenna/scstart.sh

That means the script was started, the next thing to do is see where you get to in the scripting, see if the shell startup has an issue or whether there is a problem within the script. set -x tells the shell to report commands to stdout/err, maybe that will help to see how far it gets..

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ZeroEnna



Joined: 18 Jul 2009
Posts: 10

PostPosted: Fri Jan 01, 2010 6:02 pm    Post subject: Reply with quote

How do I redirect it to a file? The Script is like this:

Code:


#!/bin/sh



/home/zeroenna/streamtranscoderv3-3.1.11/streamTranscoderv3 /home/zeroenna/streamTranscoder_1.cfg > /dev/null &

Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Fri Jan 01, 2010 6:37 pm    Post subject: Reply with quote

a simple test to see if the script is working is to do

#!/bin/sh
echo "this script has started at" `date` > /tmp/logme

maybe /home/zeroenna/streamtranscoderv3-3.1.11/streamTranscoderv3 is unable to start up. eg not available in chroot or maybe try

/home/zeroenna/streamtranscoderv3-3.1.11/streamTranscoderv3 /home/zeroenna/streamTranscoder_1.cfg 1> /tmp/output 2>&1 &

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ZeroEnna



Joined: 18 Jul 2009
Posts: 10

PostPosted: Fri Jan 01, 2010 6:40 pm    Post subject: Reply with quote

The File stays empty.... I mean /tmp/output doesn't sghow anything
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Fri Jan 01, 2010 7:09 pm    Post subject: Reply with quote

maybe streamtranscoder does not produce any output, you didn't say whether the echo line reported anything in /tmp/logme. The fact that an empty file is created would indicate that chroot is not being used, so maybe it is something else like a permission issue if changeowner is being used (the /tmp file created would belong to a different user if so). If you show what is actually happening with the changes suggested then progress can be made.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ZeroEnna



Joined: 18 Jul 2009
Posts: 10

PostPosted: Fri Jan 01, 2010 7:19 pm    Post subject: Reply with quote

So Stream Transcoder DOES produce an output, when I run it without redirection, my Screen is full with status messages.
The file "logme" contains the echo line, so this part works!
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Fri Jan 01, 2010 7:32 pm    Post subject: Reply with quote

so it sounds like something streamtranscoder specific. From the information provided so far I would still suspect that icecast does not have the access rights to run streamtranscoder, probably because changeowner is being set to a user not allowed to run the program.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ZeroEnna



Joined: 18 Jul 2009
Posts: 10

PostPosted: Fri Jan 01, 2010 8:22 pm    Post subject: Reply with quote

What would you suggest? Should it be the same user icecast is running under?
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Fri Jan 01, 2010 8:56 pm    Post subject: Reply with quote

ls -l /tmp/logme

see what user/group that file has been created with, ask yourself, can that user run streamtranscoder. eg

[ ! -x /home/zeroenna/streamtranscoderv3-3.1.11/streamTranscoderv3 ] && echo no execute permission >> /tmp/logme && exit 1

All basic shell stuff that it's dependent on icecast.

I suppose it's possible that streamtranscoder is being terminated before really getting started, a sleep after the streamtranscoder line should test that. Without specifics it's hard to make vague guesses about other peoples applications.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
ZeroEnna



Joined: 18 Jul 2009
Posts: 10

PostPosted: Fri Jan 01, 2010 10:40 pm    Post subject: Reply with quote

Everything's running with root permissions, so I don't think there should be a problem. Even Icecast is running with root permission
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Fri Jan 01, 2010 11:33 pm    Post subject: Reply with quote

The icecast code we ship with specifically does not run with root permissions, you may start as root (for binding to low port numbers or chroot for example) but a non-root user is required for normal operation.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber