diff --git a/package/gluon-core/files/lib/gluon/functions/sysctl.sh b/package/gluon-core/files/lib/gluon/functions/sysctl.sh new file mode 100644 index 00000000..df1ea217 --- /dev/null +++ b/package/gluon-core/files/lib/gluon/functions/sysctl.sh @@ -0,0 +1,4 @@ +sysctl_set() { + sed -i "/^${1//./\.}=/d" /etc/sysctl.conf + echo "${1}=$2" >> /etc/sysctl.conf +} diff --git a/package/gluon-core/files/lib/gluon/upgrade/core/invariant/012-reboot-on-oom b/package/gluon-core/files/lib/gluon/upgrade/core/invariant/012-reboot-on-oom new file mode 100755 index 00000000..a457a9c3 --- /dev/null +++ b/package/gluon-core/files/lib/gluon/upgrade/core/invariant/012-reboot-on-oom @@ -0,0 +1,5 @@ +#!/bin/sh + +. /lib/gluon/functions/sysctl.sh + +sysctl_set vm.panic_on_oom 1