Score:1

systemd-tmpfiles race condition

br flag

I have a config file /etc/tmpfiles.d/test.conf:

z /dir/*         660 -    -    -
z /dir/subdir   2770 -    -    -
z /dir/subdir/*  660 -    -    -
Z /dir             - root test -

When I run systemd-tmpfiles --prefix=/dir --create /etc/tmpfiles.d/test.conf ; ll /dir, access rights of /dir/subdir are randomly

  • sometimes drwxrws--- (from the /dir/* rule) and
  • sometimes drw-rw---- (from the /dir/subdir rule).

How do I make it deterministic?

The point is that directory /dir contains a lot of files and one subdirectory and I want to set rw access rights to the files and rwx access rights to the subdirectory.

Centos 7

man tmpfiles.d

Score:0
br flag

Literal (un)match of /dir/subdir in /etc/tmpfiles.d/test.conf:

z /dir/[!s]*       660 -    -    -
z /dir/s[!u]*      660 -    -    -
z /dir/su[!b]*     660 -    -    -
z /dir/sub[!d]*    660 -    -    -
z /dir/subd[!i]*   660 -    -    -
z /dir/subdi[!r]*  660 -    -    -
z /dir/subdir?*    660 -    -    -
z /dir/subdir     2770 -    -    -
z /dir/subdir/*    660 -    -    -
Z /dir               - root test -

Suffix (un)match of /dir/*.test.sh in /etc/tmpfiles.d/test.conf:

z /dir/*[!t].sh     750 - - -
z /dir/*[!s]t.sh    750 - - -
z /dir/*[!e]st.sh   750 - - -
z /dir/*[!t]est.sh  750 - - -
z /dir/*[!.]test.sh 750 - - -
z /dir/*.test.sh    500 - - -

I don't like this solution. Someone please come up with anything better.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.