Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-17-2014, 07:23 AM   #1
LQ Newbie
Registered: Jan 2014
Posts: 1

Rep: Reputation: Disabled
Question How do i open a specific file on startup?

Hi i have a raspberry pi running debian. I have it connected to an old radio so that i can listen to my favourite web radio station automatically on it. However when i reboot the pi i have to use putty to access a remote terminal and type in the following commands to get it working again:

1) screen
2) vlc /home/pi/listen.pls disown

this gets the radio station playing. I tried to create a bash startup script to get this vl;c playlist to work on startup, i was able to get vlc to open but not to play the playlist.

It is driving me mad does anyone know how i can get this automated so if the pi goes down it automatically starts playing on reboot.

Old 01-17-2014, 07:58 AM   #2
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,592
Blog Entries: 13

Rep: Reputation: 4679Reputation: 4679Reputation: 4679Reputation: 4679Reputation: 4679Reputation: 4679Reputation: 4679Reputation: 4679Reputation: 4679Reputation: 4679Reputation: 4679
Please post the script you have using [code] blocks.

However a suggestion is that you create a script in /etc/init.d and create symbolic links to it in /etc/rc#.d. Do you understand that convention for starters? Which is how to create a startup script?

The script itself may be as simple as the following:

# Automatically start up VLC to play my favorite radio station

vlc /home/pi/listen.pls disown;
A recommendation is to find the path for each of those commands; on my system they are:

Therefore your script would contain the correct paths:

# Automatically start up VLC to play my favorite radio station

/usr/bin/vlc /home/pi/listen.pls disown;
Here are some tips on bash scripting to debug the script: Bash Script Tips

And here is a suggestion to quickly get the script running at startup:
  1. Put the script into /etc/init.d
  2. Create symbolic links in /etc/rc2.d, /etc/rc3.d, /etc/rc4.d, and /etc/rc5.d to point to your script; i.e. ln -s ../init.d/<script-name> S99<some-name> and note you'll probably have to do this as root or use sudo
1 members found this post helpful.
Old 01-18-2014, 08:50 AM   #3
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,300

Rep: Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916Reputation: 916
for the system to do it automatically, i would put it in /etc/rc.local.
for the user to do it once logged in you can put it in ~/.bash_profile.
some newer distros support a @reboot directive in the users crontab.


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
wget, download specific links into specific file names Si14 Linux - Software 1 04-30-2013 01:42 AM
[SOLVED] Link to open File Browser in specific directory AlexFr Red Hat 1 07-05-2012 06:39 AM
New open file size limit is getting reflected in the specific user srajeshkumar Linux - Server 6 05-18-2011 08:32 AM
Samba: Cannot open Credentials file on startup paul.nel Linux - Networking 2 11-23-2004 12:06 PM
how to make a file that will open specific things for you zexter Programming 2 11-06-2004 07:04 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:12 AM.

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