philippe44 / AirConnect

Use AirPlay to stream to UPnP/Sonos & Chromecast devices
Other
3.46k stars 217 forks source link

Config file not found when running as a service on RPi3 #46

Closed Shad-Shad closed 6 years ago

Shad-Shad commented 6 years ago

Hi, First of all, Thanks for creating this. I am using it for a day and it is working great.

I have Aiconnect installed on my Raspberry Pi 3 and can send the songs to my Sonos devices. I decided to try and run this as a service so it is always on.

I have a configuration file created in the same directory as the executable that sets the latency and ignores some devices.

When i set as a service, I see the message "main:1209 no config file, using defaults" in the log file.

I was wondering if there is a way to make it run as a service and read the config file.

I initially started with the Airconnect directory in my Home directory and then moved it to /var/lib. Same issue in both cases.

Thanks for your help

philippe44 commented 6 years ago

how did you name your config file? It must be named config.xml to be used as a default, otherwise, look at the command line option to use a name of your choice

Shad-Shad commented 6 years ago

Hi, the file is named config.xml and is in the same directory as the executable. When i run manually from the command prompt it picks it up and applies the configuration. When running as a service, it does not

philippe44 commented 6 years ago

of, that's different - you need to give a name with a full path when used as a service. You service does not start in the directory where the binary is!

Shad-Shad commented 6 years ago

Hi, all works now. I added the -x to direct the service to the config file and all works great. Thanks a million :)

Feelisreal commented 4 years ago

Hey Shad-Shad having the same issue with my config. But I am not that Linux literate to reproduce your solution. Could you please elaborate a little more? Where did you put the config and how does your service look like? Thanks in advance!