LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-13-2009, 10:20 PM   #1
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,027

Rep: Reputation: 69
I can't get this rc.local script to run


Code:
#!/bin/sh
#
# /etc/rc.d/rc.local:  Local system initialization script.
#
# Put any local startup commands in here.  Also, if you have
# anything that needs to be run at shutdown time you can
# make an /etc/rc.d/rc.local_shutdown script and put those
# commands in there.

# Start VLC ( streaming )
if [ -x /usr/sbin/cvlc ]; then
        /usr/sbin/cvlc /var/www/htdocs/music/ --loop --quiet --sout '#transcode{ab=64}:standard{access=http,mux=ps,dst=192.168.1.111:8000/stream.mp3}'
fi


# Start the PostgreSQL database:
if [ -x /etc/rc.d/rc.postgresql ]; then
   /etc/rc.d/rc.postgresql start
fi

# Start ProFTPD:
if [ -x /usr/sbin/proftpd ]; then
   /usr/sbin/proftpd
fi
The VLC one doesn't work. The postgres and proftpd work fine so I know that the vlc one did not interrupt the flow. I normally start up that command by being in the /var/www/htdocs/music directory with this command
Code:
cvlc . --loop --quiet --sout '#transcode{ab=64}:standard{access=http,mux=ps,dst=192.168.1.111:8000/stream.mp3}' &
I just can't seem to get it working.

Last edited by trist007; 12-13-2009 at 10:22 PM.
 
Old 12-13-2009, 10:31 PM   #2
worm5252
Member
 
Registered: Oct 2004
Location: Atlanta
Distribution: CentOS, RHEL, HP-UX, OS X
Posts: 567

Rep: Reputation: 57
Not sure what you are trying to do with vlc here other than stream music from your local server. Why don't you just open the stream?

Code:
# Start VLC ( streaming )
if [ -x /usr/sbin/vlc ]; then
        /usr/sbin/vlc http://192.168.1.111:8000/stream.mp3 
fi
 
Old 12-13-2009, 10:36 PM   #3
xode
Member
 
Registered: Aug 2003
Distribution: Mandrake 9.0; FC4; FC8; SUSE 10.3; SUSE 12.1; SUSE 13.2
Posts: 598
Blog Entries: 1

Rep: Reputation: 45
Possibly try redirecting its output to a file that you can later examine to see what error it gives you if any, as for example:

Code:
/usr/sbin/cvlc /var/www/htdocs/music/ --loop --quiet --sout '#transcode{ab=64}:standard{access=http,mux=ps,dst=192.168.1.111:8000/stream.mp3}' > /var/tmp/debug.txt
 
Old 12-13-2009, 10:51 PM   #4
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,027

Original Poster
Rep: Reputation: 69
Code:
/usr/sbin/cvlc /var/www/htdocs/music/ --loop --quiet --sout'#transcode{ab=64}:standard{access=http,mux=ps,dst=192.168.1.111:8000/stream.mp3}'
I call cvlc and I play the mp3 files in /var/www/htdocs/music/ with the parameters afterwards. I just call the stream.mp3 for MIME purposes.
 
Old 12-13-2009, 11:00 PM   #5
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,027

Original Poster
Rep: Reputation: 69
omg never mind, the binary was in /usr/bin lol.

However, the script seems to end at that point and does not load up the postgresql or proftpd.

Does the output to > debug.txt terminate the script? I'm gonna try appending '&'

Yea that fixed it.

Last edited by trist007; 12-13-2009 at 11:06 PM.
 
Old 12-14-2009, 11:41 AM   #6
xode
Member
 
Registered: Aug 2003
Distribution: Mandrake 9.0; FC4; FC8; SUSE 10.3; SUSE 12.1; SUSE 13.2
Posts: 598
Blog Entries: 1

Rep: Reputation: 45
Quote:
Originally Posted by trist007 View Post
omg never mind, the binary was in /usr/bin lol.

However, the script seems to end at that point and does not load up the postgresql or proftpd.

Does the output to > debug.txt terminate the script? I'm gonna try appending '&'

Yea that fixed it.
What does debug.txt say? If it shows no errors, you can remove the "> debug.txt" if you want.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
script (to mount smb) doesn't run from rc.local and only works on some machines WhyWontThisWork Linux - Software 11 11-30-2008 08:57 PM
script (to mount smb) doesn't run from rc.local and only works on some machines WhyWontThisWork Linux - Networking 1 11-29-2008 11:19 AM
How to run shell script from rc.local Anshul Pathak Linux - Newbie 5 11-24-2008 01:11 PM
clamd upgradation in remote mach through local mac by script to be run on local mach Narayandutt Programming 3 11-29-2006 11:00 AM
Error after editing /etc/rc/rc.local, Fedora freezes when tries to run the script simeandrews Fedora 1 06-24-2005 11:52 AM


All times are GMT -5. The time now is 10:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration