First of all, you should use systemctl for managing services on CentOS 7. Service / init.d commands are deprecated.
Try systemctl status asterisk systemctl start asterisk
This looks like asterisk is corrupted or not installed completely.
Has it worked before and broke suddenly?
Or it has never worked for this installation?
Try tail -f /var/log/messages tail -f /var/log/asterisk/full
And start asterisk (systemctl start asterisk) at that moment. Does there anything specific appear in the logs?
Yes, this installation works before and I made a new installation by following this process:
$ cd /path/asterisk-source-dir
# For Asterisk 13 and 14...
$ ./configure --with-pjproject-bundled
$ make & make install
$ make config
I have not make the command #make samples because I had already a first installation of Asterisk 13.23.1.
We have made a new copy on a new server Windows 2012 with the VMWare vsPhere Hypervisor 6.5
And on this last one we have make a copy of my virtual installation of Asterisk that I made on Windows 10 Pro.
And he works well on a µn other server Windows 2008 R2 with VMWare vsPhere Hypervisor 6.5 installed on it.
[root@localhost asterisk]# systemctl status asterisk
● asterisk.service - LSB: Asterisk PBX
Loaded: loaded (/etc/rc.d/init.d/asterisk; bad; vendor preset: disabled)
Active: failed (Result: timeout) since mar 2018-11-06 09:23:12 CET; 12min ago
Docs: man:systemd-sysv-generator(8)
Process: 3039 ExecStart=/etc/rc.d/init.d/asterisk start (code=exited, status=0/SUCCESS)
CGroup: /system.slice/asterisk.service
├─1096 /bin/sh /usr/sbin/safe_asterisk
├─3066 /bin/sh /usr/sbin/safe_asterisk
├─6127 sleep 4
└─6133 sleep 4
nov 06 09:18:12 localhost.localdomain systemd[1]: Starting LSB: Asterisk PBX...
nov 06 09:18:12 localhost.localdomain asterisk[3039]: Starting asterisk:
nov 06 09:18:12 localhost.localdomain systemd[1]: PID file /var/run/asterisk/asterisk.pid not readable (yet?) after start.
nov 06 09:23:12 localhost.localdomain systemd[1]: asterisk.service start operation timed out. Terminating.
nov 06 09:23:12 localhost.localdomain systemd[1]: Failed to start LSB: Asterisk PBX.
nov 06 09:23:12 localhost.localdomain systemd[1]: Unit asterisk.service entered failed state.
nov 06 09:23:12 localhost.localdomain systemd[1]: asterisk.service failed.
[root@localhost asterisk]#
[root@localhost asterisk]#
[root@localhost asterisk]# systemctl start asterisk
Job for asterisk.service failed because a timeout was exceeded. See "systemctl status asterisk.service" and "journalctl -xe" for details.
[root@localhost asterisk]#
This is the result of compiling on a virtual machine that mis-describes the capabilities of its CPU. It is a known problem, and the solution is to set a build option that prevents Asterisk from compiling code optimised for the particular CPU it is running on (this is not the no optimised option). Searching for “illegal instruction” on the forum should result in many examples of how to do this.
Also, please do not para-phrase error messages. If you had said “illegal instruction”, or “invalid opcode”, in your subject, I may well have recognized the situation immediately.
The instruction being referred to is a low level machine code instruction for the CPU itself.
This is not an authorisation issue, it is a case of the CPU being told to do something it does not know how to do.
No. CentOS will have been compiled against a generic i386 or amd64 CPU.
You need to search the forum for the options to do this for Asterisk and recompile Asterisk.
The underlying bug is in the virtual machine software under which both are running (I’ve never heard of the compiler getting this wrong on real hardware, so I don’t think it is a bug in the compiler)>
The instructions you used are for building Asterisk on a platform that has a working development environment. Your virtual machine host is breaking the development environment, not just for Asterisk.