[Unit] Description=Fix Valkey socket group ownership and permissions BindsTo=valkey.service After=valkey.service [Service] Type=oneshot # Wait for socket to exist (max 10 seconds) ExecStart=/bin/sh -c 'i=0; while [ ! -S {{ valkey_unix_socket_path }} ] && [ $i -lt 100 ]; do sleep 0.1; i=$((i+1)); done' ExecStart=/bin/chgrp {{ valkey_client_group }} {{ valkey_unix_socket_path }} ExecStart=/bin/chmod 770 {{ valkey_unix_socket_path }} RemainAfterExit=yes [Install] WantedBy=multi-user.target