Installing FreeSwitch under Devuan

FreeSwitch is a PBX system similar to Asterisk, and can be installed using the package manager under CentOS, RHEL, Fedora, Debian and Ubuntu.

However, version 1.10 has a dependency on systemd, which if you are running Devuan, you won't have (and won't want) on your machine.

It seems that the dependency is pointless, because:

  1. the only link with systemd is the startup scripts, nothing to do with libraries etc.
  2. the mechanism to create the sysvinit scripts is still in the 1.10 source code

However, a dependency means that without systemd, you cannot install FreeSwitch.

There are ways round this (not including "install systemd") :)

The simplest method uses the equivs utility, which allows you to build a "package" which doesn't actually do anything, but:

At first I thought "I'll make a package called systemd and install that".

However this introduced its own problems - on a Devuan machine, several things object to finding systemd installed (no real surprise there, of course), so they conflict with it if you try to install it, or a dummy package of that name.

Reading the error message (often a good idea, often overlooked) generated by aptitude install freeswitch-meta-all proved useful. It was:

freeswitch-systemd : Depends: systemd which is a virtual package and is not provided by any available package

So, building a dummy package called freeswitch-systemd and installing that was a much simpler way around the problem.

If you examine the (real) package freeswitch-systemd, you find that it "provides freeswitch-init", so building this as a dummy package and installing it is an alternative way of dealing with the problem.

  1. aptitude install equivs
  2. equivs-control freeswitch-init
  3. edit the text file which has just been generated for you named freeswitch-init to contain the following uncommented lines (you can leave the other comments in if you wish):
    Section: misc
    Priority: optional
    Standards-Version: 3.9.2
    
    Package: freeswitch-init
    Description: something to stop systemd being a dependency
  4. equivs-build freeswitch-init
  5. dpkg -i freeswitch-init_1.0_all.deb
  6. aptitude install freeswitch-meta-all (as per the standard Debian FreeSwitch documentation)

Success :)

To get the sysvinit script for the newly-installed application, go to http://files.freeswitch.org/freeswitch-releases/ and download your preferred archive of the version you just installed and unpack it. Then search for the file freeswitch-sysvinit.freeswitch.init and copy it to the correct name and location, and make it executable:

# wget http://files.freeswitch.org/freeswitch-releases/freeswitch-1.10.6.-release.tar.bz2
# tar -xf freeswitch-1.10.6.-release.tar.bz2
# find freeswitch-1.10.6.-release -name freeswitch-sysvinit.freeswitch.init
# cp -a freeswitch-1.10.6.-release/debian/freeswitch-sysvinit.freeswitch.init /etc/init.d/freeswitch
# chmod +x /etc/init.d/freeswitch

To enable FreeSwitch to auto-start at boot time:

# /etc/init.d/freeswitch start
21602 Backgrounding.
FreeSWITCH[21601] Waiting for background process pid:21602 to be ready.....
FreeSWITCH[21601] Waiting for background process pid:21602 to be ready.....
FreeSWITCH[21601] System Ready pid:21602

# /etc/init.d/freeswitch status
[ ok ] freeswitch is running.

# fs_cli
Type /help <enter> to see a list of commands

+OK log level  [7]
freeswitch@devuan> status
UP 0 years, 0 days, 0 hours, 4 minutes, 54 seconds, 216 milliseconds, 852 microseconds
FreeSWITCH (Version 1.10.6 -release-18-1ff9d0a60e 64bit) is ready
0 session(s) since startup
0 session(s) - peak 0, last 5min 0 
0 session(s) per Sec out of max 30, peak 0, last 5min 0 
1000 session(s) max
min idle cpu 0.00/99.60
Current Stack Size/Max 240K/8192K

More success, and proving how much (not at all) FreeSwitch actually needs systemd :)

PS: When you get confused about how to get out of this thing you just started, and find that exit and quit both tell you "Command not found!", try /exit, /quit or /bye.

Meh.


Go up
Return to main index.