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 <sebastian_ml@gmx.net>
This commit is contained in:
Sebastian Kemper 2017-12-22 22:37:19 +01:00
parent 8c94c5d442
commit 3f169145df
3 changed files with 20 additions and 20 deletions

View file

@ -376,10 +376,6 @@ $(call Package/$(PKG_NAME)/install/lib,$(1),lib$(PRG_NAME))
$(1)$(FS_STABLE_SYSCONF_DIR)/init.d/$(PRG_NAME) $(1)$(FS_STABLE_SYSCONF_DIR)/init.d/$(PRG_NAME)
$(INSTALL_CONF) ./files/$(PRG_NAME).default \ $(INSTALL_CONF) ./files/$(PRG_NAME).default \
$(1)$(FS_STABLE_SYSCONF_DIR)/default/$(PRG_NAME) $(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 endef
define Package/$(PKG_NAME)/postinst define Package/$(PKG_NAME)/postinst

View file

@ -16,8 +16,8 @@
#FS_DIR_STORAGE="/tmp/freeswitch/storage" #FS_DIR_STORAGE="/tmp/freeswitch/storage"
#FS_DIR_TEMP="/tmp/freeswitch/temp" #FS_DIR_TEMP="/tmp/freeswitch/temp"
# The following is appended to the command line when starting FreeSWITCH: # The following is added to the command line when starting FreeSWITCH:
OPTIONS="-np -nonat" OPTIONS="-nonat -np"
### Hotplug configuration ### ### Hotplug configuration ###

View file

@ -11,6 +11,7 @@ FS=freeswitch
DEFAULT=/etc/default/$FS DEFAULT=/etc/default/$FS
LOGGER="/usr/bin/logger -p user.err -s -t $FS" LOGGER="/usr/bin/logger -p user.err -s -t $FS"
OPTIONS= OPTIONS=
PROG=/usr/bin/$FS
TIMEOUT=30 TIMEOUT=30
[ -f $DEFAULT ] && . $DEFAULT [ -f $DEFAULT ] && . $DEFAULT
@ -56,20 +57,23 @@ start_service() {
procd_open_instance procd_open_instance
# starting with full path seems cleaner judging by 'ps' output # 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 # need to specify all or none of -conf, -log, and -db
procd_append_param command -cache "$fs_dir_cache" -conf \ procd_append_param command \
"$fs_dir_etc" -db "$fs_dir_db" -log "$fs_dir_log" -recordings \ -cache "$fs_dir_cache" \
"$fs_dir_recordings" -run "$fs_dir_run" -storage "$fs_dir_storage" \ -conf "$fs_dir_etc" \
-temp "$fs_dir_temp" -db "$fs_dir_db" \
procd_append_param command -c -g "$fs_group" \
# -nc -nf: workaround for interop issue (which causes high load) -log "$fs_dir_log" \
#procd_append_param command -nc -nf -recordings "$fs_dir_recordings" \
procd_append_param command $OPTIONS -run "$fs_dir_run" \
procd_set_param user "$fs_user" -storage "$fs_dir_storage" \
# forward stdout of the command to logd -temp "$fs_dir_temp" \
#procd_set_param stdout 1 -u "$fs_user" \
# same for stderr $OPTIONS \
-nc \
-nf
# forward stderr to logd
procd_set_param stderr 1 procd_set_param stderr 1
procd_close_instance procd_close_instance
} }
@ -107,7 +111,7 @@ stop_service() {
} }
timeout=$TIMEOUT timeout=$TIMEOUT
kill $mypid kill $mypid 2>/dev/null
pgrep $FS | grep -w $mypid &>/dev/null pgrep $FS | grep -w $mypid &>/dev/null
retval=$? retval=$?