-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
attempt to implement workaround for sudomesh/bugs#24 . fyi @bennlich
- Loading branch information
jhpoelen
committed
Apr 1, 2018
1 parent
e012bbc
commit 07e82a8
Showing
3 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[Unit] | ||
Description=babeld-monitor | ||
After=network.target auditd.service | ||
|
||
[Timer] | ||
OnCalendar=*:0/10 | ||
|
||
[Service] | ||
Type=simple | ||
ExecStart=/opt/babeld-monitor/babeld-monitor.sh | ||
|
||
[Install] | ||
WantedBy=timers.target | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
# This is a workaround for a suspected (babeld?) memory leak | ||
# https://github.com/sudomesh/bugs/issues/24 | ||
|
||
set -e | ||
|
||
date_last_error=$(sudo journalctl -u babeld -o short-iso | grep "Cannot allocate memory" | tail -n1 | awk '{print $1}' | xargs date -d ) | ||
|
||
date_last_started=$(sudo journalctl -u babeld -o short-iso | grep "Started babeld" | tail -n1 | awk '{print $1}' | xargs date -d ) | ||
|
||
if [[$date_last_error > $date_last_restart]]; then | ||
echo "found [Cannot allocate memory] error since last babeld restart" | ||
echo "babeld restarting..." | ||
service babeld restart | ||
echo "babeld restarted." | ||
# add tunnel interfaces to babeld | ||
echo "add tunnel interfaces to babeld..." | ||
ip addr | tr ' ' '\n' | grep -E "l2tp[0-9]+$" | sort | uniq | xargs -L 1 babeld -a | ||
echo "add tunnel interfaces to babeld done." | ||
else | ||
echo "found no [Cannot allocate memory] error since last babeld restart" | ||
fi | ||
|
||
|
07e82a8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍