philippe44 / AirConnect

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

autostart with custom config file? #29

Closed faltim closed 6 years ago

faltim commented 6 years ago

I build a .service file to autostart the program with my own config file:

[Unit] Description=AirUPnP bridge After=network-online.target Wants=network-online.target

[Service] Type=forking ExecStart=/var/lib/airconnect/airupnp-arm -x configfile Restart=on-failure RestartSec=30

[Install] WantedBy=multi-user.target

It was just a try, but it doesn't work at all. Is there a possibility to autostart the program with a custom config file?

philippe44 commented 6 years ago

why didn't you use the one in the README and just added "-x configfile"? Problem in your example is that you did not daemonize (-z) the application, so the servcie cannot work as expected (forking)

faltim commented 6 years ago

because of my naming and enable/disable settings of my devices

philippe44 commented 6 years ago

understood but I meant you just have to use the example and add "-x configfile" on the ExecStart line, why removing the rest of the options? The absence of "-z" is the problem

faltim commented 6 years ago

It doesn't work. I tried it with the following line of code in my .service file ExecStart=/var/lib/airconnect/airupnp-arm -x configfile -z The Programm still starts with the default configuration.

thx for your help and this nice program :)

philippe44 commented 6 years ago

I assumed that "configfile" was just symbolic of the actual configuration file. You need to give the fully qualified path of the real config file, otherwise the application does not know where to find it. So, for example , use -x /var/lib/airconnect/config-upnp.xml"

faltim commented 6 years ago

It works! Thank you!