How to control ownership and permission of systemd Unix Domain Sockets?

Solution Verified - Updated -

Issue

  • How to make persistent changes to systemd socket owner and group owner?
  • Why does ownership of socket in /var/run change after service restart?
  • Manual changes using chown to /var/run/docker.sock are not persistent. Expected ownership is root:abcgroup
[root@hostname ~]# ls -lrt /var/run/docker.sock
srw-rw---- 1 root docker 0 May 10 01:23 /var/run/docker.sock

Environment

  • Red Hat Enterprise Linux 7 and above
  • systemd

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content