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

About

This page lists steps to prepare the SmartOS hypervisor for the installation of FreeSWITCH.

 Click to expand Table of Contents

Initialization

Get SmartOS up and running. If using desktop virtualization, be forewarned that the KVM features of SmartOS will not be available (they're not needed in this case). This is rather like installing ESXi under virtualbox, it's a wonder it works at all.

An automated script for doing this on virtualbox under some kind of *nix is available from:
http://www.perkin.org.uk/posts/automated-virtualbox-smartos-installs.html

Instructions for installing in other ways (including under vmware) can be found here:
http://wiki.smartos.org/display/DOC/Getting+Started+with+SmartOS

The key items here are: Boot from the live CD (image) or USB key, then follow the instructions on screen to do the initial setup of any attached hard drive(s). If you only give it one hard drive, this is as simple as just retyping the disk name back in when it displays it and asks you which drives to use.

The default root password changes with each release and will be in the text file linked on this page:
https://us-east.manta.joyent.com/Joyent_Dev/public/SmartOS/latest.html

Import VM Image

After the install is done, login to the console and import the 64 bit basic VM root image (assume $# is the root prompt from now on). "imgadm avail" will show you the latest available image for base-64, and you copy the image UUID from its output.

$# imgadm avail | grep base-64
1f32508c-e6e9-11e6-bc05-8fea9e979940 base-64-lts 16.4.1 smartos  zone-dataset  2017-01-30

$# imgadm import 1f32508c-e6e9-11e6-bc05-8fea9e979940

 

 

Solaris Privileges

The following privileges are used by FreeSWITCH daemon, and some of them are not available by default in a SmartOS zone:

Name or aliasIDDescriptionAvailable by default in a zone
basic Basic set of privileges, as output by ppriv -l basic commandyes
proc_clock_highresPRIV_PROC_CLOCK_HIGHRESAccess to the high-resolution clock. FreeSWITCH will refuse to start without this privilege.no, needs to be added by host admin
sys_resourcePRIV_SYS_RESOURCEAllow a process to exceed the resource limitsyes
file_dac_searchPRIV_FILE_DAC_SEARCHAllow a process to read directories belonging to other uidyes
proc_priocntlPRIV_PROC_PRIOCNTLAllow a process to control its scheduler. If granted, this allows FreeSWITCH to set the real-time priority scheduler for itself. Otherwise, it tries to use proc_prioup privilege and sets a higher-than-normal priority.no, needs to be added by host admin
proc_prioupPRIV_PROC_PRIOUPAllow a process to elevate its priority. This privilege is used if -rp flag is specified and proc_priocntl is not availableyes

 

Zone Definition

Create a "Zone definition" JSON file in a folder under /opt (remember that /root is mounted on ramdisk and will be flushed after reboot). The zone should receive the proc_clock_highres privilege in order to get use of high-resolution timer. FreeSWITCH would crash immediately at start if this privilege is not available within the zone. This means that hosting at Joyent is problematic.

/opt/vm-def.json

Create the  Zone

Create your virtual zone within smartos:

$# vmadm create -f /opt/vm-def.json

UUID

Find the UUID assigned to your new VM:

$# vmadm list

Login

Using the UUID from the above list ( refered to as <UUID> ):

$# zlogin <UUID>

Build FreeSWITCH

We are now inside the VM and we can execute all the commands to set up for building freeswitch:

Build FS

Manifest

Contributed by Kim Culhan 2017.01.12

I've hacked together this manifest which appears to work well on smartos:

joyent_20161110T013148Z


In your FreeSWITCH smartos zone you could copy this to /opt/local/lib/svc/manifest/freeswitch.xml

This is based on the FreeSWITCH executable installed at /opt/local/bin/freeswitch and running as user 'freeswitch'

Validate with:

  svccfg validate freeswitch.xml

Import the manifest with:

  svccfg import freeswitch.xml

Enable freeswitch:

  svcadm enable freeswitch

Check that it is online:

  svcs -a|grep freeswitch

Caveats

  1. FreeSWITCH will refuse to start if the process does not have the  proc_clock_highres privilege. This means, the zone manifest should be configured to receive this privilege. If you add it to an existing zone, do "vmadm update" and then reboot the zone. Also proc_priocntl privilege is highly recommended.
  2. ZRTP is not yet supported: libs/libzrtp fails to compile.
  3. Fixed, please test: mod_eventsocket cannot bind to IPv6 loopback, and "::" in "listen-ip" does not work. You need to specify "127.0.0.1" in it.

References

FS-6375 - Solaris 11.1 build support and possibly SmartOS Closed

FS-6561 - configure.ac changes to support compilation on SmartOS Closed

FS-7967 - Compile error under SmartOS Resolved

FS-8195 - Compatibility with Solaris 11 process privileges Resolved

 

 




2 Comments

  1. I have added your contribution under the Manifest header. I also added you to the confluence-editors group so feel free to maintain this as needed.

    The editing guidelines can be found (currently) under the Community link in the Table of Contents pane.

    Thanks! Happy New Year!

  2. Freeswitch remains unable to do outbound TCP as per  FS-7991 - Cannot connect to gateway using TCP Closed