summaryrefslogtreecommitdiffstats
path: root/stacks/lwip_stack/release/stop_nstack.sh
blob: 48d1af727965ee7ed801ae2c5542e942ca8d729b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash


script_path=$(cd "$(dirname "$0")"; pwd)

. ${script_path}/script/nstack_var.sh
. ${script_path}/script/nstack_fun.sh

config_name=${script_path}/script/nstack_var.sh
if [ ! -e $config_name ]; then
    log $LINENO "$config_name not exit, plz pay attention and add back!,or it has resourcce leak."
fi

cur_user=`whoami`

########################################################
# init_log_file:nstack.log and dpdk.log
init_log_file
log $LINENO "#######################stop nstack#######################"

#############################################
# step1 stop nstack master
retry=3
stop_nStackProcess nStackMaster $retry

#############################################
# step2 stop nstack
stop_nStackProcess nStackMain $retry


#############################################
# step3 stop all apps that usg the nstack hugepage
if [ ${cur_user} = "root" ]; then
    stop_nStackApps
else
    log $LINENO "not root, app not stopped"
fi

#############################################
# step4 delete the huge page files created by nstack
recover_hugepage

#############################################
# step5 recover the nic configuration
recover_network

#############################################
# step6 delete pid file
delete_pid_file

exit 0