Skip to content
Snippets Groups Projects
Commit a63f8b3b authored by Seblu's avatar Seblu
Browse files

checkservices: Only list executable deleted files

parent 722fb6e1
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,7 @@ services=($(systemctl -t service --full|grep \.service|grep running|sed -rn 's/^
for svc in "${services[@]}"; do
pid=$(systemctl show "$svc"|sed -nr 's/^MainPID=(.*)/\1/p')
deleted=$(grep '(deleted)' "/proc/$pid/maps")
deleted=$(grep '(deleted)' "/proc/$pid/maps"|sed -nr 's|^\S+ ..x. \S+ \S+ \S+ \s+||p'|sort|uniq)
if [[ -n $deleted ]]; then
echo systemctl restart "$svc"
[[ $systemd_cmd ]] && systemctl "$systemd_cmd" "$svc"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment