Description of problem: "asterisk -r" fails to connect to asterisk if started by systemctl because the asterisk user doesn't have write permissions to /run/asterisk # ls -ld /run/asterisk/ drwxr-xr-x. 2 root root 40 Oct 10 21:36 /run/asterisk/ Version-Release number of selected component (if applicable): asterisk-10.8.0-1.fc17.x86_64 Steps to Reproduce: 1. systemctl start asterisk.service (as root) 2. asterisk -rv (as root) Actual results: # asterisk -rvvv Asterisk 10.8.0, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= == Parsing '/etc/asterisk/asterisk.conf': == Found == Parsing '/etc/asterisk/extconfig.conf': == Found Unable to connect to remote asterisk (does /run/asterisk/asterisk.ctl exist?) # ls -l /run/asterisk total 0 Expected results: # asterisk -rv Asterisk 10.8.0, Copyright (C) 1999 - 2012 Digium, Inc. and others. Created by Mark Spencer <markster> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 10.8.0 currently running on daq (pid = 26863) Verbosity was 0 and is now 1 Additional info: Fixed with: # chown asterisk /run/asterisk # systemctl start asterisk.service # ls -l /run/asterisk/ total 4 srw-rw----. 1 asterisk asterisk 0 Oct 10 21:40 asterisk.ctl -rw-r--r--. 1 asterisk asterisk 6 Oct 10 21:40 asterisk.pid
Problem still exists on Asterisk asterisk-11.2.0-1.fc18.x86_64, Fedora 18.
I wonder if part of the problem is that asterisk.spec specifies to use tmpfiles.d to manage /run/asterisk on Fedoras that have tmpfilesd: %if %{tmpfilesd} %attr(0644,root,root) /usr/lib/tmpfiles.d/asterisk.conf %ghost %attr(0755,asterisk,asterisk) %dir %{astvarrundir} %else %attr(0755,asterisk,asterisk) %dir %{astvarrundir} %endif but systemd-tmpfiles --create doesn't get invoked on asterisk package installation, only on the next reboot of the system.
(In reply to comment #2) > I wonder if part of the problem is that asterisk.spec specifies to use > tmpfiles.d to manage /run/asterisk on Fedoras that have tmpfilesd: Yeah, that does appear to be the problem. I'll have a look around the wiki this weekend to see if there's a recommended way to run the creation. I also need to get 11.2.1 out too.
asterisk-11.2.1-1.fc18 has been submitted as an update for Fedora 18. https://admin.fedoraproject.org/updates/asterisk-11.2.1-1.fc18
Package asterisk-11.2.1-1.fc18: * should fix your issue, * was pushed to the Fedora 18 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing asterisk-11.2.1-1.fc18' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/FEDORA-2013-2329/asterisk-11.2.1-1.fc18 then log in and leave karma (feedback).
asterisk-11.2.1-1.fc18 has been pushed to the Fedora 18 stable repository. If problems still persist, please make note of it in this bug report.