Cannot start Freeswitch - Help!

Status
Not open for further replies.

Roget Hoffman

New Member
Nov 24, 2017
17
0
1
72
Hello all

I hope someone can help quickly. Here is story:
My FS/Fusionpbx server ran out of disk space. The postgres server stopped responding. I quickly removed a bunch or files to make space. I restarted postgres. I also restarted Freeswitch using service freeswitch restart - and got an error. Then I ran:

systemctl status freeswitch.service

and got:

● freeswitch.service - freeswitch
Loaded: loaded (/lib/systemd/system/freeswitch.service; enabled)
Active: failed (Result: exit-code) since Wed 2023-01-04 21:04:11 EST; 9min ago
Process: 6036 ExecStart=/usr/bin/freeswitch -u www-data -g www-data -ncwait $DAEMON_OPTS (code=exited, status=1/FAILURE)
Process: 6033 ExecStartPre=/bin/chown -R www-data:www-data /var/run/freeswitch/ (code=exited, status=0/SUCCESS)
Process: 6031 ExecStartPre=/bin/mkdir -p /var/run/freeswitch/ (code=exited, status=0/SUCCESS)

Jan 04 21:04:08 fs1 systemd[1]: freeswitch.service holdoff time over, scheduling restart.
Jan 04 21:04:08 fs1 systemd[1]: Stopping freeswitch...
Jan 04 21:04:08 fs1 systemd[1]: Starting freeswitch...
Jan 04 21:04:08 fs1 freeswitch[6036]: 6037 Backgrounding.
Jan 04 21:04:11 fs1 systemd[1]: Stopping freeswitch...
Jan 04 21:04:11 fs1 freeswitch[6036]: FreeSWITCH[6036] Waiting for background process pid:6037 to be ready.....
Jan 04 21:04:11 fs1 freeswitch[6036]: FreeSWITCH[6036] Error starting system! pid:6037
Jan 04 21:04:11 fs1 systemd[1]: freeswitch.service: control process exited, code=exited status=1
Jan 04 21:04:11 fs1 systemd[1]: Stopped freeswitch.
Jan 04 21:04:11 fs1 systemd[1]: Unit freeswitch.service entered failed state.

I did a bunch or googling and found I shoudl try:
/usr/bin/freeswitch -nc

When I did this, freeswitch seemed to have started, but 2 weird things happened: 1. Active Calls in Fusion did not show anything, nor did fs_cli 'show channels' (yes I had a call up) and 2. I saw two freeswitch processes in ps aux - one where the user was root and the other process user was www-data

Any suggestions welcomed.

thanks
Roger
 

Roget Hoffman

New Member
Nov 24, 2017
17
0
1
72
journalctl -xn output of above issue:

-- Logs begin at Wed 2023-01-04 20:56:03 EST, end at Wed 2023-01-04 21:42:26 EST. --
Jan 04 21:42:26 fs1 systemd[1]: freeswitch.service: control process exited, code=exited status=1
Jan 04 21:42:26 fs1 systemd[1]: Failed to start freeswitch.
-- Subject: Unit freeswitch.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit freeswitch.service has failed.
--
-- The result is failed.
Jan 04 21:42:26 fs1 systemd[1]: Unit freeswitch.service entered failed state.
Jan 04 21:42:26 fs1 freeswitch[7363]: FreeSWITCH[7363] Waiting for background process pid:7364 to be ready.....
Jan 04 21:42:26 fs1 freeswitch[7363]: FreeSWITCH[7363] Waiting for background process pid:7364 to be ready.....
Jan 04 21:42:26 fs1 freeswitch[7363]: FreeSWITCH[7363] Error starting system! pid:7364
Jan 04 21:42:26 fs1 systemd[1]: freeswitch.service holdoff time over, scheduling restart.
Jan 04 21:42:26 fs1 systemd[1]: Stopping freeswitch...
-- Subject: Unit freeswitch.service has begun shutting down
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit freeswitch.service has begun shutting down.
Jan 04 21:42:26 fs1 systemd[1]: Starting freeswitch...
-- Subject: Unit freeswitch.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit freeswitch.service has begun starting up.
Jan 04 21:42:26 fs1 freeswitch[7416]: 7418 Backgrounding.

thanks again
 

vocdot

New Member
Jul 16, 2020
9
0
1
Have you solved?
If not, try to start manually:

/usr/bin/freeswitch

whithout nc ( nc: do not output to a console and background ) and paste the output. It should contain the error details
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,070
577
113
If you run /usr/bin/freeswitch it will start freeswitch using the current logged in user. If for example it is root, it will now create some files with ownership of root.

When you now try and restart using systemd or whatever, it will fail as it cannot create the files it needs to as you have effectively changed the files ownership to root and it will now be running as www-data.

Never run /usr/bin/freeswitch

You can start freeswitch in the foreground correctly by running something ike this:

Code:
/usr/bin/freeswitch -u www-data -g www-data -nonat -run /var/run/freeswitch

Try something like this to fix your permissions then either try with the above or use the normal systemd to start:

Code:
chown -R www-data:www-data /etc/freeswitch
chown -R www-data:www-data /var/lib/freeswitch/recordings
chown -R www-data:www-data /var/lib/freeswitch/storage
chown -R www-data:www-data /var/lib/freeswitch/db
chown -R www-data:www-data /usr/share/freeswitch
chown -R www-data:www-data /var/log/freeswitch
chown -R www-data:www-data /var/run/freeswitch
chown -R www-data:www-data /var/cache/fusionpbx
 

DigitalDaz

Administrator
Staff member
Sep 29, 2016
3,070
577
113
Also, for good measure, if you have made changes and they do not seem to be getting applied, do a:

Code:
rm /var/cache/fusionpbx/*

Then restart freeswitch, this will clear your cache.
 
  • Like
Reactions: gflow
Status
Not open for further replies.