Description of problem: On system reboot, Asterisk does not start properly. Typically SIP channels are unconnected. Version-Release number of selected component (if applicable): asterisk-13.11.1-1.el7 How reproducible: 100% Steps to Reproduce: 1. Build from https://src.fedoraproject.org/cgit/rpms/asterisk.git/ on EL7 2. Configure, including a SIP channel, using hostname(s) for the target 3. Reboot system Actual results: Asterisk starts but doesn't connect to SIP provider. Once booted, restarting Asterisk is successful. Message such as: [Jul 17 01:26:51] ERROR[4193] netsock2.c: getaddrinfo("sip.sip-provider.example.com", "(null)", ...): Name or service not known Expected results: Should restart and work without intervention. Shouldn't be name resolution errors in the log. Additional info: I suspect that the system unit file for Asterisk probably needs to wait for more services to be up before allowing Asterisk to be started. At minimum, I would think you want any name resolution services up.
I've found that changing "After=" in systemctl to be network-online.target resolves this issue. Is this something that should be changed at the fedora level or upstream? Work around for other users: sudo systemctl edit asterisk Add these lines: [Unit] After= After=network-online.target Save file sudo systemctl daemon-reload And then sip channel will come up correctly on a boot.
(In reply to Dave Koberstein from comment #1) > > Is this something that should be changed at the fedora level or upstream? Fedora packaging is providing it's own asterisk.service file: https://src.fedoraproject.org/cgit/rpms/asterisk.git/tree/asterisk.service?h=master so this needs to be fixed there. > Work around for other users: > sudo systemctl edit asterisk > > Add these lines: > > [Unit] > After= > After=network-online.target Nice. I've created https://src.fedoraproject.org/rpms/asterisk/pull-request/3 to get this fixed in the Fedora/EPEL packaging.
I'm glad you were able to track down the issue. I've merged the pull request, and pushed the changes to rawhide. I'll try to get other branches built over the next day or two, but I'm traveling, and have limited internet access.
After having run with this change for a bit, I don't think it's quite enough. I don't think the network-online.target implies that name services are up and running yet. So one can hit that target before DNS is actually available, Asterisk starts up but DNS has not started or at least completed starting.
Do we actually want "nss-lookup.target" here rather than network-online.target?
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.