-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathx-install.sh
executable file
·40 lines (30 loc) · 1.1 KB
/
x-install.sh
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
#!/bin/sh
#set -x #trace
set +e
#manual so lib installation + services cleanup and restart
[ ! -d "./src" ] && echo "must be run from repo. root directory" && exit
echo "+compile"
make
[ $? -ne 0 ] && exit
echo "+strip so lib"
strip ./src/.libs/libfty_alert_engine.so.0.0.0
cd /usr/lib/x86_64-linux-gnu/
if [ ! -f "./libfty_alert_engine.so.0.0.0.original" ]; then
echo "+save so lib original"
sudo cp ./libfty_alert_engine.so.0.0.0 ./libfty_alert_engine.so.0.0.0.original
fi
cd - > /dev/null 2>&1
echo "+install so lib"
sudo cp ./src/.libs/libfty_alert_engine.so.0.0.0 /usr/lib/x86_64-linux-gnu/
echo "+stop services"
sudo /bin/systemctl stop fty-alert-engine fty-alert-list
echo "+cleanup remaining rules and state files"
sudo rm /var/lib/fty/fty-alert-engine/*.rule
sudo rm /var/lib/fty/fty-alert-engine/state
sudo rm /var/lib/fty/fty-alert-list/state_file
echo "+restart services"
sudo /bin/systemctl start fty-alert-engine fty-alert-list
#echo "+trace service (grep)"
#sudo /bin/journalctl -fu fty-alert-engine | grep ruleXphaseIsApplicable
echo "+trace service"
sudo /bin/journalctl -fu fty-alert-engine