Skip to content

Commit c68144f

Browse files
committed
dietpi-software: Redis: solve startup warning about missing memory overcomit
1 parent 9c4cd88 commit c68144f

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

.update/patches

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,6 +2179,14 @@ Patch_9_13()
21792179
# Remove Google AIY and Mycroft AI
21802180
grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[169\]=' /boot/dietpi/.installed && G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[169\]=/d' /boot/dietpi/.installed
21812181
grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[176\]=' /boot/dietpi/.installed && G_EXEC sed --follow-symlinks -i '/^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[176\]=/d' /boot/dietpi/.installed
2182+
2183+
# Redis
2184+
if grep -q '^[[:blank:]]*aSOFTWARE_INSTALL_STATE\[91\]=2' /boot/dietpi/.installed
2185+
then
2186+
G_DIETPI-NOTIFY 2 'Enabling memory overcomit for Redis server'
2187+
G_EXEC eval 'echo '\''vm.overcommit_memory=1'\'' > /etc/sysctl.d/98-dietpi-redis.conf'
2188+
G_EXEC sysctl -p /etc/sysctl.d/98-dietpi-redis.conf
2189+
fi
21822190
fi
21832191

21842192
# RPi firmware migration: Do after all other patches

CHANGELOG.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Bug fixes:
1919
- DietPi-Software | RPi.GPIO: Resolved a regression where the installation failed on Bullseye systems as the python3-rpi-lgpio compatibility package exists since Bookworm only.
2020
- DietPi-Software | fish: Resolved a syntax error on uninstall, and assured that all users who use fish as login shell are altered to use bash instead. Many thanks to @echtfrank for reporting these issues: https://github.com/MichaIng/DietPi/issues/7500
2121
- DietPi-Software | Home Assistant: Resolved an issue where latest HA could not be installed/updated due to a raised Python requirement on v3.13.2. Many thanks to @whyisthisbroken and @Yougoshatenshi for reporting this issue: https://github.com/MichaIng/DietPi/issues/7525
22+
- DietPi-Software | Redis: Solved a startup warning that memory overcommit should be enabled. This is applied for fresh Redis installs as well as via DietPi update for existing instances.
2223

2324
As always, many smaller code performance and stability improvements, visual and spelling fixes have been done, too much to list all of them here. Check out all code changes of this release on GitHub: https://github.com/MichaIng/DietPi/pull/7540
2425

dietpi/dietpi-software

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2578,7 +2578,7 @@ _EOF_
25782578
{
25792579
G_DIETPI-NOTIFY 2 'Enabling IP forwarding to allow access across network interfaces'
25802580
echo -e 'net.ipv4.ip_forward=1\nnet.ipv6.conf.default.accept_ra=2\nnet.ipv6.conf.all.accept_ra=2\nnet.ipv6.conf.default.forwarding=1\nnet.ipv6.conf.all.forwarding=1' > "/etc/sysctl.d/dietpi-$1.conf"
2581-
sysctl net.ipv4.ip_forward=1 net.ipv6.conf.default.accept_ra=2 net.ipv6.conf.all.accept_ra=2 net.ipv6.conf.default.forwarding=1 net.ipv6.conf.all.forwarding=1
2581+
sysctl -p "/etc/sysctl.d/dietpi-$1.conf"
25822582
}
25832583

25842584
To_Install()
@@ -3624,6 +3624,10 @@ _EOF_
36243624
# Force service to start before cron
36253625
G_EXEC mkdir -p /etc/systemd/system/redis-server.service.d
36263626
G_EXEC eval 'echo -e '\''[Unit]\nBefore=cron.service'\'' > /etc/systemd/system/redis-server.service.d/dietpi.conf'
3627+
3628+
# Enable memory overcomit: https://github.com/jemalloc/jemalloc/issues/1328
3629+
G_EXEC eval 'echo '\''vm.overcommit_memory=1'\'' > /etc/sysctl.d/98-dietpi-redis.conf'
3630+
G_EXEC sysctl -p /etc/sysctl.d/98-dietpi-redis.conf
36273631
fi
36283632

36293633
if To_Install 89 # PHP
@@ -4105,8 +4109,8 @@ _EOF_
41054109
echo 'alias ipfs='\''sudo -u ipfs IPFS_PATH=/mnt/dietpi_userdata/ipfs ipfs'\' > /etc/bashrc.d/dietpi-ipfs.sh
41064110

41074111
# Raise packet receive buffer: https://github.com/lucas-clemente/quic-go/wiki/UDP-Receive-Buffer-Size
4108-
G_EXEC eval "echo 'net.core.rmem_max=2500000' > /etc/sysctl.d/dietpi-ipfs.conf"
4109-
G_EXEC sysctl -w net.core.rmem_max=2500000
4112+
G_EXEC eval 'echo '\''net.core.rmem_max=2500000'\'' > /etc/sysctl.d/dietpi-ipfs.conf'
4113+
G_EXEC sysctl -p /etc/sysctl.d/dietpi-ipfs.conf
41104114
fi
41114115

41124116
if To_Install 16 # microblog.pub
@@ -8865,7 +8869,8 @@ NoNewPrivileges=true
88658869
WantedBy=multi-user.target
88668870
_EOF_
88678871
# Increase fs watcher limit: https://docs.syncthing.net/users/faq.html#how-do-i-increase-the-inotify-limit-to-get-my-filesystem-watcher-to-work
8868-
G_EXEC eval "echo 'fs.inotify.max_user_watches=204800' > /etc/sysctl.d/dietpi-syncthing.conf"
8872+
G_EXEC eval 'echo '\''fs.inotify.max_user_watches=204800'\'' > /etc/sysctl.d/dietpi-syncthing.conf'
8873+
G_EXEC sysctl -p /etc/sysctl.d/dietpi-syncthing.conf
88698874
fi
88708875

88718876
if To_Install 113 # Chromium
@@ -12336,6 +12341,7 @@ _EOF_
1233612341
then
1233712342
Remove_Service redis-server
1233812343
G_AGP redis-server redis-tools 'php*-redis'
12344+
G_EXEC rm -f /etc/sysctl.d/98-dietpi-redis.conf
1233912345
fi
1234012346

1234112347
if To_Uninstall 34 # PHP Composer

0 commit comments

Comments
 (0)