Skip to content

Commit

Permalink
feature(deb-package):compile_and_deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
ARTHUR CHENU (ext) committed Dec 7, 2024
1 parent 331ba72 commit 57a33ef
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions alumet/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#!/bin/bash

# Color codes
ERROR="\e[31mERROR:\e[0m"
WARNING="\e[33mWARNING:\e[0m"

BIN="/usr/lib/alumet/alumet-local-agent"

##
Expand All @@ -12,19 +8,14 @@ BIN="/usr/lib/alumet/alumet-local-agent"
check_file(){
local file="$1"
if ! [ -f "$file" ]; then
echo -e "$ERROR Abort installation, '$file' not exists."
echo -e "\e[31mERROR:\e[0m : Abort installation, '$file' not exists."
exit 1
fi
}

check_file "$BIN"

sudo setcap "cap_sys_nice+ep cap_perfmon=ep" "$BIN" || {
echo -e "$ERROR Modification of '$BIN' file failed $NONE";
exit 1;
}

echo -e "$WARNING If some functionalities not working, enter the following command"
setcap "cap_sys_nice+ep cap_perfmon=ep" "$BIN" || exit
echo -e "$\e[33mWARNING:\e[0m : If some functionalities not working, enter the following command"
echo -e "'sudo sysctl -w kernel.perf_event_paranoid=0'"

exit 0

0 comments on commit 57a33ef

Please sign in to comment.