Hi,
first time poster. English is not my first language. So please be kind, if I do wrong or stupid things.
I found out, that my current problem seems to be the same as described here:
My freepbx needs nearly 4 Minutes to shut down (including the vm). Thats way to long for the currently configured USV which shuts down Power 180 seconds after sending the shutdown command … anyway. I googled a bit and found some interesting things not mentioned in the abouve Thread.
The freepbx is currently running on a proxmox ve with
- 4 GB Ram
- 2 cores
- 20 GB Harddisk
- debian 12
- freepbx 17.0.19.24
After startup, and waiting 10 minutes, everything is working fine, Dashboard is showing hooks, especialy for the asterisk part.
A
systemctl | grep -E “asterisk|maria|apache2|fail2ban”
shows up with:
apache2.service loaded active running The Apache HTTP Server
fail2ban.service loaded active running Fail2Ban Service
mariadb.service loaded active running MariaDB 10.11.6 database server
So no Asterisk.
systemctl status asterisk.service
shows
asterisk.service - LSB: Asterisk PBX
Loaded: loaded (;;file://asteriskng/etc/init.d/asterisk/etc/init.d/asterisk;;; generated)
Active: inactive (dead)
Docs: ;;man:systemd-sysv-generator(8)man:systemd-sysv-generator(8);;
This seems to be ok, because the /run/systemd/generator.late/asterisk.service should just start the service and stop then (heard it from chatgpt).
But with a “ps -aux” I could see, that asterisk is still running (and working).
With a shutdown in this state, it will last about 3:50 Minutes to shutdown.
With a “fwconsole stop” it is down to about 2:30 Minutes.
With a “systemctl restart (or start) asterisk.service” the
systemctl | grep -E “asterisk|maria|apache2|fail2ban”
shows
apache2.service loaded active running The Apache HTTP Server
asterisk.service loaded active exited LSB: Asterisk PBX
fail2ban.service loaded active running Fail2Ban Service
mariadb.service loaded active running MariaDB 10.11.6 database server
and
systemctl status asterisk.service
asterisk.service - LSB: Asterisk PBX
Loaded: loaded (;;file://asteriskng/etc/init.d/asterisk/etc/init.d/asterisk;;; generated)
Active: active (exited) since Tue 2025-07-15 15:38:03 CEST; 20h ago
Docs: ;;man:systemd-sysv-generator(8)man:systemd-sysv-generator(8);;
CPU: 13ms
With this setup, the time for a Shutdown is about 1:10 Minutes.
So it seems, that the start/restart of asterisk.service does “only” change the state for systemd, so that systemd can stop the service during shutdown without the, in the linked post mentioned 90 seconds timout.
The quick and dirty solution with my limited linux knowledge is, to create a cronjob, that does a “systemctl start asterisk.service” 15 Minutes after boot (should be possible with the cron @reboot option). But it seems to be not “elegant (german)” or “sophisticated”.
Chatgpt mentioned another way to change the service setup that it is directly controled by systemd…but I don’t know, if the knowledge of chatgpt is real knowledge or only a “idea” how it could work.
Any hints, what is a better way?
Regards
Peter