<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-12-19 16:11 GMT+01:00 Jean Aunis <span dir="ltr"><<a href="mailto:jean.aunis@prescom.fr" target="_blank">jean.aunis@prescom.fr</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF"><div><div class="gmail-h5">
Le 19/12/2016 à 15:54, Olivier a écrit :<br>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>Hello,<br>
<br>
</div>
For a new project, I'm adapting existing installation script
to CentOS 7.<br>
I must admit I don't understand how to adapt things to
systemd.<br>
<br>
</div>
<div>Here are my questions:<br>
</div>
<div><br>
1. I don't see any systemd sub-directory in
asterisk-13.13.1/contrib.<br>
</div>
<div>Do you think such directory and matching Makefile target
could be useful ?<br>
<br>
</div>
<div>2. Should /run/asterisk directory creation be left to
systemd or done by installation script before running
"systemctl start asterisk" ?<br>
</div>
<div><br>
</div>
<div>3. I edited the following
/etc/systemd/system:asterisk.<wbr>service file:<br>
[Unit]<br>
Description=Asterisk PBX and telephony daemon.<br>
After=network.target<br>
<br>
[Service]<br>
Type=forking<br>
PIDFile=/var/run/asterisk/<wbr>asterisk.pid<br>
Environment=HOME=/var/lib/<wbr>asterisk<br>
WorkingDirectory=/var/lib/<wbr>asterisk<br>
ExecStart=/usr/sbin/asterisk -vvvgF -U asterisk -G asterisk -C
/etc/asterisk/asterisk.conf<br>
#ExecStart=/usr/sbin/asterisk -vvvgF -C
/etc/asterisk/asterisk.conf<br>
ExecStop=/usr/sbin/asterisk -rx 'core stop now'<br>
ExecReload=/usr/sbin/asterisk -rx 'core reload'<br>
<br>
<br>
[Install]<br>
WantedBy=multi-user.target<br>
<br>
</div>
<div>Running systemctl start asterisk fails with :<br>
Dec 19 15:43:08 foobar systemd: PID file
/var/run/asterisk/asterisk.pid not readable (yet?) after
start.<br>
Dec 19 15:43:09 foobar systemd: asterisk.service: main process
exited, code=exited, status=1/FAILURE<br>
Dec 19 15:43:09 foobar asterisk: Unable to connect to remote
asterisk (does /var/run/asterisk/asterisk.ctl exist?)<br>
Dec 19 15:43:09 foobar systemd: asterisk.service: control
process exited, code=exited status=1<br>
Dec 19 15:43:09 foobar systemd: Unit asterisk.service entered
failed state.<br>
Dec 19 15:43:09 foobar systemd: asterisk.service failed.<br>
<br>
<br>
</div>
<div>But /usr/sbin/asterisk -vvvgF -U asterisk -G asterisk -C
/etc/asterisk/asterisk.conf succeeds:<br>
# rasterisk <br>
Asterisk 13.13.1, Copyright (C) 1999 - 2014, Digium, Inc. and
others.<br>
...<br>
==============================<wbr>==============================<wbr>=============<br>
Running as user 'asterisk'<br>
Running under group 'asterisk'<br>
Connected to Asterisk 13.13.1 currently running on ...<br>
</div>
<div><br>
</div>
<div>Any hint or help on how to debug this ?<br>
</div>
<div>(I tried with and without any /run/asterisk directory owned
by asterisk.asterisk)<br>
<br>
<br>
</div>
<div>Best regards<br>
</div>
</div>
<br>
<fieldset class="gmail-m_-3923443312113133807mimeAttachmentHeader"></fieldset>
<br>
</blockquote>
<br>
</div></div><p>Hello,</p>
<p>Make sure that selinux is disabled, or in "permissive" mode.
Otherwise it will prevent asterisk from starting.</p></div></blockquote><div><br></div><div>Thanks for the tip:<br>changing to permissive mode made it !<br></div><div><br>Using methods suggested in [1], do you think its possible and worth the effort to configure SELinux to work with Asterisk/Systemd in Enforcing mode ?<br></div><div>A quick look in various tuto all disable SELinux.<br><br></div><div><br><br>[1] <a href="https://wiki.centos.org/HowTos/SELinux">https://wiki.centos.org/HowTos/SELinux</a><br></div><div><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div bgcolor="#FFFFFF">
<p>Best regards</p><span class="gmail-HOEnZb"><font color="#888888">
<p>Jean Aunis<br>
</p>
</font></span></div>
<br>--<br>
______________________________<wbr>______________________________<wbr>_________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
Check out the new Asterisk community forum at: <a href="https://community.asterisk.org/" rel="noreferrer" target="_blank">https://community.asterisk.<wbr>org/</a><br>
<br>
New to Asterisk? Start here:<br>
<a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" rel="noreferrer" target="_blank">https://wiki.asterisk.org/<wbr>wiki/display/AST/Getting+<wbr>Started</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/<wbr>mailman/listinfo/asterisk-<wbr>users</a><br></blockquote></div><br></div></div>