LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Starting application on boot (https://www.linuxquestions.org/questions/linux-newbie-8/starting-application-on-boot-849614/)

ainsworth 12-11-2010 05:18 AM

Starting application on boot
 
I have Ubuntu 10.10 installed on my pc with XBMC installed. It's set to boot into xbmc on start up and works fine. I also have squeezebox server (a music server for my network) installed and again don't have any trouble. I'd now like to get squeezeslave running, a client for squeezebox server so I added the following lines to /etc/init.d/local:

#!/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
squeezeslave -o0 -r3 192.168.1.3 &
exit 0

This fails to start the client on boot, however if I ssh into the machine and run /etc/init.d/local it runs fine.

Any idea what I'm doing wrong?

smart_shell 12-11-2010 05:43 AM

Hi,try
1. add to /etc/init.d/myscript
2. update-rc.d myscript
3. chmod -x myscript

allend 12-11-2010 05:48 AM

Remove the PATH line and add an absolute path to the squeezeslave executable e.g.
/usr/bin/squeezeslave -o0 -r3 192.168.1.3 &

Note: Check the absolute path with 'which squeezeslave'

The program is probably failing to start because is not in the path when /etc/init.d/local is run at boot, but when you ssh in, the program is now in the path.

smart_shell 12-11-2010 06:11 AM

Quote:

Originally Posted by allend (Post 4187801)
Remove the PATH line and add an absolute path to the squeezeslave executable e.g.
/usr/bin/squeezeslave -o0 -r3 192.168.1.3 &

Note: Check the absolute path with 'which squeezeslave'

The program is probably failing to start because is not in the path when /etc/init.d/local is run at boot, but when you ssh in, the program is now in the path.

yes, or add the path var in console
PATH=$PATH:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
and try to run your program


All times are GMT -5. The time now is 01:22 AM.