philippe44 / AirConnect

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

airupnp.service not starting automatically after rebooting machine #355

Closed muammar closed 2 years ago

muammar commented 3 years ago

Thanks for this handy tool. I added the airupnp.service following the instructions, and the content is below:

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

[Service]
ExecStart=/software/airconnect/aircast-x86-64 -Z -x /software/airconnect/airupnp.xml
Restart=on-failure
RestartSec=30

[Install]
WantedBy=multi-user.target

This is working perfectly if I do sudo systemctl restart airupnp.service. However, if I restart the computer (running Debian), the service does not start automatically. Have any of you experienced this issue? Thanks.

mrlt8 commented 3 years ago

sudo systemctl enable airupnp.service?

You could also check the logs to see if it's failing: systemctl status airupnp.service or journalctl -r -u airupnp.service

muammar commented 3 years ago

sudo systemctl enable airupnp.service?

I did that, but that did not work.

You could also check the logs to see if it's failing: systemctl status airupnp.service or journalctl -r -u airupnp.service

I checked the log and I saw this;

Jun 09 15:23:30 pneuma aircast-x86-64[104185]: [15:23:30.040468] main:974 Starting aircast version: v0.2.50.2 (Mar 12 2021 @ 17:48:15)
Jun 09 15:23:30 pneuma systemd[1]: Started AirUPnP bridge.
Jun 09 15:23:30 pneuma systemd[1]: airupnp.service: Consumed 2min 53.201s CPU time. 
Jun 09 15:23:30 pneuma systemd[1]: Stopped AirUPnP bridge.
Jun 09 15:23:30 pneuma systemd[1]: airupnp.service: Failed with result 'timeout'.                                                                                              
Jun 09 15:23:30 pneuma systemd[1]: airupnp.service: Main process exited, code=killed, status=9/KILL
Jun 09 15:23:30 pneuma systemd[1]: airupnp.service: Killing process 98823 (n/a) with signal SIGKILL.
Jun 09 15:23:30 pneuma systemd[1]: airupnp.service: Killing process 98821 (n/a) with signal SIGKILL.
Jun 09 15:23:30 pneuma systemd[1]: airupnp.service: Killing process 94460 (aircast-x86-64) with signal SIGKILL.
Jun 09 15:23:30 pneuma systemd[1]: airupnp.service: Killing process 66141 (aircast-x86-64) with signal SIGKILL.
Jun 09 15:23:30 pneuma systemd[1]: airupnp.service: State 'stop-sigterm' timed out. Killing.
Jun 09 15:21:59 pneuma systemd[1]: Stopping AirUPnP bridge...
philippe44 commented 3 years ago

please share your .service file

muammar commented 3 years ago

please share your .service file

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

[Service]
ExecStart=/home/muammar/software/airconnect/aircast-x86-64 -Z -x /home/muammar/software/airconnect/airupnp.xml
Restart=on-failure
RestartSec=30

[Install]
WantedBy=multi-user.target

@philippe44, above, you can see the .service file.

Best

philippe44 commented 3 years ago

Are you sure about the xml config file? You are starting aircast but you seem tu be willing to enable UPnP devices

muammar commented 3 years ago

My config.xml file is empty. But the problem seems to be that I have to enable the service manually each time I reboot. No idea why.

philippe44 commented 3 years ago

It's likely something with systemd on your system, I don't know. You can always try w/o a config file if it is empty, but I don't see that changing anything