I was wondering if anyone else is seeing a slow shutdown on their new FreePBX 17 setups? We’ve migrated over nine of our PBXes now, and all are VMs running in Hyper-V. We’ve noticed that when we ask for a shutdown or restart from System Admin, it drops the ssh session and the Hyper-V console window changes to a blinking cursor. Then it seems to wait for about two or three minutes before the shutdown or reboot occurs. I have seen that with previous versions, but with FreePBX 17 it seems to be consistent.
I will see what I can find in the logging by timing when I issue the shutdown command and then checking the logs after reboot to see what is occurring in that time window.
I installed freePBX-17/Debian 12 in Virtualbox…same phenomenon. It takes about >1min to shut down. I had this problem on older systems (16) too…occasionally…
I checked two of the VMs that I am setting up that I haven’t run the FreePBX install script on yet. One took 15 seconds from hitting Enter on the reboot command to booting up back to a command prompt, the other was 17 seconds. It’s definitely occurring after FreePBX is installed. I chose one of the new FreePBX 17 VMs. From when I hit Enter after typing “reboot” in the GUI, it was 2:45 when the uptime counter in Hyper-V zeroed out to show it was rebooting. It booted up fairly quickly after that in 10 or 15 seconds.
Hitting enter in the Hyper-V console still shows the blinking cursor.
A similar problem when rebooting and shutting down the guest OS on vmware16x Debian12 freepbx17, and the problem starts only after installing the freepbx17 script, a clean Debian12 system works instantly, both when rebooting and when shutting down the guest OS.
would indicate that the fwconsole.service ExecStop= is not working, so the command will timeout after 90’s, which it did . There probably should not be two instances of asterisk running (pidof asterisk)
That shows an orderly shutdown of 1 second but no startup, If that is all in journalctl -b -1 look in journalctl -b -2 which would show the penultimate 'session. ’ , ( ‘tac’ is to sort reverse the report, ‘less’ to ‘page’ it)
@akkl, that looks like just the end of the log right before shutdown. Do you see a part of the logs like my example that shows about a 90 second gap between entries? Does it show the “Asterisk is still running and we can’t stop it!” message as well?
@steve_pbuk, are you running FreePBX in a VM as well? Do you see the “Asterisk is still running and we can’t stop it!” and the 90 second gap in the logs?
If the FreePBX service is failing to stop Asterisk, Debian will execute all /usr/lib/systemd/system-shutdown/*.shutdown files, so to force asterisk to stop .in asterisk.shutdown put
I don’t specifically see “Asterisk is still running and we can’t stop it!” but I do see a delay in the logs.
Logs showing the delay are below:
Aug 29 09:59:24 srv-voip-01 systemd[1]: Stopped target network-online.target - Network is Online.
Aug 29 09:59:24 srv-voip-01 systemd[1]: freepbx.service: Consumed 4min 48.496s CPU time.
Aug 29 09:59:24 srv-voip-01 systemd[1]: Stopped freepbx.service - FreePBX VoIP Server.
Aug 29 09:59:24 srv-voip-01 systemd[1]: freepbx.service: Failed with result 'timeout'.
Aug 29 09:59:24 srv-voip-01 mariadbd[658]: 2024-08-29 9:59:24 43 [Warning] Aborted connection 43 to db: 'asteriskcdrdb' user: 'freepbxuser' host: 'localhost' (Got an error reading communication packets)
Aug 29 09:59:24 srv-voip-01 systemd[1]: freepbx.service: Killing process 15333 (asterisk) with signal SIGKILL.
Aug 29 09:59:24 srv-voip-01 systemd[1]: freepbx.service: Killing process 1540 (asterisk) with signal SIGKILL.
Aug 29 09:59:24 srv-voip-01 systemd[1]: freepbx.service: State 'final-sigterm' timed out. Killing.
Aug 29 09:57:54 srv-voip-01 systemd[1]: freepbx.service: Control process exited, code=killed, status=15/TERM
Aug 29 09:57:54 srv-voip-01 mariadbd[658]: 2024-08-29 9:57:54 520 [Warning] Aborted connection 520 to db: 'asterisk' user: 'freepbxuser' host: 'localhost' (Got an error reading communication packets)
Aug 29 09:57:54 srv-voip-01 mariadbd[658]: 2024-08-29 9:57:54 521 [Warning] Aborted connection 521 to db: 'asteriskcdrdb' user: 'freepbxuser' host: 'localhost' (Got an error reading communication packets)
Aug 29 09:57:54 srv-voip-01 systemd[1]: freepbx.service: Stopping timed out. Terminating.
Aug 29 09:56:59 srv-voip-01 fwconsole[15329]: stty: 'standard input': Inappropriate ioctl for device
Aug 29 09:56:59 srv-voip-01 fwconsole[15327]: stty: 'standard input': Inappropriate ioctl for device
Aug 29 09:56:59 srv-voip-01 fwconsole[14915]: Press N to shut down NOW
Aug 29 09:56:59 srv-voip-01 fwconsole[14915]: Press C to Cancel
Aug 29 09:56:59 srv-voip-01 fwconsole[14915]: Shutting down Asterisk Gracefully. Will forcefully kill after 30 seconds.
Aug 29 09:56:59 srv-voip-01 fwconsole[14915]: Stopped UCP Node Server
This is terrible. On v16, the shutdown was a few seconds. On v17, the shutdown is a few minutes.
It is getting stuck on this. You can clearly see it during shutdown when you turn on the shutdown log screen.
Job freepbx.service/stop running (10s / 2min 37s)
That “10s” is counting up until it gets to 2min 37s and then it continues the shutdown.