Page tree
Skip to end of metadata
Go to start of metadata

Unix-style /etc/init.d/freeswitch

The various unix-based systems often start FreeSWITCH from a script that lives in /etc/init.d/freeswitch.

 Click here to expand Table of Contents

Linux

Debian/Ubuntu

You should only need to use this if you are not installing from a pre-built package.

The existing start-up scripts can be found in the `src/freeswitch/debian/` directory, however these are tied in closely with the layout of the package builder and may not be suitable for your needs.

Below is a fully functional init.d script which you can use with any standard FreeSWITCH build (assuming you haven't changed --prefix).

Adding users / fixing permissions

Add the user and group to your system, and change the required permissions for the directory; replace with your installation location as required:

Installing the script

Create the file `/etc/init.d/freeswitch` with the following code:

/etc/init.d/freeswitch

Make the script executable and make it auto start on system boot:

Run priority

You can modify the run priority in two places.

The first is using DAEMON_ARGS, using the arguments explained FreeSwitch_FAQ#Q:_How_do_I_setup_high_priority_to_my_freeswitch_daemon.3F, for example:

The second is to modify the `--nicelevel` of start-stop-daemon, for example:

Fedora

Note: Also tested on CentOS 5.5 with perfect results, just as always set chmod +x /etc/init.d/freeswitch

This script runs FreeSWITCH as root (NOT RECOMMENDED)
Use the -u USER option to switch to a different user on startup. (see SECURITY NOTE in the script)

Be sure to run:

So that the script is added to all the rc#.d directories.
/etc/init.d/freeswitch

 

OpenSUSE
OpenSUSE /etc/init.d/freeswitch

And run:

...set permissions
BusyBox Based Systems

This script was written for a CLFS embedded system, but it may be easily adapted for use on any BusyBox embedded systems by simply copy and pasting the code out of the functions

BusyBox /etc/init.d/freeswitch

BSD

FreeBSD

/etc/rc.conf
/usr/local/etc/rc.d
  • No labels