From: Sebastian Kemper Date: Fri, 22 Dec 2017 21:37:19 +0000 (+0100) Subject: freeswitch-stable: init script update X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3f169145df14a1c77af5c46501c53e1e617a3eff;p=feed%2Ftelephony.git freeswitch-stable: init script update - Use "-nc -nf" always. When started by procd freeswitch detects the console to be orphaned and disables it. So disable the interactive console but force freeswitch to not fork into background. - Improve readability of command parameters. - Minor changes. Signed-off-by: Sebastian Kemper --- diff --git a/net/freeswitch-stable/Makefile b/net/freeswitch-stable/Makefile index ce7622a..e094a1f 100644 --- a/net/freeswitch-stable/Makefile +++ b/net/freeswitch-stable/Makefile @@ -376,10 +376,6 @@ $(call Package/$(PKG_NAME)/install/lib,$(1),lib$(PRG_NAME)) $(1)$(FS_STABLE_SYSCONF_DIR)/init.d/$(PRG_NAME) $(INSTALL_CONF) ./files/$(PRG_NAME).default \ $(1)$(FS_STABLE_SYSCONF_DIR)/default/$(PRG_NAME) -ifeq ($(CONFIG_FS_STABLE_WITH_LIBEDIT),) - $(SED) '/^ #procd_append_param command -nc -nf$$$$/s/#//' \ - $(1)$(FS_STABLE_SYSCONF_DIR)/init.d/$(PRG_NAME) -endif endef define Package/$(PKG_NAME)/postinst diff --git a/net/freeswitch-stable/files/freeswitch.default b/net/freeswitch-stable/files/freeswitch.default index 32effa2..3d6e911 100644 --- a/net/freeswitch-stable/files/freeswitch.default +++ b/net/freeswitch-stable/files/freeswitch.default @@ -16,8 +16,8 @@ #FS_DIR_STORAGE="/tmp/freeswitch/storage" #FS_DIR_TEMP="/tmp/freeswitch/temp" -# The following is appended to the command line when starting FreeSWITCH: -OPTIONS="-np -nonat" +# The following is added to the command line when starting FreeSWITCH: +OPTIONS="-nonat -np" ### Hotplug configuration ### diff --git a/net/freeswitch-stable/files/freeswitch.init b/net/freeswitch-stable/files/freeswitch.init index d55f810..6b349b1 100644 --- a/net/freeswitch-stable/files/freeswitch.init +++ b/net/freeswitch-stable/files/freeswitch.init @@ -11,6 +11,7 @@ FS=freeswitch DEFAULT=/etc/default/$FS LOGGER="/usr/bin/logger -p user.err -s -t $FS" OPTIONS= +PROG=/usr/bin/$FS TIMEOUT=30 [ -f $DEFAULT ] && . $DEFAULT @@ -56,20 +57,23 @@ start_service() { procd_open_instance # starting with full path seems cleaner judging by 'ps' output - procd_set_param command /usr/bin/$FS + procd_set_param command $PROG # need to specify all or none of -conf, -log, and -db - procd_append_param command -cache "$fs_dir_cache" -conf \ - "$fs_dir_etc" -db "$fs_dir_db" -log "$fs_dir_log" -recordings \ - "$fs_dir_recordings" -run "$fs_dir_run" -storage "$fs_dir_storage" \ - -temp "$fs_dir_temp" - procd_append_param command -c - # -nc -nf: workaround for interop issue (which causes high load) - #procd_append_param command -nc -nf - procd_append_param command $OPTIONS - procd_set_param user "$fs_user" - # forward stdout of the command to logd - #procd_set_param stdout 1 - # same for stderr + procd_append_param command \ + -cache "$fs_dir_cache" \ + -conf "$fs_dir_etc" \ + -db "$fs_dir_db" \ + -g "$fs_group" \ + -log "$fs_dir_log" \ + -recordings "$fs_dir_recordings" \ + -run "$fs_dir_run" \ + -storage "$fs_dir_storage" \ + -temp "$fs_dir_temp" \ + -u "$fs_user" \ + $OPTIONS \ + -nc \ + -nf + # forward stderr to logd procd_set_param stderr 1 procd_close_instance } @@ -107,7 +111,7 @@ stop_service() { } timeout=$TIMEOUT - kill $mypid + kill $mypid 2>/dev/null pgrep $FS | grep -w $mypid &>/dev/null retval=$?