Skip to content

Commit

Permalink
redis: fix update bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nachoparker committed Nov 12, 2017
1 parent 5151542 commit c2143b9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ EOF
EOF

REDIS_MEM=3gb
sed -i "s|# unixsocket.* |unixsocket /var/run/redis/redis.sock|" $REDIS_CONF
sed -i "s|# unixsocketperm.* |unixsocketperm 770|" $REDIS_CONF
sed -i "s|# unixsocket .*|unixsocket /var/run/redis/redis.sock|" $REDIS_CONF
sed -i "s|# unixsocketperm .*|unixsocketperm 770|" $REDIS_CONF
sed -i "s|port.*|port 0|" $REDIS_CONF
echo "maxmemory ${REDIS_MEM}" >> $REDIS_CONF
echo 'vm.overcommit_memory = 1' >> /etc/sysctl.conf
Expand All @@ -279,6 +279,13 @@ EOF
}
sed -i 's|^logfile.*|logfile /var/log/redis/redis-server.log|' $REDIS_CONF

# fix redis update bug
grep -q sock700 $REDIS_CONF && {
sed -i '/unixsocket/d' $REDIS_CONF
echo "unixsocket /var/run/redis/redis.sock" >> $REDIS_CONF
echo "unixsocketperm 770" >> $REDIS_CONF
systemctl restart redis-server
}
grep -q unixsocketperm $REDIS_CONF || echo unixsocketperm 770 >> $REDIS_CONF

# fix unattended
Expand Down

0 comments on commit c2143b9

Please sign in to comment.