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:
parent
8c94c5d442
commit
3f169145df
3 changed files with 20 additions and 20 deletions
|
@ -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
|
||||
|
|
|
@ -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 ###
|
||||
|
||||
|
|
|
@ -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=$?
|
||||
|
||||
|
|
Loading…
Reference in a new issue