Skip to content

Commit de4b596

Browse files
chengangclijinxia
authored andcommitted
tools: acrn-crashlog: change source of config file
This patch is to change the source of config file according to the doc of telemetrics-client: There is a config file installed at ``/usr/share/defaults/telemetrics/telemetrics.conf`` To make modifications, copy that file to ``/etc/telemetrics/telemetrics.conf`` and modify the /etc version. Otherwise, the modification may be lost after ``swupd update``. Signed-off-by: CHEN Gang <gang.c.chen@intel.com> Reviewed-by: Zhang Di <di.zhang@intel.com> Reviewed-by: Jin Zhi <Zhi.jin@intel.com> Reviewed-by: Liu Xinwu <xinwu.liu@intel.com>
1 parent 03f5cbd commit de4b596

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tools/acrn-crashlog/data/acrnprobe_prepare.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
# modify the core_pattern
88
echo "|/usr/bin/usercrash_c %p %e %s" > /proc/sys/kernel/core_pattern
99

10-
conf="/usr/share/defaults/telemetrics/telemetrics.conf"
10+
default_conf="/usr/share/defaults/telemetrics/telemetrics.conf"
11+
user_conf="/etc/telemetrics/telemetrics.conf"
1112

12-
grep -q "record_server_delivery_enabled=false" $conf
13+
grep -q "record_server_delivery_enabled=false" $user_conf
1314
if [ "$?" -eq "0" ];then
1415
exit;
1516
fi
@@ -25,6 +26,9 @@ journal-probe.service
2526
bert-probe.service
2627
)
2728

29+
mkdir -p $(dirname $user_conf)
30+
cp $default_conf $user_conf
31+
2832
for ((i=0;i<${#telemd_services[*]};i++))
2933
do
3034
if [ ! -L "/etc/systemd/system/${telemd_services[$i]}" ];then
@@ -34,8 +38,8 @@ done
3438

3539
# modify the configure file
3640

37-
sed -i "s/server_delivery_enabled=true/server_delivery_enabled=false/g" $conf
38-
sed -i "s/record_retention_enabled=false/record_retention_enabled=true/g" $conf
41+
sed -i "s/server_delivery_enabled=true/server_delivery_enabled=false/g" $user_conf
42+
sed -i "s/record_retention_enabled=false/record_retention_enabled=true/g" $user_conf
3943

4044
# restart telemd
4145
sleep 3

0 commit comments

Comments
 (0)