Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sonic-cfggen]: Use unix socket when reading from DB only if we are u…
…sing sudo. (#7002) Closes issue #6982. The issue was root caused as we were using the unix_socket for reading from DB as a default mechanism (#5250). The redis unix socket is created as follows. admin@str--acs-1:~$ ls -lrt /var/run/redis/redis.sock srwxrw---- 1 root redis 0 Mar 6 01:57 /var/run/redis/redis.sock So it used to work fine for the user "root" or if user is part of redis group ( admin was made part of redis group by default ) Check if the user is with sudo permissions then use the redis unix socket, else fallback to tcp socket.
- Loading branch information