Skip to content

Commit

Permalink
Check /etc/sysctld.conf exists before trying to edit it in postinst
Browse files Browse the repository at this point in the history
During server install, the /etc/sysctld.conf file won't have been
created by ansible at the time the kernel is being installed.
  • Loading branch information
legoktm authored Nov 19, 2024
1 parent 2f5a407 commit 230db7d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions debian/securedrop-grsec/DEBIAN/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ start_paxctld() {
cleanup_sysctld() {
# Remove settings previously set by ansible that are now set via
# our sysctl.d/30-securedrop.conf file
sed -i '/^vm\.heap_stack_gap/d' /etc/sysctld.conf
sed -i '/^net\.ipv4\./d' /etc/sysctld.conf
if [[ -f /etc/sysctld.conf ]]; then
sed -i '/^vm\.heap_stack_gap/d' /etc/sysctld.conf
sed -i '/^net\.ipv4\./d' /etc/sysctld.conf
fi
}

case "$1" in
Expand Down

0 comments on commit 230db7d

Please sign in to comment.