Questions about astpp 6

in version 6 after restarting the server, it seems that the freeswitch does not go up, you need to do a fw reload for the sip devices to re-register. my question is: what does this reset procedure do within ASTPP
would it be the monitor?
and in this case we have to create a rule in crontab?

Hello @maxxsolutions ,
Please check your monit servic, is it working?

yes, monit and freeswitch services are started

Hello @maxxsolutions ,
Please check if in monitrc conf file the freeswitch path is correct as monit service is helping the services to restart itself.

I did the following
I disabled the freeswitch service at system startup
what happens is the following, the monit ignores the commands
check process freeswitch with pidfile /var/run/freeswitch/
start program=“/bin/systemctl start freeswitch”
stop program=“/bin/systemctl stop freeswitch”
because the pid is already running
the problem is? why the freeswitch does not start correctly with the system?
however as mentioned above
on restart, the monit will see that the service is not active and starts correctly, thus registering the sip devices, without needing a restart via the command line or via the web interface

Hello @maxxsolutions ,
Please add this line
/usr/share/freeswitch/run/ , below file if not added already.

vim /etc/monit/monitrc

just add extra line

on /etc/monit/monitrc? Or change it for
check process freeswitch with pidfile /var/run/freeswitch/

I still haven’t been able to solve this problem,
because what does not start is mod_sofia,
it only goes up after a restart on the freeswitch

I have the same problem here. Freeswitch somehow hang/killed, Monitr did start the freeswitch services, but when check sofia status, mod_sofia is not load. Have to run freeswitch restart manually to make it work. Any fix for this?

I have seen this also upon boot/reboot mod_sofia not running, and you have to manually restart FreeSwitch.

With reboot, possibility of freeswitch having higher priority with boot order then mysql and that is the reason when FS started DB is still starting and modules of FS responsible to fetch data from DB did try unsuccessfully.

Simply add cron @reboot sleep 20 && and fs_cli -x ‘reload mod_sofia’

1 Like

I will test this and give you feedback.

I added cron @reboot sleep 30 && sudo systemctl restart freeswitch
Freeswitch is working after reboot.

1 Like

Sounds to me like a systemd problem. What database server are you running? MySQL or MariaDB. Freeswitch needs to start after the database and the way to do that is with the systemd unit file.

Add this systemd file to /etc/systemd/system and modify the first part if using mariadb instead of MySQL so it waits until the database has started.

Description=freeswitch mysql.service

Environment="DAEMON_OPTS=-ncwait -nonat"
ExecStart=/usr/bin/freeswitch $DAEMON_OPTS


; Comment this out if using OpenVZ


It’s for sure a FreeSwitch issue as @devangn mentioned.

I fixed this issue by adding “mysql.service” to the “After” line in the freeswitch.service systemd configuration file.
Quick question, regarding this PID path file (I read some answers here on this thread about that)

My monitrc file includes this path:

— FreeSWITCH ----
check process freeswitch with pidfile /var/run/freeswitch/

then the systemd file states:

; service
ExecStartPre=/bin/chown -R ${USER}:${GROUP} /var/lib/freeswitch /var/log/freeswitch /etc/freeswitch />usr/share/freeswitch /var/run/freeswitch
ExecStart=/usr/bin/freeswitch -u ${USER} -g ${GROUP} -ncwait ${DAEMON_OPTS}

No matter if I change that path in the systemd config file to /var/run/freeswitch/ I still see (after rebooting) 2 PID files (one inside “/var/run/freeswitch/” directory, and the other under “/run/freeswitch/” directory). Is this a normal behavior -and I have to be leave it as it is- or is it some kind of duplicated process running for same freeswitch installation ? (I’m not a Linux expert, just curious how this works, and trying to minimize any impact to this platform performance)

What is the correct path to the PID file to set in both files (systemd and monirc) ?

/var/run is just a symlink to /run for backwards compatibility. It is mounted as a tmpfs so it is recreated on boot. I seem to remember having problems using symlinks in systemd files at one time, so I think it’s best to use the /run directory instead.

Thank you for the reply, and teaching me about that.
That make sense then. I will leave the systemd file with “/run/freeswitch/” path