From 36839dfb75b3fc4a07c44c80b2d2a888018e6c19 Mon Sep 17 00:00:00 2001 From: Alfonso Gamboa Date: Sat, 28 May 2022 00:53:46 -0700 Subject: [PATCH] disable core dumps --- SD_ROOT/wz_mini/etc/init.d/wz_user.sh | 31 +++++++++++++++------------ 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/SD_ROOT/wz_mini/etc/init.d/wz_user.sh b/SD_ROOT/wz_mini/etc/init.d/wz_user.sh index 7d20749..3a3bcb9 100755 --- a/SD_ROOT/wz_mini/etc/init.d/wz_user.sh +++ b/SD_ROOT/wz_mini/etc/init.d/wz_user.sh @@ -390,17 +390,17 @@ if [[ "$RTSP_HI_RES_ENABLED" == "true" ]]; then if [[ "$RTSP_HI_RES_ENC_PARAMETER" != "" ]]; then if [[ "$V2" == "true" ]]; then - watch -n10 -t "/system/bin/impdbg --enc_rc_s 0:0:4:$RTSP_LOW_RES_ENC_PARAMETER" > /dev/null 2>&1 & + watch -n30 -t "/system/bin/impdbg --enc_rc_s 0:0:4:$RTSP_LOW_RES_ENC_PARAMETER" > /dev/null 2>&1 & else - watch -n10 -t "/system/bin/impdbg --enc_rc_s 0:44:4:$RTSP_HI_RES_ENC_PARAMETER" > /dev/null 2>&1 & + watch -n30 -t "/system/bin/impdbg --enc_rc_s 0:44:4:$RTSP_HI_RES_ENC_PARAMETER" > /dev/null 2>&1 & fi fi if [[ "$RTSP_HI_RES_MAX_BITRATE" != "" ]]; then if [[ "$V2" == "true" ]]; then - watch -n10 -t "/system/bin/impdbg --enc_rc_s 0:28:4:$RTSP_LOW_RES_MAX_BITRATE" > /dev/null 2>&1 & + watch -n30 -t "/system/bin/impdbg --enc_rc_s 0:28:4:$RTSP_LOW_RES_MAX_BITRATE" > /dev/null 2>&1 & else - watch -n10 -t "/system/bin/impdbg --enc_rc_s 0:48:4:$RTSP_HI_RES_MAX_BITRATE" > /dev/null 2>&1 & + watch -n30 -t "/system/bin/impdbg --enc_rc_s 0:48:4:$RTSP_HI_RES_MAX_BITRATE" > /dev/null 2>&1 & fi fi @@ -408,15 +408,15 @@ if [[ "$RTSP_HI_RES_ENABLED" == "true" ]]; then if [[ "$V2" == "true" ]]; then echo "not supported on v2" else - watch -n10 -t "/system/bin/impdbg --enc_rc_s 0:52:4:$RTSP_HI_RES_TARGET_BITRATE" > /dev/null 2>&1 & + watch -n30 -t "/system/bin/impdbg --enc_rc_s 0:52:4:$RTSP_HI_RES_TARGET_BITRATE" > /dev/null 2>&1 & fi fi if [[ "$RTSP_HI_RES_FPS" != "" ]]; then if [[ "$V2" == "true" ]]; then - watch -n10 -t "/system/bin/impdbg --enc_rc_s 0:8:4:$RTSP_HI_RES_FPS" > /dev/null 2>&1 & + watch -n30 -t "/system/bin/impdbg --enc_rc_s 0:8:4:$RTSP_HI_RES_FPS" > /dev/null 2>&1 & else - watch -n10 -t "/system/bin/impdbg --enc_rc_s 0:80:4:$RTSP_HI_RES_FPS" > /dev/null 2>&1 & + watch -n30 -t "/system/bin/impdbg --enc_rc_s 0:80:4:$RTSP_HI_RES_FPS" > /dev/null 2>&1 & fi fi @@ -459,17 +459,17 @@ if [[ "$RTSP_LOW_RES_ENABLED" == "true" ]]; then if [[ "$RTSP_LOW_RES_ENC_PARAMETER" != "" ]]; then if [[ "$V2" == "true" ]]; then - watch -n10 -t "/system/bin/impdbg --enc_rc_s 1:0:4:$RTSP_LOW_RES_ENC_PARAMETER" > /dev/null 2>&1 & + watch -n30 -t "/system/bin/impdbg --enc_rc_s 1:0:4:$RTSP_LOW_RES_ENC_PARAMETER" > /dev/null 2>&1 & else - watch -n10 -t "/system/bin/impdbg --enc_rc_s 1:44:4:$RTSP_LOW_RES_ENC_PARAMETER" > /dev/null 2>&1 & + watch -n30 -t "/system/bin/impdbg --enc_rc_s 1:44:4:$RTSP_LOW_RES_ENC_PARAMETER" > /dev/null 2>&1 & fi fi if [[ "$RTSP_LOW_RES_MAX_BITRATE" != "" ]]; then if [[ "$V2" == "true" ]]; then - watch -n10 -t "/system/bin/impdbg --enc_rc_s 1:28:4:$RTSP_LOW_RES_MAX_BITRATE" > /dev/null 2>&1 & + watch -n30 -t "/system/bin/impdbg --enc_rc_s 1:28:4:$RTSP_LOW_RES_MAX_BITRATE" > /dev/null 2>&1 & else - watch -n10 -t "/system/bin/impdbg --enc_rc_s 1:48:4:$RTSP_LOW_RES_MAX_BITRATE" > /dev/null 2>&1 & + watch -n30 -t "/system/bin/impdbg --enc_rc_s 1:48:4:$RTSP_LOW_RES_MAX_BITRATE" > /dev/null 2>&1 & fi fi @@ -477,15 +477,15 @@ if [[ "$RTSP_LOW_RES_ENABLED" == "true" ]]; then if [[ "$V2" == "true" ]]; then echo "not supported on v2" else - watch -n10 -t "/system/bin/impdbg --enc_rc_s 1:52:4:$RTSP_LOW_RES_TARGET_BITRATE" > /dev/null 2>&1 & + watch -n30 -t "/system/bin/impdbg --enc_rc_s 1:52:4:$RTSP_LOW_RES_TARGET_BITRATE" > /dev/null 2>&1 & fi fi if [[ "$RTSP_LOW_RES_FPS" != "" ]]; then if [[ "$V2" == "true" ]]; then - watch -n10 -t "/system/bin/impdbg --enc_rc_s 1:8:4:$RTSP_LOW_RES_FPS" > /dev/null 2>&1 & + watch -n30 -t "/system/bin/impdbg --enc_rc_s 1:8:4:$RTSP_LOW_RES_FPS" > /dev/null 2>&1 & else - watch -n10 -t "/system/bin/impdbg --enc_rc_s 1:80:4:$RTSP_LOW_RES_FPS" > /dev/null 2>&1 & + watch -n30 -t "/system/bin/impdbg --enc_rc_s 1:80:4:$RTSP_LOW_RES_FPS" > /dev/null 2>&1 & fi fi @@ -500,8 +500,11 @@ fi hostname_set touch /opt/wz_mini/tmp/.run_mmc_firstrun +pkill -f dumpload #Kill dumpload so it won't waste cpu or ram gathering cores when something crashes +sysctl -w kernel.core_pattern='|/bin/false' sync;echo 3 > /proc/sys/vm/drop_caches + if [ -f "$CUSTOM_SCRIPT_PATH" ]; then echo "starting custom script" $CUSTOM_SCRIPT_PATH &