systemd won't enable for automatic start of FS
I'm struggling to get systemd to start FreeSWITCH at boot time and also leave it running once it starts. Problem #1 - "systemd enable freeswitch" outputs the right steps, but ends with an error message. The error I get is "No such file or directory" but that is less than helpful. Problem #2 - When I start FreeSWITCH with "systemd start freeswitch" it starts alright, but systemd does not detect FS running properly so it kills it after the specified 45 seconds elapses and restarts it. I can see this in top when FS gets a new pid. Details -------- It's a new installation of Debian 8.1 and I chose to use systemd as the init process. I compiled FreeSWITCH from source using the latest Master as of late July. The only section of the unit file that is supposed to be used by the "enable" command is the [Install] section and that simply points to the multi-user.target as expected. I do not know what to do with the 2 other sample systemd files in /usr/src/freeswitch/debian, perhaps they are key. I have read up on systemd and the FS unit file looks good to my untrained eye. I did not use the sysvinit files that are also in that FS debian directory. I successfully used systemd to start, stop, and enable a few other system services with success so there must be a tweak to the FS unit file that I am missing. I can start FS manually and it runs normally. A Google search revealed a number of complaints that systemd would emit an error message with its "enable" command, yet it would successfully enable the service; this was with a few different services on Debian and Ubuntu, so it seems there might still be some weirdness with systemd on Debian. Has anybody gotten systemd to start FS reliably? Has anybody figured out how to make systemd detect FreeSWITCH running so that it doesn't restart it repeatedly? Once I figure out how to tame systemd I will document my findings in Confluence as these are the last steps that allow you to get FS up and running quickly. Thanks. --- Bote
Hello, Do you copied sample configs to /etc/freeswitch directory. On Mon, Aug 17, 2015 at 7:36 PM, Bote Man <bote_radio@botecomm.com> wrote:
I’m struggling to get systemd to start FreeSWITCH at boot time and also leave it running once it starts.
Problem #1 – “systemd enable freeswitch” outputs the right steps, but ends with an error message. The error I get is “No such file or directory” but that is less than helpful.
Problem #2 – When I start FreeSWITCH with “systemd start freeswitch” it starts alright, but systemd does not detect FS running properly so it kills it after the specified 45 seconds elapses and restarts it. I can see this in top when FS gets a new pid.
Details
--------
It’s a new installation of Debian 8.1 and I chose to use systemd as the init process. I compiled FreeSWITCH from source using the latest Master as of late July.
The only section of the unit file that is supposed to be used by the “enable” command is the [Install] section and that simply points to the multi-user.target as expected.
I do not know what to do with the 2 other sample systemd files in /usr/src/freeswitch/debian, perhaps they are key. I have read up on systemd and the FS unit file looks good to my untrained eye. I did not use the sysvinit files that are also in that FS debian directory.
I successfully used systemd to start, stop, and enable a few other system services with success so there must be a tweak to the FS unit file that I am missing. I can start FS manually and it runs normally.
A Google search revealed a number of complaints that systemd would emit an error message with its “enable” command, yet it would successfully enable the service; this was with a few different services on Debian and Ubuntu, so it seems there might still be some weirdness with systemd on Debian.
Has anybody gotten systemd to start FS reliably?
Has anybody figured out how to make systemd detect FreeSWITCH running so that it doesn’t restart it repeatedly?
Once I figure out how to tame systemd I will document my findings in Confluence as these are the last steps that allow you to get FS up and running quickly.
Thanks.
---
Bote
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Best regards, Volodymyr
I copied freeswitch.xml to /etc/freeswitch but I think that is only for sysvinit anyway. I compiled FS from source which runs in a different directory tree than the Debian package. The debs run under /etc/freeswitch while the compiled version runs under /usr/local/freeswitch as I have it configured. Thanks. Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Volodymyr Fedorov Sent: Monday, 17 August, 2015 12:48 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS Hello, Do you copied sample configs to /etc/freeswitch directory. On Mon, Aug 17, 2015 at 7:36 PM, Bote Man <bote_radio@botecomm.com> wrote: I’m struggling to get systemd to start FreeSWITCH at boot time and also leave it running once it starts. Problem #1 – “systemd enable freeswitch” outputs the right steps, but ends with an error message. The error I get is “No such file or directory” but that is less than helpful. Problem #2 – When I start FreeSWITCH with “systemd start freeswitch” it starts alright, but systemd does not detect FS running properly so it kills it after the specified 45 seconds elapses and restarts it. I can see this in top when FS gets a new pid. Details -------- It’s a new installation of Debian 8.1 and I chose to use systemd as the init process. I compiled FreeSWITCH from source using the latest Master as of late July. The only section of the unit file that is supposed to be used by the “enable” command is the [Install] section and that simply points to the multi-user.target as expected. I do not know what to do with the 2 other sample systemd files in /usr/src/freeswitch/debian, perhaps they are key. I have read up on systemd and the FS unit file looks good to my untrained eye. I did not use the sysvinit files that are also in that FS debian directory. I successfully used systemd to start, stop, and enable a few other system services with success so there must be a tweak to the FS unit file that I am missing. I can start FS manually and it runs normally. A Google search revealed a number of complaints that systemd would emit an error message with its “enable” command, yet it would successfully enable the service; this was with a few different services on Debian and Ubuntu, so it seems there might still be some weirdness with systemd on Debian. Has anybody gotten systemd to start FS reliably? Has anybody figured out how to make systemd detect FreeSWITCH running so that it doesn’t restart it repeatedly? Once I figure out how to tame systemd I will document my findings in Confluence as these are the last steps that allow you to get FS up and running quickly. Thanks. --- Bote _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org -- Best regards, Volodymyr
The ones in tree are only for the packages, you would need to modify those to be the correct paths and manually install them. You can follow the patches that went in to the debian packaging for some indication of how to install them correctly.
On Aug 17, 2015, at 1:13 PM, Bote Man <bote_radio@botecomm.com> wrote:
I copied freeswitch.xml to /etc/freeswitch but I think that is only for sysvinit anyway.
I compiled FS from source which runs in a different directory tree than the Debian package. The debs run under /etc/freeswitch while the compiled version runs under /usr/local/freeswitch as I have it configured.
Thanks.
Bote
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Volodymyr Fedorov Sent: Monday, 17 August, 2015 12:48 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS
Hello, Do you copied sample configs to /etc/freeswitch directory.
On Mon, Aug 17, 2015 at 7:36 PM, Bote Man <bote_radio@botecomm.com <mailto:bote_radio@botecomm.com>> wrote: I’m struggling to get systemd to start FreeSWITCH at boot time and also leave it running once it starts.
Problem #1 – “systemd enable freeswitch” outputs the right steps, but ends with an error message. The error I get is “No such file or directory” but that is less than helpful.
Problem #2 – When I start FreeSWITCH with “systemd start freeswitch” it starts alright, but systemd does not detect FS running properly so it kills it after the specified 45 seconds elapses and restarts it. I can see this in top when FS gets a new pid.
Details -------- It’s a new installation of Debian 8.1 and I chose to use systemd as the init process. I compiled FreeSWITCH from source using the latest Master as of late July.
The only section of the unit file that is supposed to be used by the “enable” command is the [Install] section and that simply points to the multi-user.target as expected.
I do not know what to do with the 2 other sample systemd files in /usr/src/freeswitch/debian, perhaps they are key. I have read up on systemd and the FS unit file looks good to my untrained eye. I did not use the sysvinit files that are also in that FS debian directory.
I successfully used systemd to start, stop, and enable a few other system services with success so there must be a tweak to the FS unit file that I am missing. I can start FS manually and it runs normally.
A Google search revealed a number of complaints that systemd would emit an error message with its “enable” command, yet it would successfully enable the service; this was with a few different services on Debian and Ubuntu, so it seems there might still be some weirdness with systemd on Debian.
Has anybody gotten systemd to start FS reliably?
Has anybody figured out how to make systemd detect FreeSWITCH running so that it doesn’t restart it repeatedly?
Once I figure out how to tame systemd I will document my findings in Confluence as these are the last steps that allow you to get FS up and running quickly.
Thanks.
--- Bote
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <mailto:consulting@freeswitch.org> http://www.freeswitchsolutions.com <http://www.freeswitchsolutions.com/>
Official FreeSWITCH Sites http://www.freeswitch.org <http://www.freeswitch.org/> http://confluence.freeswitch.org <http://confluence.freeswitch.org/> http://www.cluecon.com <http://www.cluecon.com/>
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <mailto:FreeSWITCH-users@lists.freeswitch.org> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users <http://lists.freeswitch.org/mailman/options/freeswitch-users> http://www.freeswitch.org <http://www.freeswitch.org/>
-- Best regards, Volodymyr _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Yeah, I saw that ticket where you changed the WorkingDirectory from /run/freeswitch to /var/run/freeswitch and I made those changes to mine, but it’s still flunky. I’ll keep hammering away at it. Thanks. Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael Jerris Sent: Monday, 17 August, 2015 14:22 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS The ones in tree are only for the packages, you would need to modify those to be the correct paths and manually install them. You can follow the patches that went in to the debian packaging for some indication of how to install them correctly. On Aug 17, 2015, at 1:13 PM, Bote Man <bote_radio@botecomm.com> wrote: I copied freeswitch.xml to /etc/freeswitch but I think that is only for sysvinit anyway. I compiled FS from source which runs in a different directory tree than the Debian package. The debs run under /etc/freeswitch while the compiled version runs under /usr/local/freeswitch as I have it configured. Thanks. Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Volodymyr Fedorov Sent: Monday, 17 August, 2015 12:48 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS Hello, Do you copied sample configs to /etc/freeswitch directory. On Mon, Aug 17, 2015 at 7:36 PM, Bote Man < <mailto:bote_radio@botecomm.com> bote_radio@botecomm.com> wrote: I’m struggling to get systemd to start FreeSWITCH at boot time and also leave it running once it starts. Problem #1 – “systemd enable freeswitch” outputs the right steps, but ends with an error message. The error I get is “No such file or directory” but that is less than helpful. Problem #2 – When I start FreeSWITCH with “systemd start freeswitch” it starts alright, but systemd does not detect FS running properly so it kills it after the specified 45 seconds elapses and restarts it. I can see this in top when FS gets a new pid. Details -------- It’s a new installation of Debian 8.1 and I chose to use systemd as the init process. I compiled FreeSWITCH from source using the latest Master as of late July. The only section of the unit file that is supposed to be used by the “enable” command is the [Install] section and that simply points to the multi-user.target as expected. I do not know what to do with the 2 other sample systemd files in /usr/src/freeswitch/debian, perhaps they are key. I have read up on systemd and the FS unit file looks good to my untrained eye. I did not use the sysvinit files that are also in that FS debian directory. I successfully used systemd to start, stop, and enable a few other system services with success so there must be a tweak to the FS unit file that I am missing. I can start FS manually and it runs normally. A Google search revealed a number of complaints that systemd would emit an error message with its “enable” command, yet it would successfully enable the service; this was with a few different services on Debian and Ubuntu, so it seems there might still be some weirdness with systemd on Debian. Has anybody gotten systemd to start FS reliably? Has anybody figured out how to make systemd detect FreeSWITCH running so that it doesn’t restart it repeatedly? Once I figure out how to tame systemd I will document my findings in Confluence as these are the last steps that allow you to get FS up and running quickly. Thanks. --- Bote _________________________________________________________________________ Professional FreeSWITCH Consulting Services: <mailto:consulting@freeswitch.org> consulting@freeswitch.org <http://www.freeswitchsolutions.com/> http://www.freeswitchsolutions.com Official FreeSWITCH Sites <http://www.freeswitch.org/> http://www.freeswitch.org <http://confluence.freeswitch.org/> http://confluence.freeswitch.org <http://www.cluecon.com/> http://www.cluecon.com FreeSWITCH-users mailing list <mailto:FreeSWITCH-users@lists.freeswitch.org> FreeSWITCH-users@lists.freeswitch.org <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: <http://lists.freeswitch.org/mailman/options/freeswitch-users> http://lists.freeswitch.org/mailman/options/freeswitch-users <http://www.freeswitch.org/> http://www.freeswitch.org -- Best regards, Volodymyr _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
I couldn't get FreeSWITCH compiled from source to work under systemd on Debian Jessie without having the pid file under /usr/local/freeswitch Here are the contents of my freeswitch.service file that let me get it working if it helps you. [Unit] Description=freeswitch ;After=syslog.target network.target local-fs.target After=syslog.target network-online.target local-fs.target [Service] ; service Type=forking PIDFile=/usr/local/freeswitch/run/freeswitch.pid PermissionsStartOnly=true ExecStartPre=/bin/mkdir -p /usr/local/freeswitch/run ExecStartPre=/bin/chown freeswitch:daemon /usr/local/freeswitch/run ExecStart=/usr/local/freeswitch/bin/freeswitch -ncwait -nonat TimeoutSec=45s Restart=always ; exec WorkingDirectory=/usr/local/freeswitch/run User=freeswitch Group=daemon LimitCORE=infinity LimitNOFILE=100000 LimitNPROC=60000 ;LimitSTACK=240 LimitRTPRIO=infinity LimitRTTIME=7000000 IOSchedulingClass=realtime IOSchedulingPriority=2 CPUSchedulingPolicy=rr CPUSchedulingPriority=89 UMask=0007 [Install] WantedBy=multi-user.target ----- Jason On Mon, Aug 17, 2015 at 12:41 PM, Bote Man <bote_radio@botecomm.com> wrote:
Yeah, I saw that ticket where you changed the WorkingDirectory from /run/freeswitch to /var/run/freeswitch and I made those changes to mine, but it’s still flunky.
I’ll keep hammering away at it.
Thanks.
Bote
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Michael Jerris *Sent:* Monday, 17 August, 2015 14:22
*To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] systemd won't enable for automatic start of FS
The ones in tree are only for the packages, you would need to modify those to be the correct paths and manually install them. You can follow the patches that went in to the debian packaging for some indication of how to install them correctly.
On Aug 17, 2015, at 1:13 PM, Bote Man <bote_radio@botecomm.com> wrote:
I copied freeswitch.xml to /etc/freeswitch but I think that is only for sysvinit anyway.
I compiled FS from source which runs in a different directory tree than the Debian package. The debs run under /etc/freeswitch while the compiled version runs under /usr/local/freeswitch as I have it configured.
Thanks.
Bote
*From:* freeswitch-users-bounces@lists.freeswitch.org [ mailto:freeswitch-users-bounces@lists.freeswitch.org <freeswitch-users-bounces@lists.freeswitch.org>] *On Behalf Of *Volodymyr Fedorov *Sent:* Monday, 17 August, 2015 12:48 *To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] systemd won't enable for automatic start of FS
Hello,
Do you copied sample configs to /etc/freeswitch directory.
On Mon, Aug 17, 2015 at 7:36 PM, Bote Man <bote_radio@botecomm.com> wrote:
I’m struggling to get systemd to start FreeSWITCH at boot time and also leave it running once it starts.
Problem #1 – “systemd enable freeswitch” outputs the right steps, but ends with an error message. The error I get is “No such file or directory” but that is less than helpful.
Problem #2 – When I start FreeSWITCH with “systemd start freeswitch” it starts alright, but systemd does not detect FS running properly so it kills it after the specified 45 seconds elapses and restarts it. I can see this in top when FS gets a new pid.
Details
--------
It’s a new installation of Debian 8.1 and I chose to use systemd as the init process. I compiled FreeSWITCH from source using the latest Master as of late July.
The only section of the unit file that is supposed to be used by the “enable” command is the [Install] section and that simply points to the multi-user.target as expected.
I do not know what to do with the 2 other sample systemd files in /usr/src/freeswitch/debian, perhaps they are key. I have read up on systemd and the FS unit file looks good to my untrained eye. I did not use the sysvinit files that are also in that FS debian directory.
I successfully used systemd to start, stop, and enable a few other system services with success so there must be a tweak to the FS unit file that I am missing. I can start FS manually and it runs normally.
A Google search revealed a number of complaints that systemd would emit an error message with its “enable” command, yet it would successfully enable the service; this was with a few different services on Debian and Ubuntu, so it seems there might still be some weirdness with systemd on Debian.
Has anybody gotten systemd to start FS reliably?
Has anybody figured out how to make systemd detect FreeSWITCH running so that it doesn’t restart it repeatedly?
Once I figure out how to tame systemd I will document my findings in Confluence as these are the last steps that allow you to get FS up and running quickly.
Thanks.
---
Bote
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
--
Best regards,
Volodymyr
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Group=daemon
This is a key difference since I chown freeswitch:freeswitch the way Travis set it up. But perhaps systemd can’t see FS running unless it is in the daemon group, so it keeps restarting FS. I’ll change the group of the files to daemon and make that change to my unit file to see if that helps. Anyway, I will try this shortly today and post here. THANK YOU! Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Komar, Jason Sent: Monday, 17 August, 2015 14:51 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS I couldn't get FreeSWITCH compiled from source to work under systemd on Debian Jessie without having the pid file under /usr/local/freeswitch Here are the contents of my freeswitch.service file that let me get it working if it helps you. [Unit] Description=freeswitch ;After=syslog.target network.target local-fs.target After=syslog.target network-online.target local-fs.target [Service] ; service Type=forking PIDFile=/usr/local/freeswitch/run/freeswitch.pid PermissionsStartOnly=true ExecStartPre=/bin/mkdir -p /usr/local/freeswitch/run ExecStartPre=/bin/chown freeswitch:daemon /usr/local/freeswitch/run ExecStart=/usr/local/freeswitch/bin/freeswitch -ncwait -nonat TimeoutSec=45s Restart=always ; exec WorkingDirectory=/usr/local/freeswitch/run User=freeswitch Group=daemon LimitCORE=infinity LimitNOFILE=100000 LimitNPROC=60000 ;LimitSTACK=240 LimitRTPRIO=infinity LimitRTTIME=7000000 IOSchedulingClass=realtime IOSchedulingPriority=2 CPUSchedulingPolicy=rr CPUSchedulingPriority=89 UMask=0007 [Install] WantedBy=multi-user.target ----- Jason On Mon, Aug 17, 2015 at 12:41 PM, Bote Man <bote_radio@botecomm.com> wrote: Yeah, I saw that ticket where you changed the WorkingDirectory from /run/freeswitch to /var/run/freeswitch and I made those changes to mine, but it’s still flunky. I’ll keep hammering away at it. Thanks. Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael Jerris Sent: Monday, 17 August, 2015 14:22 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS The ones in tree are only for the packages, you would need to modify those to be the correct paths and manually install them. You can follow the patches that went in to the debian packaging for some indication of how to install them correctly. On Aug 17, 2015, at 1:13 PM, Bote Man <bote_radio@botecomm.com> wrote: I copied freeswitch.xml to /etc/freeswitch but I think that is only for sysvinit anyway. I compiled FS from source which runs in a different directory tree than the Debian package. The debs run under /etc/freeswitch while the compiled version runs under /usr/local/freeswitch as I have it configured. Thanks. Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Volodymyr Fedorov Sent: Monday, 17 August, 2015 12:48 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS Hello, Do you copied sample configs to /etc/freeswitch directory. On Mon, Aug 17, 2015 at 7:36 PM, Bote Man < <mailto:bote_radio@botecomm.com> bote_radio@botecomm.com> wrote: I’m struggling to get systemd to start FreeSWITCH at boot time and also leave it running once it starts. Problem #1 – “systemd enable freeswitch” outputs the right steps, but ends with an error message. The error I get is “No such file or directory” but that is less than helpful. Problem #2 – When I start FreeSWITCH with “systemd start freeswitch” it starts alright, but systemd does not detect FS running properly so it kills it after the specified 45 seconds elapses and restarts it. I can see this in top when FS gets a new pid. Details -------- It’s a new installation of Debian 8.1 and I chose to use systemd as the init process. I compiled FreeSWITCH from source using the latest Master as of late July. The only section of the unit file that is supposed to be used by the “enable” command is the [Install] section and that simply points to the multi-user.target as expected. I do not know what to do with the 2 other sample systemd files in /usr/src/freeswitch/debian, perhaps they are key. I have read up on systemd and the FS unit file looks good to my untrained eye. I did not use the sysvinit files that are also in that FS debian directory. I successfully used systemd to start, stop, and enable a few other system services with success so there must be a tweak to the FS unit file that I am missing. I can start FS manually and it runs normally. A Google search revealed a number of complaints that systemd would emit an error message with its “enable” command, yet it would successfully enable the service; this was with a few different services on Debian and Ubuntu, so it seems there might still be some weirdness with systemd on Debian. Has anybody gotten systemd to start FS reliably? Has anybody figured out how to make systemd detect FreeSWITCH running so that it doesn’t restart it repeatedly? Once I figure out how to tame systemd I will document my findings in Confluence as these are the last steps that allow you to get FS up and running quickly. Thanks. --- Bote _________________________________________________________________________ Professional FreeSWITCH Consulting Services: <mailto:consulting@freeswitch.org> consulting@freeswitch.org <http://www.freeswitchsolutions.com/> http://www.freeswitchsolutions.com Official FreeSWITCH Sites <http://www.freeswitch.org/> http://www.freeswitch.org <http://confluence.freeswitch.org/> http://confluence.freeswitch.org <http://www.cluecon.com/> http://www.cluecon.com FreeSWITCH-users mailing list <mailto:FreeSWITCH-users@lists.freeswitch.org> FreeSWITCH-users@lists.freeswitch.org <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: <http://lists.freeswitch.org/mailman/options/freeswitch-users> http://lists.freeswitch.org/mailman/options/freeswitch-users <http://www.freeswitch.org/> http://www.freeswitch.org -- Best regards, Volodymyr _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
This works! I don’t know how, but I will not argue with success. FreeSWITCH even starts after rebooting so this is a Good Thing. I note that systemctl still emits this erroneous error: systemctl enable freeswitch Synchronizing state for freeswitch.service with sysvinit using update-rc.d... Executing /usr/sbin/update-rc.d freeswitch defaults Executing /usr/sbin/update-rc.d freeswitch enable Failed to execute operation: No such file or directory It did execute the desired operation which was to start FreeSWITCH at boot time. A Google search revealed a number of complaints from back in May and June that systemd reports that error even though it works. I would have suspected it was fixed by now, but as long as we are aware of it I can live with it. Thank you! Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Komar, Jason Sent: Monday, 17 August, 2015 14:51 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS I couldn't get FreeSWITCH compiled from source to work under systemd on Debian Jessie without having the pid file under /usr/local/freeswitch Here are the contents of my freeswitch.service file that let me get it working if it helps you. [Unit] Description=freeswitch ;After=syslog.target network.target local-fs.target After=syslog.target network-online.target local-fs.target [Service] ; service Type=forking PIDFile=/usr/local/freeswitch/run/freeswitch.pid PermissionsStartOnly=true ExecStartPre=/bin/mkdir -p /usr/local/freeswitch/run ExecStartPre=/bin/chown freeswitch:daemon /usr/local/freeswitch/run ExecStart=/usr/local/freeswitch/bin/freeswitch -ncwait -nonat TimeoutSec=45s Restart=always ; exec WorkingDirectory=/usr/local/freeswitch/run User=freeswitch Group=daemon LimitCORE=infinity LimitNOFILE=100000 LimitNPROC=60000 ;LimitSTACK=240 LimitRTPRIO=infinity LimitRTTIME=7000000 IOSchedulingClass=realtime IOSchedulingPriority=2 CPUSchedulingPolicy=rr CPUSchedulingPriority=89 UMask=0007 [Install] WantedBy=multi-user.target ----- Jason On Mon, Aug 17, 2015 at 12:41 PM, Bote Man <bote_radio@botecomm.com> wrote: Yeah, I saw that ticket where you changed the WorkingDirectory from /run/freeswitch to /var/run/freeswitch and I made those changes to mine, but it’s still flunky. I’ll keep hammering away at it. Thanks. Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael Jerris Sent: Monday, 17 August, 2015 14:22 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS The ones in tree are only for the packages, you would need to modify those to be the correct paths and manually install them. You can follow the patches that went in to the debian packaging for some indication of how to install them correctly. On Aug 17, 2015, at 1:13 PM, Bote Man <bote_radio@botecomm.com> wrote: I copied freeswitch.xml to /etc/freeswitch but I think that is only for sysvinit anyway. I compiled FS from source which runs in a different directory tree than the Debian package. The debs run under /etc/freeswitch while the compiled version runs under /usr/local/freeswitch as I have it configured. Thanks. Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Volodymyr Fedorov Sent: Monday, 17 August, 2015 12:48 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS Hello, Do you copied sample configs to /etc/freeswitch directory. On Mon, Aug 17, 2015 at 7:36 PM, Bote Man < <mailto:bote_radio@botecomm.com> bote_radio@botecomm.com> wrote: I’m struggling to get systemd to start FreeSWITCH at boot time and also leave it running once it starts. Problem #1 – “systemd enable freeswitch” outputs the right steps, but ends with an error message. The error I get is “No such file or directory” but that is less than helpful. Problem #2 – When I start FreeSWITCH with “systemd start freeswitch” it starts alright, but systemd does not detect FS running properly so it kills it after the specified 45 seconds elapses and restarts it. I can see this in top when FS gets a new pid. Details -------- It’s a new installation of Debian 8.1 and I chose to use systemd as the init process. I compiled FreeSWITCH from source using the latest Master as of late July. The only section of the unit file that is supposed to be used by the “enable” command is the [Install] section and that simply points to the multi-user.target as expected. I do not know what to do with the 2 other sample systemd files in /usr/src/freeswitch/debian, perhaps they are key. I have read up on systemd and the FS unit file looks good to my untrained eye. I did not use the sysvinit files that are also in that FS debian directory. I successfully used systemd to start, stop, and enable a few other system services with success so there must be a tweak to the FS unit file that I am missing. I can start FS manually and it runs normally. A Google search revealed a number of complaints that systemd would emit an error message with its “enable” command, yet it would successfully enable the service; this was with a few different services on Debian and Ubuntu, so it seems there might still be some weirdness with systemd on Debian. Has anybody gotten systemd to start FS reliably? Has anybody figured out how to make systemd detect FreeSWITCH running so that it doesn’t restart it repeatedly? Once I figure out how to tame systemd I will document my findings in Confluence as these are the last steps that allow you to get FS up and running quickly. Thanks. --- Bote _________________________________________________________________________ Professional FreeSWITCH Consulting Services: <mailto:consulting@freeswitch.org> consulting@freeswitch.org <http://www.freeswitchsolutions.com/> http://www.freeswitchsolutions.com Official FreeSWITCH Sites <http://www.freeswitch.org/> http://www.freeswitch.org <http://confluence.freeswitch.org/> http://confluence.freeswitch.org <http://www.cluecon.com/> http://www.cluecon.com FreeSWITCH-users mailing list <mailto:FreeSWITCH-users@lists.freeswitch.org> FreeSWITCH-users@lists.freeswitch.org <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: <http://lists.freeswitch.org/mailman/options/freeswitch-users> http://lists.freeswitch.org/mailman/options/freeswitch-users <http://www.freeswitch.org/> http://www.freeswitch.org -- Best regards, Volodymyr _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
ok, I'm too late to send you this: https://freeswitch.org/jira/browse/FS-7937 On Mon, Aug 17, 2015 at 10:41 PM, Bote Man <bote_radio@botecomm.com> wrote:
This works! I don’t know how, but I will not argue with success. FreeSWITCH even starts after rebooting so this is a Good Thing.
I note that systemctl still emits this erroneous error:
systemctl enable freeswitch
Synchronizing state for freeswitch.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d freeswitch defaults
Executing /usr/sbin/update-rc.d freeswitch enable
Failed to execute operation: No such file or directory
It did execute the desired operation which was to start FreeSWITCH at boot time. A Google search revealed a number of complaints from back in May and June that systemd reports that error even though it works. I would have suspected it was fixed by now, but as long as we are aware of it I can live with it.
Thank you!
Bote
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Komar, Jason Sent: Monday, 17 August, 2015 14:51
To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS
I couldn't get FreeSWITCH compiled from source to work under systemd on Debian Jessie without having the pid file under /usr/local/freeswitch
Here are the contents of my freeswitch.service file that let me get it working if it helps you.
[Unit]
Description=freeswitch
;After=syslog.target network.target local-fs.target
After=syslog.target network-online.target local-fs.target
[Service]
; service
Type=forking
PIDFile=/usr/local/freeswitch/run/freeswitch.pid
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /usr/local/freeswitch/run
ExecStartPre=/bin/chown freeswitch:daemon /usr/local/freeswitch/run
ExecStart=/usr/local/freeswitch/bin/freeswitch -ncwait -nonat
TimeoutSec=45s
Restart=always
; exec
WorkingDirectory=/usr/local/freeswitch/run
User=freeswitch
Group=daemon
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
;LimitSTACK=240
LimitRTPRIO=infinity
LimitRTTIME=7000000
IOSchedulingClass=realtime
IOSchedulingPriority=2
CPUSchedulingPolicy=rr
CPUSchedulingPriority=89
UMask=0007
[Install]
WantedBy=multi-user.target
-----
Jason
On Mon, Aug 17, 2015 at 12:41 PM, Bote Man <bote_radio@botecomm.com> wrote:
Yeah, I saw that ticket where you changed the WorkingDirectory from /run/freeswitch to /var/run/freeswitch and I made those changes to mine, but it’s still flunky.
I’ll keep hammering away at it.
Thanks.
Bote
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael Jerris Sent: Monday, 17 August, 2015 14:22
To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS
The ones in tree are only for the packages, you would need to modify those to be the correct paths and manually install them. You can follow the patches that went in to the debian packaging for some indication of how to install them correctly.
On Aug 17, 2015, at 1:13 PM, Bote Man <bote_radio@botecomm.com> wrote:
I copied freeswitch.xml to /etc/freeswitch but I think that is only for sysvinit anyway.
I compiled FS from source which runs in a different directory tree than the Debian package. The debs run under /etc/freeswitch while the compiled version runs under /usr/local/freeswitch as I have it configured.
Thanks.
Bote
From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Volodymyr Fedorov Sent: Monday, 17 August, 2015 12:48 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS
Hello,
Do you copied sample configs to /etc/freeswitch directory.
On Mon, Aug 17, 2015 at 7:36 PM, Bote Man <bote_radio@botecomm.com> wrote:
I’m struggling to get systemd to start FreeSWITCH at boot time and also leave it running once it starts.
Problem #1 – “systemd enable freeswitch” outputs the right steps, but ends with an error message. The error I get is “No such file or directory” but that is less than helpful.
Problem #2 – When I start FreeSWITCH with “systemd start freeswitch” it starts alright, but systemd does not detect FS running properly so it kills it after the specified 45 seconds elapses and restarts it. I can see this in top when FS gets a new pid.
Details
--------
It’s a new installation of Debian 8.1 and I chose to use systemd as the init process. I compiled FreeSWITCH from source using the latest Master as of late July.
The only section of the unit file that is supposed to be used by the “enable” command is the [Install] section and that simply points to the multi-user.target as expected.
I do not know what to do with the 2 other sample systemd files in /usr/src/freeswitch/debian, perhaps they are key. I have read up on systemd and the FS unit file looks good to my untrained eye. I did not use the sysvinit files that are also in that FS debian directory.
I successfully used systemd to start, stop, and enable a few other system services with success so there must be a tweak to the FS unit file that I am missing. I can start FS manually and it runs normally.
A Google search revealed a number of complaints that systemd would emit an error message with its “enable” command, yet it would successfully enable the service; this was with a few different services on Debian and Ubuntu, so it seems there might still be some weirdness with systemd on Debian.
Has anybody gotten systemd to start FS reliably?
Has anybody figured out how to make systemd detect FreeSWITCH running so that it doesn’t restart it repeatedly?
Once I figure out how to tame systemd I will document my findings in Confluence as these are the last steps that allow you to get FS up and running quickly.
Thanks.
---
Bote
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
--
Best regards,
Volodymyr
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
This is really more general information than anything specific to your problem; that said, I'm posting this as my fingers got singed a time or two, courtesy of it. When I encounter an error slash problem like the one you did, one of the first things I usually do - unless I have a reason not to - is: check to see that the ownership and permissions on the directories a daemon's PID file. log file, etc., are supposed to be written to will allow the daemon (or other program) to actually write from / read to those files. I also check same on any temp directories the program uses and directories containing configuration files. One way to do this that's relatively safe is this: say, for example, I had a daemon named "dproc" that was supposed to run as user "dproc", group " dproc", with the. pid file going in /usr/local/xware/run . If I were to run: sudo -u dproc -g dproc touch /usr/local/xware/dproc.pid I would know near immediately whether that user and group would have problems accessing that file. And why. The other that's proved to be helpful is checking the permissions and ownership of a parent directory; using the above example again, if I saw that the output of ls -ld /usr/local/xware was dr-x------ nobody nobody ... then I'd probably wind up saving myself a bit of time and grief. Hope that's of help to someone. - Larry On Aug 17, 2015 4:41 PM, "Bote Man" <bote_radio@botecomm.com> wrote:
This works! I don’t know how, but I will not argue with success. FreeSWITCH even starts after rebooting so this is a Good Thing.
I note that systemctl still emits this erroneous error:
systemctl enable freeswitch
Synchronizing state for freeswitch.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d freeswitch defaults
Executing /usr/sbin/update-rc.d freeswitch enable
Failed to execute operation: No such file or directory
It did execute the desired operation which was to start FreeSWITCH at boot time. A Google search revealed a number of complaints from back in May and June that systemd reports that error even though it works. I would have suspected it was fixed by now, but as long as we are aware of it I can live with it.
Thank you!
Bote
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Komar, Jason *Sent:* Monday, 17 August, 2015 14:51 *To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] systemd won't enable for automatic start of FS
I couldn't get FreeSWITCH compiled from source to work under systemd on Debian Jessie without having the pid file under /usr/local/freeswitch
Here are the contents of my freeswitch.service file that let me get it working if it helps you.
[Unit]
Description=freeswitch
;After=syslog.target network.target local-fs.target
After=syslog.target network-online.target local-fs.target
[Service]
; service
Type=forking
PIDFile=/usr/local/freeswitch/run/freeswitch.pid
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /usr/local/freeswitch/run
ExecStartPre=/bin/chown freeswitch:daemon /usr/local/freeswitch/run
ExecStart=/usr/local/freeswitch/bin/freeswitch -ncwait -nonat
TimeoutSec=45s
Restart=always
; exec
WorkingDirectory=/usr/local/freeswitch/run
User=freeswitch
Group=daemon
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
;LimitSTACK=240
LimitRTPRIO=infinity
LimitRTTIME=7000000
IOSchedulingClass=realtime
IOSchedulingPriority=2
CPUSchedulingPolicy=rr
CPUSchedulingPriority=89
UMask=0007
[Install]
WantedBy=multi-user.target
-----
Jason
On Mon, Aug 17, 2015 at 12:41 PM, Bote Man <bote_radio@botecomm.com> wrote:
Yeah, I saw that ticket where you changed the WorkingDirectory from /run/freeswitch to /var/run/freeswitch and I made those changes to mine, but it’s still flunky.
I’ll keep hammering away at it.
Thanks.
Bote
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Michael Jerris *Sent:* Monday, 17 August, 2015 14:22
*To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] systemd won't enable for automatic start of FS
The ones in tree are only for the packages, you would need to modify those to be the correct paths and manually install them. You can follow the patches that went in to the debian packaging for some indication of how to install them correctly.
On Aug 17, 2015, at 1:13 PM, Bote Man <bote_radio@botecomm.com> wrote:
I copied freeswitch.xml to /etc/freeswitch but I think that is only for sysvinit anyway.
I compiled FS from source which runs in a different directory tree than the Debian package. The debs run under /etc/freeswitch while the compiled version runs under /usr/local/freeswitch as I have it configured.
Thanks.
Bote
*From:* freeswitch-users-bounces@lists.freeswitch.org [ mailto:freeswitch-users-bounces@lists.freeswitch.org <freeswitch-users-bounces@lists.freeswitch.org>] *On Behalf Of *Volodymyr Fedorov *Sent:* Monday, 17 August, 2015 12:48 *To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] systemd won't enable for automatic start of FS
Hello,
Do you copied sample configs to /etc/freeswitch directory.
On Mon, Aug 17, 2015 at 7:36 PM, Bote Man <bote_radio@botecomm.com> wrote:
I’m struggling to get systemd to start FreeSWITCH at boot time and also leave it running once it starts.
Problem #1 – “systemd enable freeswitch” outputs the right steps, but ends with an error message. The error I get is “No such file or directory” but that is less than helpful.
Problem #2 – When I start FreeSWITCH with “systemd start freeswitch” it starts alright, but systemd does not detect FS running properly so it kills it after the specified 45 seconds elapses and restarts it. I can see this in top when FS gets a new pid.
Details
--------
It’s a new installation of Debian 8.1 and I chose to use systemd as the init process. I compiled FreeSWITCH from source using the latest Master as of late July.
The only section of the unit file that is supposed to be used by the “enable” command is the [Install] section and that simply points to the multi-user.target as expected.
I do not know what to do with the 2 other sample systemd files in /usr/src/freeswitch/debian, perhaps they are key. I have read up on systemd and the FS unit file looks good to my untrained eye. I did not use the sysvinit files that are also in that FS debian directory.
I successfully used systemd to start, stop, and enable a few other system services with success so there must be a tweak to the FS unit file that I am missing. I can start FS manually and it runs normally.
A Google search revealed a number of complaints that systemd would emit an error message with its “enable” command, yet it would successfully enable the service; this was with a few different services on Debian and Ubuntu, so it seems there might still be some weirdness with systemd on Debian.
Has anybody gotten systemd to start FS reliably?
Has anybody figured out how to make systemd detect FreeSWITCH running so that it doesn’t restart it repeatedly?
Once I figure out how to tame systemd I will document my findings in Confluence as these are the last steps that allow you to get FS up and running quickly.
Thanks.
---
Bote
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
--
Best regards,
Volodymyr
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
That certainly is helpful, thanks Larry. I don’t mess around in linux often enough to keep these tools and tricks at the top of mind, but it turned out that FS does the Right Thing when started as root, then drops to the user specified on its command line. I’ll keep your tips in mind, though. Thanks. Bote From: Larry Morley Sent: Monday, 07 September, 2015 12:37 Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS This is really more general information than anything specific to your problem; that said, I'm posting this as my fingers got singed a time or two, courtesy of it. When I encounter an error slash problem like the one you did, one of the first things I usually do - unless I have a reason not to - is: check to see that the ownership and permissions on the directories a daemon's PID file. log file, etc., are supposed to be written to will allow the daemon (or other program) to actually write from / read to those files. I also check same on any temp directories the program uses and directories containing configuration files. One way to do this that's relatively safe is this: say, for example, I had a daemon named "dproc" that was supposed to run as user "dproc", group " dproc", with the. pid file going in /usr/local/xware/run . If I were to run: sudo -u dproc -g dproc touch /usr/local/xware/dproc.pid I would know near immediately whether that user and group would have problems accessing that file. And why. The other that's proved to be helpful is checking the permissions and ownership of a parent directory; using the above example again, if I saw that the output of ls -ld /usr/local/xware was dr-x------ nobody nobody ... then I'd probably wind up saving myself a bit of time and grief. Hope that's of help to someone. - Larry On Aug 17, 2015 4:41 PM, "Bote Man" <bote_radio@botecomm.com> wrote: This works! I don’t know how, but I will not argue with success. FreeSWITCH even starts after rebooting so this is a Good Thing. I note that systemctl still emits this erroneous error: systemctl enable freeswitch Synchronizing state for freeswitch.service with sysvinit using update-rc.d... Executing /usr/sbin/update-rc.d freeswitch defaults Executing /usr/sbin/update-rc.d freeswitch enable Failed to execute operation: No such file or directory It did execute the desired operation which was to start FreeSWITCH at boot time. A Google search revealed a number of complaints from back in May and June that systemd reports that error even though it works. I would have suspected it was fixed by now, but as long as we are aware of it I can live with it. Thank you! Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Komar, Jason Sent: Monday, 17 August, 2015 14:51 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS I couldn't get FreeSWITCH compiled from source to work under systemd on Debian Jessie without having the pid file under /usr/local/freeswitch Here are the contents of my freeswitch.service file that let me get it working if it helps you. [Unit] Description=freeswitch ;After=syslog.target network.target local-fs.target After=syslog.target network-online.target local-fs.target [Service] ; service Type=forking PIDFile=/usr/local/freeswitch/run/freeswitch.pid PermissionsStartOnly=true ExecStartPre=/bin/mkdir -p /usr/local/freeswitch/run ExecStartPre=/bin/chown freeswitch:daemon /usr/local/freeswitch/run ExecStart=/usr/local/freeswitch/bin/freeswitch -ncwait -nonat TimeoutSec=45s Restart=always ; exec WorkingDirectory=/usr/local/freeswitch/run User=freeswitch Group=daemon LimitCORE=infinity LimitNOFILE=100000 LimitNPROC=60000 ;LimitSTACK=240 LimitRTPRIO=infinity LimitRTTIME=7000000 IOSchedulingClass=realtime IOSchedulingPriority=2 CPUSchedulingPolicy=rr CPUSchedulingPriority=89 UMask=0007 [Install] WantedBy=multi-user.target ----- Jason On Mon, Aug 17, 2015 at 12:41 PM, Bote Man <bote_radio@botecomm.com> wrote: Yeah, I saw that ticket where you changed the WorkingDirectory from /run/freeswitch to /var/run/freeswitch and I made those changes to mine, but it’s still flunky. I’ll keep hammering away at it. Thanks. Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael Jerris Sent: Monday, 17 August, 2015 14:22 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS The ones in tree are only for the packages, you would need to modify those to be the correct paths and manually install them. You can follow the patches that went in to the debian packaging for some indication of how to install them correctly. On Aug 17, 2015, at 1:13 PM, Bote Man <bote_radio@botecomm.com> wrote: I copied freeswitch.xml to /etc/freeswitch but I think that is only for sysvinit anyway. I compiled FS from source which runs in a different directory tree than the Debian package. The debs run under /etc/freeswitch while the compiled version runs under /usr/local/freeswitch as I have it configured. Thanks. Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Volodymyr Fedorov Sent: Monday, 17 August, 2015 12:48 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS Hello, Do you copied sample configs to /etc/freeswitch directory. On Mon, Aug 17, 2015 at 7:36 PM, Bote Man < <mailto:bote_radio@botecomm.com> bote_radio@botecomm.com> wrote: I’m struggling to get systemd to start FreeSWITCH at boot time and also leave it running once it starts. Problem #1 – “systemd enable freeswitch” outputs the right steps, but ends with an error message. The error I get is “No such file or directory” but that is less than helpful. Problem #2 – When I start FreeSWITCH with “systemd start freeswitch” it starts alright, but systemd does not detect FS running properly so it kills it after the specified 45 seconds elapses and restarts it. I can see this in top when FS gets a new pid. Details -------- It’s a new installation of Debian 8.1 and I chose to use systemd as the init process. I compiled FreeSWITCH from source using the latest Master as of late July. The only section of the unit file that is supposed to be used by the “enable” command is the [Install] section and that simply points to the multi-user.target as expected. I do not know what to do with the 2 other sample systemd files in /usr/src/freeswitch/debian, perhaps they are key. I have read up on systemd and the FS unit file looks good to my untrained eye. I did not use the sysvinit files that are also in that FS debian directory. I successfully used systemd to start, stop, and enable a few other system services with success so there must be a tweak to the FS unit file that I am missing. I can start FS manually and it runs normally. A Google search revealed a number of complaints that systemd would emit an error message with its “enable” command, yet it would successfully enable the service; this was with a few different services on Debian and Ubuntu, so it seems there might still be some weirdness with systemd on Debian. Has anybody gotten systemd to start FS reliably? Has anybody figured out how to make systemd detect FreeSWITCH running so that it doesn’t restart it repeatedly? Once I figure out how to tame systemd I will document my findings in Confluence as these are the last steps that allow you to get FS up and running quickly. Thanks. --- Bote _________________________________________________________________________ Professional FreeSWITCH Consulting Services: <mailto:consulting@freeswitch.org> consulting@freeswitch.org <http://www.freeswitchsolutions.com/> http://www.freeswitchsolutions.com Official FreeSWITCH Sites <http://www.freeswitch.org/> http://www.freeswitch.org <http://confluence.freeswitch.org/> http://confluence.freeswitch.org <http://www.cluecon.com/> http://www.cluecon.com FreeSWITCH-users mailing list <mailto:FreeSWITCH-users@lists.freeswitch.org> FreeSWITCH-users@lists.freeswitch.org <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: <http://lists.freeswitch.org/mailman/options/freeswitch-users> http://lists.freeswitch.org/mailman/options/freeswitch-users <http://www.freeswitch.org/> http://www.freeswitch.org -- Best regards, Volodymyr _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Hot off the press, here is the section of the 1.6 installation page dealing with systemd. Let me know if it needs improvement. https://freeswitch.org/confluence/display/FREESWITCH/FreeSWITCH+1.6+Video#Fr... I’m afraid to change the title of that page now that it has been out there so long with links to it, so I just created a Debian 8 page that links to it. Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Komar, Jason Sent: Monday, 17 August, 2015 14:51 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS I couldn't get FreeSWITCH compiled from source to work under systemd on Debian Jessie without having the pid file under /usr/local/freeswitch Here are the contents of my freeswitch.service file that let me get it working if it helps you. [Unit] Description=freeswitch ;After=syslog.target network.target local-fs.target After=syslog.target network-online.target local-fs.target [Service] ; service Type=forking PIDFile=/usr/local/freeswitch/run/freeswitch.pid PermissionsStartOnly=true ExecStartPre=/bin/mkdir -p /usr/local/freeswitch/run ExecStartPre=/bin/chown freeswitch:daemon /usr/local/freeswitch/run ExecStart=/usr/local/freeswitch/bin/freeswitch -ncwait -nonat TimeoutSec=45s Restart=always ; exec WorkingDirectory=/usr/local/freeswitch/run User=freeswitch Group=daemon LimitCORE=infinity LimitNOFILE=100000 LimitNPROC=60000 ;LimitSTACK=240 LimitRTPRIO=infinity LimitRTTIME=7000000 IOSchedulingClass=realtime IOSchedulingPriority=2 CPUSchedulingPolicy=rr CPUSchedulingPriority=89 UMask=0007 [Install] WantedBy=multi-user.target ----- Jason On Mon, Aug 17, 2015 at 12:41 PM, Bote Man <bote_radio@botecomm.com> wrote: Yeah, I saw that ticket where you changed the WorkingDirectory from /run/freeswitch to /var/run/freeswitch and I made those changes to mine, but it’s still flunky. I’ll keep hammering away at it. Thanks. Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael Jerris Sent: Monday, 17 August, 2015 14:22 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS The ones in tree are only for the packages, you would need to modify those to be the correct paths and manually install them. You can follow the patches that went in to the debian packaging for some indication of how to install them correctly. On Aug 17, 2015, at 1:13 PM, Bote Man <bote_radio@botecomm.com> wrote: I copied freeswitch.xml to /etc/freeswitch but I think that is only for sysvinit anyway. I compiled FS from source which runs in a different directory tree than the Debian package. The debs run under /etc/freeswitch while the compiled version runs under /usr/local/freeswitch as I have it configured. Thanks. Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Volodymyr Fedorov Sent: Monday, 17 August, 2015 12:48 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS Hello, Do you copied sample configs to /etc/freeswitch directory. On Mon, Aug 17, 2015 at 7:36 PM, Bote Man < <mailto:bote_radio@botecomm.com> bote_radio@botecomm.com> wrote: I’m struggling to get systemd to start FreeSWITCH at boot time and also leave it running once it starts. Problem #1 – “systemd enable freeswitch” outputs the right steps, but ends with an error message. The error I get is “No such file or directory” but that is less than helpful. Problem #2 – When I start FreeSWITCH with “systemd start freeswitch” it starts alright, but systemd does not detect FS running properly so it kills it after the specified 45 seconds elapses and restarts it. I can see this in top when FS gets a new pid. Details -------- It’s a new installation of Debian 8.1 and I chose to use systemd as the init process. I compiled FreeSWITCH from source using the latest Master as of late July. The only section of the unit file that is supposed to be used by the “enable” command is the [Install] section and that simply points to the multi-user.target as expected. I do not know what to do with the 2 other sample systemd files in /usr/src/freeswitch/debian, perhaps they are key. I have read up on systemd and the FS unit file looks good to my untrained eye. I did not use the sysvinit files that are also in that FS debian directory. I successfully used systemd to start, stop, and enable a few other system services with success so there must be a tweak to the FS unit file that I am missing. I can start FS manually and it runs normally. A Google search revealed a number of complaints that systemd would emit an error message with its “enable” command, yet it would successfully enable the service; this was with a few different services on Debian and Ubuntu, so it seems there might still be some weirdness with systemd on Debian. Has anybody gotten systemd to start FS reliably? Has anybody figured out how to make systemd detect FreeSWITCH running so that it doesn’t restart it repeatedly? Once I figure out how to tame systemd I will document my findings in Confluence as these are the last steps that allow you to get FS up and running quickly. Thanks. --- Bote _________________________________________________________________________ Professional FreeSWITCH Consulting Services: <mailto:consulting@freeswitch.org> consulting@freeswitch.org <http://www.freeswitchsolutions.com/> http://www.freeswitchsolutions.com Official FreeSWITCH Sites <http://www.freeswitch.org/> http://www.freeswitch.org <http://confluence.freeswitch.org/> http://confluence.freeswitch.org <http://www.cluecon.com/> http://www.cluecon.com FreeSWITCH-users mailing list <mailto:FreeSWITCH-users@lists.freeswitch.org> FreeSWITCH-users@lists.freeswitch.org <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: <http://lists.freeswitch.org/mailman/options/freeswitch-users> http://lists.freeswitch.org/mailman/options/freeswitch-users <http://www.freeswitch.org/> http://www.freeswitch.org -- Best regards, Volodymyr _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
We probably should modify these files to be configure generated and installed so that we don't have to have different versions stashed in the different packages On Monday, August 17, 2015, Bote Man <bote_radio@botecomm.com> wrote:
Hot off the press, here is the section of the 1.6 installation page dealing with systemd. Let me know if it needs improvement.
https://freeswitch.org/confluence/display/FREESWITCH/FreeSWITCH+1.6+Video#Fr...
I’m afraid to change the title of that page now that it has been out there so long with links to it, so I just created a Debian 8 page that links to it.
Bote
*From:* freeswitch-users-bounces@lists.freeswitch.org <javascript:_e(%7B%7D,'cvml','freeswitch-users-bounces@lists.freeswitch.org');> [mailto:freeswitch-users-bounces@lists.freeswitch.org <javascript:_e(%7B%7D,'cvml','freeswitch-users-bounces@lists.freeswitch.org');>] *On Behalf Of *Komar, Jason *Sent:* Monday, 17 August, 2015 14:51 *To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] systemd won't enable for automatic start of FS
I couldn't get FreeSWITCH compiled from source to work under systemd on Debian Jessie without having the pid file under /usr/local/freeswitch
Here are the contents of my freeswitch.service file that let me get it working if it helps you.
[Unit]
Description=freeswitch
;After=syslog.target network.target local-fs.target
After=syslog.target network-online.target local-fs.target
[Service]
; service
Type=forking
PIDFile=/usr/local/freeswitch/run/freeswitch.pid
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /usr/local/freeswitch/run
ExecStartPre=/bin/chown freeswitch:daemon /usr/local/freeswitch/run
ExecStart=/usr/local/freeswitch/bin/freeswitch -ncwait -nonat
TimeoutSec=45s
Restart=always
; exec
WorkingDirectory=/usr/local/freeswitch/run
User=freeswitch
Group=daemon
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
;LimitSTACK=240
LimitRTPRIO=infinity
LimitRTTIME=7000000
IOSchedulingClass=realtime
IOSchedulingPriority=2
CPUSchedulingPolicy=rr
CPUSchedulingPriority=89
UMask=0007
[Install]
WantedBy=multi-user.target
-----
Jason
On Mon, Aug 17, 2015 at 12:41 PM, Bote Man <bote_radio@botecomm.com <javascript:_e(%7B%7D,'cvml','bote_radio@botecomm.com');>> wrote:
Yeah, I saw that ticket where you changed the WorkingDirectory from /run/freeswitch to /var/run/freeswitch and I made those changes to mine, but it’s still flunky.
I’ll keep hammering away at it.
Thanks.
Bote
*From:* freeswitch-users-bounces@lists.freeswitch.org <javascript:_e(%7B%7D,'cvml','freeswitch-users-bounces@lists.freeswitch.org');> [mailto:freeswitch-users-bounces@lists.freeswitch.org <javascript:_e(%7B%7D,'cvml','freeswitch-users-bounces@lists.freeswitch.org');>] *On Behalf Of *Michael Jerris *Sent:* Monday, 17 August, 2015 14:22
*To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] systemd won't enable for automatic start of FS
The ones in tree are only for the packages, you would need to modify those to be the correct paths and manually install them. You can follow the patches that went in to the debian packaging for some indication of how to install them correctly.
On Aug 17, 2015, at 1:13 PM, Bote Man <bote_radio@botecomm.com <javascript:_e(%7B%7D,'cvml','bote_radio@botecomm.com');>> wrote:
I copied freeswitch.xml to /etc/freeswitch but I think that is only for sysvinit anyway.
I compiled FS from source which runs in a different directory tree than the Debian package. The debs run under /etc/freeswitch while the compiled version runs under /usr/local/freeswitch as I have it configured.
Thanks.
Bote
*From:* freeswitch-users-bounces@lists.freeswitch.org <javascript:_e(%7B%7D,'cvml','freeswitch-users-bounces@lists.freeswitch.org');> [mailto:freeswitch-users-bounces@lists.freeswitch.org <javascript:_e(%7B%7D,'cvml','freeswitch-users-bounces@lists.freeswitch.org');> ] *On Behalf Of *Volodymyr Fedorov *Sent:* Monday, 17 August, 2015 12:48 *To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] systemd won't enable for automatic start of FS
Hello,
Do you copied sample configs to /etc/freeswitch directory.
On Mon, Aug 17, 2015 at 7:36 PM, Bote Man <bote_radio@botecomm.com <javascript:_e(%7B%7D,'cvml','bote_radio@botecomm.com');>> wrote:
I’m struggling to get systemd to start FreeSWITCH at boot time and also leave it running once it starts.
Problem #1 – “systemd enable freeswitch” outputs the right steps, but ends with an error message. The error I get is “No such file or directory” but that is less than helpful.
Problem #2 – When I start FreeSWITCH with “systemd start freeswitch” it starts alright, but systemd does not detect FS running properly so it kills it after the specified 45 seconds elapses and restarts it. I can see this in top when FS gets a new pid.
Details
--------
It’s a new installation of Debian 8.1 and I chose to use systemd as the init process. I compiled FreeSWITCH from source using the latest Master as of late July.
The only section of the unit file that is supposed to be used by the “enable” command is the [Install] section and that simply points to the multi-user.target as expected.
I do not know what to do with the 2 other sample systemd files in /usr/src/freeswitch/debian, perhaps they are key. I have read up on systemd and the FS unit file looks good to my untrained eye. I did not use the sysvinit files that are also in that FS debian directory.
I successfully used systemd to start, stop, and enable a few other system services with success so there must be a tweak to the FS unit file that I am missing. I can start FS manually and it runs normally.
A Google search revealed a number of complaints that systemd would emit an error message with its “enable” command, yet it would successfully enable the service; this was with a few different services on Debian and Ubuntu, so it seems there might still be some weirdness with systemd on Debian.
Has anybody gotten systemd to start FS reliably?
Has anybody figured out how to make systemd detect FreeSWITCH running so that it doesn’t restart it repeatedly?
Once I figure out how to tame systemd I will document my findings in Confluence as these are the last steps that allow you to get FS up and running quickly.
Thanks.
---
Bote
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <javascript:_e(%7B%7D,'cvml','consulting@freeswitch.org');> http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <javascript:_e(%7B%7D,'cvml','FreeSWITCH-users@lists.freeswitch.org');> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
--
Best regards,
Volodymyr
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <javascript:_e(%7B%7D,'cvml','consulting@freeswitch.org');> http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <javascript:_e(%7B%7D,'cvml','FreeSWITCH-users@lists.freeswitch.org');> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <javascript:_e(%7B%7D,'cvml','consulting@freeswitch.org');> http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <javascript:_e(%7B%7D,'cvml','FreeSWITCH-users@lists.freeswitch.org');> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
The Confluence page provides instructions only for those who are building from source, so it’s a manual process already. The unit file described on that page uses the /usr/local/freeswitch locations that you end up with when you build from source using the build scripts on that page. The deb package is a separate animal and lives in a different place so I didn’t see the need to document it, although we could be nice and provide a unit file for that once the dust settles on Stan’s ticket. I’m hoping to have enough time to mess with the different parameters in the unit file to figure out which one was causing it to bork on me, but for now I’m just happy the damned thing works. systemd really looks like a much better way to manage system services. Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael Jerris Sent: Monday, 17 August, 2015 19:21 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS We probably should modify these files to be configure generated and installed so that we don't have to have different versions stashed in the different packages On Monday, August 17, 2015, Bote Man <bote_radio@botecomm.com> wrote: Hot off the press, here is the section of the 1.6 installation page dealing with systemd. Let me know if it needs improvement. https://freeswitch.org/confluence/display/FREESWITCH/FreeSWITCH+1.6+Video#Fr... I’m afraid to change the title of that page now that it has been out there so long with links to it, so I just created a Debian 8 page that links to it. Bote From: freeswitch-users-bounces@lists.freeswitch.org <javascript:_e(%7B%7D,'cvml','freeswitch-users-bounces@lists.freeswitch.org');> [mailto:freeswitch-users-bounces@lists.freeswitch.org <javascript:_e(%7B%7D,'cvml','freeswitch-users-bounces@lists.freeswitch.org');> ] On Behalf Of Komar, Jason Sent: Monday, 17 August, 2015 14:51 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS I couldn't get FreeSWITCH compiled from source to work under systemd on Debian Jessie without having the pid file under /usr/local/freeswitch Here are the contents of my freeswitch.service file that let me get it working if it helps you. [Unit] Description=freeswitch ;After=syslog.target network.target local-fs.target After=syslog.target network-online.target local-fs.target [Service] ; service Type=forking PIDFile=/usr/local/freeswitch/run/freeswitch.pid PermissionsStartOnly=true ExecStartPre=/bin/mkdir -p /usr/local/freeswitch/run ExecStartPre=/bin/chown freeswitch:daemon /usr/local/freeswitch/run ExecStart=/usr/local/freeswitch/bin/freeswitch -ncwait -nonat TimeoutSec=45s Restart=always ; exec WorkingDirectory=/usr/local/freeswitch/run User=freeswitch Group=daemon LimitCORE=infinity LimitNOFILE=100000 LimitNPROC=60000 ;LimitSTACK=240 LimitRTPRIO=infinity LimitRTTIME=7000000 IOSchedulingClass=realtime IOSchedulingPriority=2 CPUSchedulingPolicy=rr CPUSchedulingPriority=89 UMask=0007 [Install] WantedBy=multi-user.target ----- Jason On Mon, Aug 17, 2015 at 12:41 PM, Bote Man <bote_radio@botecomm.com <javascript:_e(%7B%7D,'cvml','bote_radio@botecomm.com');> > wrote: Yeah, I saw that ticket where you changed the WorkingDirectory from /run/freeswitch to /var/run/freeswitch and I made those changes to mine, but it’s still flunky. I’ll keep hammering away at it. Thanks. Bote From: freeswitch-users-bounces@lists.freeswitch.org <javascript:_e(%7B%7D,'cvml','freeswitch-users-bounces@lists.freeswitch.org');> [mailto:freeswitch-users-bounces@lists.freeswitch.org <javascript:_e(%7B%7D,'cvml','freeswitch-users-bounces@lists.freeswitch.org');> ] On Behalf Of Michael Jerris Sent: Monday, 17 August, 2015 14:22 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS The ones in tree are only for the packages, you would need to modify those to be the correct paths and manually install them. You can follow the patches that went in to the debian packaging for some indication of how to install them correctly. On Aug 17, 2015, at 1:13 PM, Bote Man <bote_radio@botecomm.com <javascript:_e(%7B%7D,'cvml','bote_radio@botecomm.com');> > wrote: I copied freeswitch.xml to /etc/freeswitch but I think that is only for sysvinit anyway. I compiled FS from source which runs in a different directory tree than the Debian package. The debs run under /etc/freeswitch while the compiled version runs under /usr/local/freeswitch as I have it configured. Thanks. Bote From: freeswitch-users-bounces@lists.freeswitch.org <javascript:_e(%7B%7D,'cvml','freeswitch-users-bounces@lists.freeswitch.org');> [mailto:freeswitch-users-bounces@lists.freeswitch.org <javascript:_e(%7B%7D,'cvml','freeswitch-users-bounces@lists.freeswitch.org');> ] On Behalf Of Volodymyr Fedorov Sent: Monday, 17 August, 2015 12:48 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS Hello, Do you copied sample configs to /etc/freeswitch directory. On Mon, Aug 17, 2015 at 7:36 PM, Bote Man < <javascript:_e(%7B%7D,'cvml','bote_radio@botecomm.com');> bote_radio@botecomm.com> wrote: I’m struggling to get systemd to start FreeSWITCH at boot time and also leave it running once it starts. Problem #1 – “systemd enable freeswitch” outputs the right steps, but ends with an error message. The error I get is “No such file or directory” but that is less than helpful. Problem #2 – When I start FreeSWITCH with “systemd start freeswitch” it starts alright, but systemd does not detect FS running properly so it kills it after the specified 45 seconds elapses and restarts it. I can see this in top when FS gets a new pid. Details -------- It’s a new installation of Debian 8.1 and I chose to use systemd as the init process. I compiled FreeSWITCH from source using the latest Master as of late July. The only section of the unit file that is supposed to be used by the “enable” command is the [Install] section and that simply points to the multi-user.target as expected. I do not know what to do with the 2 other sample systemd files in /usr/src/freeswitch/debian, perhaps they are key. I have read up on systemd and the FS unit file looks good to my untrained eye. I did not use the sysvinit files that are also in that FS debian directory. I successfully used systemd to start, stop, and enable a few other system services with success so there must be a tweak to the FS unit file that I am missing. I can start FS manually and it runs normally. A Google search revealed a number of complaints that systemd would emit an error message with its “enable” command, yet it would successfully enable the service; this was with a few different services on Debian and Ubuntu, so it seems there might still be some weirdness with systemd on Debian. Has anybody gotten systemd to start FS reliably? Has anybody figured out how to make systemd detect FreeSWITCH running so that it doesn’t restart it repeatedly? Once I figure out how to tame systemd I will document my findings in Confluence as these are the last steps that allow you to get FS up and running quickly. Thanks. --- Bote _________________________________________________________________________ Professional FreeSWITCH Consulting Services: <javascript:_e(%7B%7D,'cvml','consulting@freeswitch.org');> consulting@freeswitch.org <http://www.freeswitchsolutions.com/> http://www.freeswitchsolutions.com Official FreeSWITCH Sites <http://www.freeswitch.org/> http://www.freeswitch.org <http://confluence.freeswitch.org/> http://confluence.freeswitch.org <http://www.cluecon.com/> http://www.cluecon.com FreeSWITCH-users mailing list <javascript:_e(%7B%7D,'cvml','FreeSWITCH-users@lists.freeswitch.org');> FreeSWITCH-users@lists.freeswitch.org <http://lists.freeswitch.org/mailman/listinfo/freeswitch-users> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE: <http://lists.freeswitch.org/mailman/options/freeswitch-users> http://lists.freeswitch.org/mailman/options/freeswitch-users <http://www.freeswitch.org/> http://www.freeswitch.org -- Best regards, Volodymyr _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <javascript:_e(%7B%7D,'cvml','consulting@freeswitch.org');> http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <javascript:_e(%7B%7D,'cvml','FreeSWITCH-users@lists.freeswitch.org');> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org <javascript:_e(%7B%7D,'cvml','consulting@freeswitch.org');> http://www.freeswitchsolutions.com Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org <javascript:_e(%7B%7D,'cvml','FreeSWITCH-users@lists.freeswitch.org');> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Bote, At the end of that page there's one more systemd file, right after the last layout example. It shouldn't be there, right? On Wed, Aug 19, 2015 at 2:22 AM, Bote Man <bote_radio@botecomm.com> wrote:
The Confluence page provides instructions only for those who are building from source, so it’s a manual process already. The unit file described on that page uses the /usr/local/freeswitch locations that you end up with when you build from source using the build scripts on that page.
The deb package is a separate animal and lives in a different place so I didn’t see the need to document it, although we could be nice and provide a unit file for that once the dust settles on Stan’s ticket.
I’m hoping to have enough time to mess with the different parameters in the unit file to figure out which one was causing it to bork on me, but for now I’m just happy the damned thing works. systemd really looks like a much better way to manage system services.
Bote
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Michael Jerris *Sent:* Monday, 17 August, 2015 19:21
*To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] systemd won't enable for automatic start of FS
We probably should modify these files to be configure generated and installed so that we don't have to have different versions stashed in the different packages
On Monday, August 17, 2015, Bote Man <bote_radio@botecomm.com> wrote:
Hot off the press, here is the section of the 1.6 installation page dealing with systemd. Let me know if it needs improvement.
https://freeswitch.org/confluence/display/FREESWITCH/FreeSWITCH+1.6+Video#Fr...
I’m afraid to change the title of that page now that it has been out there so long with links to it, so I just created a Debian 8 page that links to it.
Bote
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Komar, Jason *Sent:* Monday, 17 August, 2015 14:51 *To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] systemd won't enable for automatic start of FS
I couldn't get FreeSWITCH compiled from source to work under systemd on Debian Jessie without having the pid file under /usr/local/freeswitch
Here are the contents of my freeswitch.service file that let me get it working if it helps you.
[Unit]
Description=freeswitch
;After=syslog.target network.target local-fs.target
After=syslog.target network-online.target local-fs.target
[Service]
; service
Type=forking
PIDFile=/usr/local/freeswitch/run/freeswitch.pid
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /usr/local/freeswitch/run
ExecStartPre=/bin/chown freeswitch:daemon /usr/local/freeswitch/run
ExecStart=/usr/local/freeswitch/bin/freeswitch -ncwait -nonat
TimeoutSec=45s
Restart=always
; exec
WorkingDirectory=/usr/local/freeswitch/run
User=freeswitch
Group=daemon
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
;LimitSTACK=240
LimitRTPRIO=infinity
LimitRTTIME=7000000
IOSchedulingClass=realtime
IOSchedulingPriority=2
CPUSchedulingPolicy=rr
CPUSchedulingPriority=89
UMask=0007
[Install]
WantedBy=multi-user.target
-----
Jason
On Mon, Aug 17, 2015 at 12:41 PM, Bote Man <bote_radio@botecomm.com> wrote:
Yeah, I saw that ticket where you changed the WorkingDirectory from /run/freeswitch to /var/run/freeswitch and I made those changes to mine, but it’s still flunky.
I’ll keep hammering away at it.
Thanks.
Bote
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Michael Jerris *Sent:* Monday, 17 August, 2015 14:22
*To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] systemd won't enable for automatic start of FS
The ones in tree are only for the packages, you would need to modify those to be the correct paths and manually install them. You can follow the patches that went in to the debian packaging for some indication of how to install them correctly.
On Aug 17, 2015, at 1:13 PM, Bote Man <bote_radio@botecomm.com> wrote:
I copied freeswitch.xml to /etc/freeswitch but I think that is only for sysvinit anyway.
I compiled FS from source which runs in a different directory tree than the Debian package. The debs run under /etc/freeswitch while the compiled version runs under /usr/local/freeswitch as I have it configured.
Thanks.
Bote
*From:* freeswitch-users-bounces@lists.freeswitch.org [ mailto:freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Volodymyr Fedorov *Sent:* Monday, 17 August, 2015 12:48 *To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] systemd won't enable for automatic start of FS
Hello,
Do you copied sample configs to /etc/freeswitch directory.
On Mon, Aug 17, 2015 at 7:36 PM, Bote Man <bote_radio@botecomm.com> wrote:
I’m struggling to get systemd to start FreeSWITCH at boot time and also leave it running once it starts.
Problem #1 – “systemd enable freeswitch” outputs the right steps, but ends with an error message. The error I get is “No such file or directory” but that is less than helpful.
Problem #2 – When I start FreeSWITCH with “systemd start freeswitch” it starts alright, but systemd does not detect FS running properly so it kills it after the specified 45 seconds elapses and restarts it. I can see this in top when FS gets a new pid.
Details
--------
It’s a new installation of Debian 8.1 and I chose to use systemd as the init process. I compiled FreeSWITCH from source using the latest Master as of late July.
The only section of the unit file that is supposed to be used by the “enable” command is the [Install] section and that simply points to the multi-user.target as expected.
I do not know what to do with the 2 other sample systemd files in /usr/src/freeswitch/debian, perhaps they are key. I have read up on systemd and the FS unit file looks good to my untrained eye. I did not use the sysvinit files that are also in that FS debian directory.
I successfully used systemd to start, stop, and enable a few other system services with success so there must be a tweak to the FS unit file that I am missing. I can start FS manually and it runs normally.
A Google search revealed a number of complaints that systemd would emit an error message with its “enable” command, yet it would successfully enable the service; this was with a few different services on Debian and Ubuntu, so it seems there might still be some weirdness with systemd on Debian.
Has anybody gotten systemd to start FS reliably?
Has anybody figured out how to make systemd detect FreeSWITCH running so that it doesn’t restart it repeatedly?
Once I figure out how to tame systemd I will document my findings in Confluence as these are the last steps that allow you to get FS up and running quickly.
Thanks.
---
Bote
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
--
Best regards,
Volodymyr
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Ítalo Rossi
Good catch! That “reliable” editor in Confluence went crazy on me and I had to abort the edit, but it must have put the pasted file down at the bottom of the page. I just corrected it. Thanks! Bote From: Ítalo Rossi Sent: Wednesday, 19 August, 2015 08:38 Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS Bote, At the end of that page there's one more systemd file, right after the last layout example. It shouldn't be there, right? On Wed, Aug 19, 2015 at 2:22 AM, Bote Man <bote_radio@botecomm.com> wrote: The Confluence page provides instructions only for those who are building from source, so it’s a manual process already. The unit file described on that page uses the /usr/local/freeswitch locations that you end up with when you build from source using the build scripts on that page. The deb package is a separate animal and lives in a different place so I didn’t see the need to document it, although we could be nice and provide a unit file for that once the dust settles on Stan’s ticket. I’m hoping to have enough time to mess with the different parameters in the unit file to figure out which one was causing it to bork on me, but for now I’m just happy the damned thing works. systemd really looks like a much better way to manage system services. Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael Jerris Sent: Monday, 17 August, 2015 19:21 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS We probably should modify these files to be configure generated and installed so that we don't have to have different versions stashed in the different packages On Monday, August 17, 2015, Bote Man <bote_radio@botecomm.com> wrote: Hot off the press, here is the section of the 1.6 installation page dealing with systemd. Let me know if it needs improvement. https://freeswitch.org/confluence/display/FREESWITCH/FreeSWITCH+1.6+Video#Fr... I’m afraid to change the title of that page now that it has been out there so long with links to it, so I just created a Debian 8 page that links to it. Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Komar, Jason Sent: Monday, 17 August, 2015 14:51 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS I couldn't get FreeSWITCH compiled from source to work under systemd on Debian Jessie without having the pid file under /usr/local/freeswitch Here are the contents of my freeswitch.service file that let me get it working if it helps you. [Unit] Description=freeswitch ;After=syslog.target network.target local-fs.target After=syslog.target network-online.target local-fs.target [Service] ; service Type=forking PIDFile=/usr/local/freeswitch/run/freeswitch.pid PermissionsStartOnly=true ExecStartPre=/bin/mkdir -p /usr/local/freeswitch/run ExecStartPre=/bin/chown freeswitch:daemon /usr/local/freeswitch/run ExecStart=/usr/local/freeswitch/bin/freeswitch -ncwait -nonat TimeoutSec=45s Restart=always ; exec WorkingDirectory=/usr/local/freeswitch/run User=freeswitch Group=daemon LimitCORE=infinity LimitNOFILE=100000 LimitNPROC=60000 ;LimitSTACK=240 LimitRTPRIO=infinity LimitRTTIME=7000000 IOSchedulingClass=realtime IOSchedulingPriority=2 CPUSchedulingPolicy=rr CPUSchedulingPriority=89 UMask=0007 [Install] WantedBy=multi-user.target ----- Jason On Mon, Aug 17, 2015 at 12:41 PM, Bote Man <bote_radio@botecomm.com> wrote: Yeah, I saw that ticket where you changed the WorkingDirectory from /run/freeswitch to /var/run/freeswitch and I made those changes to mine, but it’s still flunky. I’ll keep hammering away at it. Thanks. Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Michael Jerris Sent: Monday, 17 August, 2015 14:22 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS The ones in tree are only for the packages, you would need to modify those to be the correct paths and manually install them. You can follow the patches that went in to the debian packaging for some indication of how to install them correctly. On Aug 17, 2015, at 1:13 PM, Bote Man <bote_radio@botecomm.com> wrote: I copied freeswitch.xml to /etc/freeswitch but I think that is only for sysvinit anyway. I compiled FS from source which runs in a different directory tree than the Debian package. The debs run under /etc/freeswitch while the compiled version runs under /usr/local/freeswitch as I have it configured. Thanks. Bote From: freeswitch-users-bounces@lists.freeswitch.org [mailto:freeswitch-users-bounces@lists.freeswitch.org] On Behalf Of Volodymyr Fedorov Sent: Monday, 17 August, 2015 12:48 To: FreeSWITCH Users Help Subject: Re: [Freeswitch-users] systemd won't enable for automatic start of FS Hello, Do you copied sample configs to /etc/freeswitch directory. On Mon, Aug 17, 2015 at 7:36 PM, Bote Man <bote_radio@botecomm.com> wrote: I’m struggling to get systemd to start FreeSWITCH at boot time and also leave it running once it starts. Problem #1 – “systemd enable freeswitch” outputs the right steps, but ends with an error message. The error I get is “No such file or directory” but that is less than helpful. Problem #2 – When I start FreeSWITCH with “systemd start freeswitch” it starts alright, but systemd does not detect FS running properly so it kills it after the specified 45 seconds elapses and restarts it. I can see this in top when FS gets a new pid. Details -------- It’s a new installation of Debian 8.1 and I chose to use systemd as the init process. I compiled FreeSWITCH from source using the latest Master as of late July. The only section of the unit file that is supposed to be used by the “enable” command is the [Install] section and that simply points to the multi-user.target as expected. I do not know what to do with the 2 other sample systemd files in /usr/src/freeswitch/debian, perhaps they are key. I have read up on systemd and the FS unit file looks good to my untrained eye. I did not use the sysvinit files that are also in that FS debian directory. I successfully used systemd to start, stop, and enable a few other system services with success so there must be a tweak to the FS unit file that I am missing. I can start FS manually and it runs normally. A Google search revealed a number of complaints that systemd would emit an error message with its “enable” command, yet it would successfully enable the service; this was with a few different services on Debian and Ubuntu, so it seems there might still be some weirdness with systemd on Debian. Has anybody gotten systemd to start FS reliably? Has anybody figured out how to make systemd detect FreeSWITCH running so that it doesn’t restart it repeatedly? Once I figure out how to tame systemd I will document my findings in Confluence as these are the last steps that allow you to get FS up and running quickly. Thanks. --- Bote
Bote, There's a plugin called Redirection from ServiceRocket that could be useful when renaming pages: https://marketplace.atlassian.com/plugins/net.customware.confluence.plugin.r... On Mon, Aug 17, 2015 at 6:38 PM, Bote Man <bote_radio@botecomm.com> wrote:
Hot off the press, here is the section of the 1.6 installation page dealing with systemd. Let me know if it needs improvement.
https://freeswitch.org/confluence/display/FREESWITCH/FreeSWITCH+1.6+Video#Fr...
I’m afraid to change the title of that page now that it has been out there so long with links to it, so I just created a Debian 8 page that links to it.
Bote
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Komar, Jason *Sent:* Monday, 17 August, 2015 14:51
*To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] systemd won't enable for automatic start of FS
I couldn't get FreeSWITCH compiled from source to work under systemd on Debian Jessie without having the pid file under /usr/local/freeswitch
Here are the contents of my freeswitch.service file that let me get it working if it helps you.
[Unit]
Description=freeswitch
;After=syslog.target network.target local-fs.target
After=syslog.target network-online.target local-fs.target
[Service]
; service
Type=forking
PIDFile=/usr/local/freeswitch/run/freeswitch.pid
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /usr/local/freeswitch/run
ExecStartPre=/bin/chown freeswitch:daemon /usr/local/freeswitch/run
ExecStart=/usr/local/freeswitch/bin/freeswitch -ncwait -nonat
TimeoutSec=45s
Restart=always
; exec
WorkingDirectory=/usr/local/freeswitch/run
User=freeswitch
Group=daemon
LimitCORE=infinity
LimitNOFILE=100000
LimitNPROC=60000
;LimitSTACK=240
LimitRTPRIO=infinity
LimitRTTIME=7000000
IOSchedulingClass=realtime
IOSchedulingPriority=2
CPUSchedulingPolicy=rr
CPUSchedulingPriority=89
UMask=0007
[Install]
WantedBy=multi-user.target
-----
Jason
On Mon, Aug 17, 2015 at 12:41 PM, Bote Man <bote_radio@botecomm.com> wrote:
Yeah, I saw that ticket where you changed the WorkingDirectory from /run/freeswitch to /var/run/freeswitch and I made those changes to mine, but it’s still flunky.
I’ll keep hammering away at it.
Thanks.
Bote
*From:* freeswitch-users-bounces@lists.freeswitch.org [mailto: freeswitch-users-bounces@lists.freeswitch.org] *On Behalf Of *Michael Jerris *Sent:* Monday, 17 August, 2015 14:22
*To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] systemd won't enable for automatic start of FS
The ones in tree are only for the packages, you would need to modify those to be the correct paths and manually install them. You can follow the patches that went in to the debian packaging for some indication of how to install them correctly.
On Aug 17, 2015, at 1:13 PM, Bote Man <bote_radio@botecomm.com> wrote:
I copied freeswitch.xml to /etc/freeswitch but I think that is only for sysvinit anyway.
I compiled FS from source which runs in a different directory tree than the Debian package. The debs run under /etc/freeswitch while the compiled version runs under /usr/local/freeswitch as I have it configured.
Thanks.
Bote
*From:* freeswitch-users-bounces@lists.freeswitch.org [ mailto:freeswitch-users-bounces@lists.freeswitch.org <freeswitch-users-bounces@lists.freeswitch.org>] *On Behalf Of *Volodymyr Fedorov *Sent:* Monday, 17 August, 2015 12:48 *To:* FreeSWITCH Users Help *Subject:* Re: [Freeswitch-users] systemd won't enable for automatic start of FS
Hello,
Do you copied sample configs to /etc/freeswitch directory.
On Mon, Aug 17, 2015 at 7:36 PM, Bote Man <bote_radio@botecomm.com> wrote:
I’m struggling to get systemd to start FreeSWITCH at boot time and also leave it running once it starts.
Problem #1 – “systemd enable freeswitch” outputs the right steps, but ends with an error message. The error I get is “No such file or directory” but that is less than helpful.
Problem #2 – When I start FreeSWITCH with “systemd start freeswitch” it starts alright, but systemd does not detect FS running properly so it kills it after the specified 45 seconds elapses and restarts it. I can see this in top when FS gets a new pid.
Details
--------
It’s a new installation of Debian 8.1 and I chose to use systemd as the init process. I compiled FreeSWITCH from source using the latest Master as of late July.
The only section of the unit file that is supposed to be used by the “enable” command is the [Install] section and that simply points to the multi-user.target as expected.
I do not know what to do with the 2 other sample systemd files in /usr/src/freeswitch/debian, perhaps they are key. I have read up on systemd and the FS unit file looks good to my untrained eye. I did not use the sysvinit files that are also in that FS debian directory.
I successfully used systemd to start, stop, and enable a few other system services with success so there must be a tweak to the FS unit file that I am missing. I can start FS manually and it runs normally.
A Google search revealed a number of complaints that systemd would emit an error message with its “enable” command, yet it would successfully enable the service; this was with a few different services on Debian and Ubuntu, so it seems there might still be some weirdness with systemd on Debian.
Has anybody gotten systemd to start FS reliably?
Has anybody figured out how to make systemd detect FreeSWITCH running so that it doesn’t restart it repeatedly?
Once I figure out how to tame systemd I will document my findings in Confluence as these are the last steps that allow you to get FS up and running quickly.
Thanks.
---
Bote
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
--
Best regards,
Volodymyr
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
-- Ítalo Rossi
I have 1.4.21~35-1~jessie+1 running on Jessie - got stung by this bug on reboot of the server (errors from systemd were NOT helpful - putting them here for the next guy).
ERRORS START <<< -- Unit freeswitch.service has failed. -- -- The result is failed. Sep 03 21:58:31 malaysia systemd[1]: Unit freeswitch.service entered failed state. Sep 03 21:58:31 malaysia systemd[11999]: Failed at step CHDIR spawning /bin/mkdir: No such file or directory -- Subject: Process /bin/mkdir could not be executed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- The process /bin/mkdir could not be executed and failed. -- -- The error number returned while executing this process is 2. Sep 03 21:58:31 malaysia systemd[1]: freeswitch.service: control process exited, code=exited status=200 Sep 03 21:58:31 malaysia 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. ERRORS END <<<
/var/run is now a simlink to /var/run so there is no reason to edit the freeswitch.service file. (the /var/lock directory is also now a simlink to /run/lock - don't think we use that). Then I have to: $ cd /run $ mkdir freeswitch $ chown root.freeswitch freeswitch/ $ systemctl enable freeswitch.service Still fails over reboot - the /run/freeswitch directory should be recreated on every startup - but it isn't happening. /run is a tmpfs so it is supposed to disappear over reboots - Hope this helps -- Also - a few notes to others learning systemd here: https://wiki.xtronics.com/index.php/Systemd_Cheatsheet -------------------------------------------------------------------------------- Link to our website and get free US-48 shipping on your next order. Karl Schmidt EMail Karl@xtronics.com Transtronics, Inc. WEB https://secure.transtronics.com 3209 West 9th Street Ph (785) 841-3089 Lawrence, KS 66049 FAX (785) 841-3089 Against the assault of laughter nothing can stand. -- Mark Twain --------------------------------------------------------------------------------
this has been fixed in master branch: https://freeswitch.org/jira/browse/FS-7130 On Fri, Sep 4, 2015 at 6:17 AM, Karl Schmidt <karl@xtronics.com> wrote:
I have 1.4.21~35-1~jessie+1 running on Jessie - got stung by this bug on reboot of the server (errors from systemd were NOT helpful - putting them here for the next guy).
ERRORS START <<< -- Unit freeswitch.service has failed. -- -- The result is failed. Sep 03 21:58:31 malaysia systemd[1]: Unit freeswitch.service entered failed state. Sep 03 21:58:31 malaysia systemd[11999]: Failed at step CHDIR spawning /bin/mkdir: No such file or directory -- Subject: Process /bin/mkdir could not be executed -- Defined-By: systemd -- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel -- -- The process /bin/mkdir could not be executed and failed. -- -- The error number returned while executing this process is 2. Sep 03 21:58:31 malaysia systemd[1]: freeswitch.service: control process exited, code=exited status=200 Sep 03 21:58:31 malaysia 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. ERRORS END <<<
/var/run is now a simlink to /var/run so there is no reason to edit the freeswitch.service file. (the /var/lock directory is also now a simlink to /run/lock - don't think we use that).
Then I have to:
$ cd /run $ mkdir freeswitch $ chown root.freeswitch freeswitch/ $ systemctl enable freeswitch.service
Still fails over reboot - the /run/freeswitch directory should be recreated on every startup - but it isn't happening.
/run is a tmpfs so it is supposed to disappear over reboots -
Hope this helps -- Also - a few notes to others learning systemd here:
https://wiki.xtronics.com/index.php/Systemd_Cheatsheet
-------------------------------------------------------------------------------- Link to our website and get free US-48 shipping on your next order.
Karl Schmidt EMail Karl@xtronics.com Transtronics, Inc. WEB https://secure.transtronics.com 3209 West 9th Street Ph (785) 841-3089 Lawrence, KS 66049 FAX (785) 841-3089
Against the assault of laughter nothing can stand. -- Mark Twain --------------------------------------------------------------------------------
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (8)
-
Bote Man
-
Karl Schmidt
-
Komar, Jason
-
Larry Morley
-
Michael Jerris
-
Stanislav Sinyagin
-
Volodymyr Fedorov
-
Ítalo Rossi