Page 1 of 1

Init script & connetion refused

Posted: Mon Apr 22, 2013 7:11 am
by JF002

I'm trying to automatically run an application I made at boot.
This is a GUI for LogitechMediaServer. So, my program needs LogitechMediaServer and Squeezelite to be started first. These are already successfuly started at boot time, as services.

First, I tried to add the command line in rc.local, which is run last in the init process.
It didn't work, so I tried to write an init script that run my program.

In both case, my program can't start because it can't connect to LogitechMediaServer though LMS and Squeezelite have been started just before.

It is written in python, and it tries to connect on port 9090 of the local host (using or the local IP adress). The exception is "socket.error: [Errno 111] Connection refused".

If I try to run the same command line or init script later, after logon, my program runs without any problem.

Any explanations?


Re: Init script & connetion refused

Posted: Sun Apr 28, 2013 5:20 pm
by JF002
Ok, I think I found the explaination: It seems that LogitechMediaServer needs more time to load than the time it takes to launch the service.

So, I modified my Python script to retry connecting until the connection is accepted.