Bug 865226

Summary: Unable to remote control if asterisk is loaded as service
Product: [Fedora] Fedora Reporter: phiz
Component: asteriskAssignee: Jeffrey C. Ollie <jeff>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 17CC: itamar, jdunn, jeff, lmadsen, rbryant
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-02 19:58:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description phiz 2012-10-11 03:55:04 UTC
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

Comment 1 Julian C. Dunn 2013-02-08 21:16:36 UTC
Problem still exists on Asterisk asterisk-11.2.0-1.fc18.x86_64, Fedora 18.

Comment 2 Julian C. Dunn 2013-02-08 21:26:24 UTC
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.

Comment 3 Jeffrey C. Ollie 2013-02-08 23:19:24 UTC
(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.

Comment 4 Fedora Update System 2013-02-11 03:48:41 UTC
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

Comment 5 Fedora Update System 2013-02-12 05:14:27 UTC
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).

Comment 6 Fedora Update System 2013-03-02 19:58:06 UTC
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.