alphallc / freeswitch

Freeswitch Gentoo overlay
Other
9 stars 3 forks source link

Errors is startup script and ebuild #12

Closed ekzobrain closed 8 years ago

ekzobrain commented 8 years ago

Hi.

  1. Startup script init.d/freeswitch has the following probles: Flag -nc is not passed to FS, you sould use "--" before that flag so it is not interpreted as start-stop-script flag -n which sets process name Flags --make-pid and --background should not be used because FS creates pid file and forks itself. Moreover it creates a pid file on different location, so it is impossible to correctly stop FS with your script. We fixed all that and here is our version:
#!/sbin/runscript
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

depend() {
        need net
    after mysql postgresql
}

create_dir() {
    DIRPID=/var/run/freeswitch
    [[ ! -d $DIRPID ]] && mkdir $DIRPID 
    chown ${FREESWITCH_USER:-freeswitch}.${FREESWITCH_USER:-freeswitch}  $DIRPID 

}

start() {
    create_dir
        ebegin "Starting FreeSWITCH"
        start-stop-daemon --user ${FREESWITCH_USER:-freeswitch} --group ${FREESWITCH_GROUP:-freeswitch} --pidfile "${FREESWITCH_PIDFILE:-/var/run/freeswitch/freeswitch.pid}" --start /usr/bin/freeswitch -- ${FREESWITCH_OPTS:--ncwait} 
        eend $?
}

stop() {
        ebegin "Stopping FreeSWITCH"
        start-stop-daemon --pidfile "${FREESWITCH_PIDFILE:-/var/run/freeswitch/freeswitch.pid}" --stop "/usr/bin/freeswitch"
        eend $?
}

Also I think it is useless to allow to set location of pid file via parameter because there is not way to change its location via FS params, it is hardcoded to /var/run/freeswitch/freswitch.pid. We did not change it, but you could do if you with. We had to add directory creation because FS does not create it by itself. We also changed flag -nc to -ncwait to see FS statrup output to be able to see possible errors.

  1. ESL php flag is missing, thus PHP ELS support exists in FS sources
  2. When disabling mod_enum flag - this module is not removed correctly from modules.conf, so FS fails to build.
  3. It is not possible to build FS with flags mod_bv (broadvoice lib not available in portage at all) and mod_ilbc (tried to install both media-libs/libilbc and dev-libs/ilbc-rfc3951) - build process cannot locate libilbc
  4. It would be greate to update FS to 1.6.5, it has a few important fixes :)
seifertm commented 8 years ago

Thanks a lot for the input! I will gladly integrate the changes to the initd file and work on the other issues.

Regarding the issue with mod_bv: I only remember seeing the source code for broadvoice as a modified, bundled lib in the freeswitch repository, but I cannot check, since the freeswitch pages are currently down... Do you know, if there is any official repository where one could get the source code?

ekzobrain commented 8 years ago

FS repo is already up. Is this what you are looking for?: https://freeswitch.org/stash/projects/FS/repos/freeswitch/browse/libs/broadvoice I tried to find something about broadvoice elsewhere, but did not succeed.

seifertm commented 8 years ago

I finally revisited this issue. Better late than never :)

The changes for the init script have already been integrated with the exception of the directory creation. I'd rather leave it to the ebuild to create the appropriate folder.

  1. Will be moved to a separate issue.
  2. I cannot reproduce this with FS 1.6.8. Maybe this is gone in the new version?
  3. I was hoping to get hand on the unmodified broadvoice library. Since the sources are not readily available (you have to ask Broadcom about them) and since FreeSWITCH probably only works with the modified library anyway, the bundled broadvoice is probably the only solution.
  4. Bumped FS to version 1.6.8.

Thanks again for your help!

seifertm commented 8 years ago

@soulhunter1987 I finally managed to add the creation of /var/run/freeswitch/ to the initd file. However, I used checkpath (see man openrc-run) to do so.