pgcluu icon indicating copy to clipboard operation
pgcluu copied to clipboard

Don't change directory permissions on each service startup

Open df7cb opened this issue 4 months ago • 0 comments

In https://bugs.debian.org/1110829 it was reported that the stock pgcluu .service files update the directory permissions on each startup, overwriting user customizations:

[Service]
PermissionsStartOnly=true
User=postgres
Environment=STATDIR=/var/lib/pgcluu/data
Environment=REPORTDIR=/var/lib/pgcluu/report
ExecStartPre=-/bin/mkdir -p $REPORTDIR
ExecStartPre=-/bin/chown postgres:www-data $REPORTDIR
ExecStartPre=-/bin/chmod u=rwX,g=rsX,o= $REPORTDIR
ExecStart=/usr/local/bin/pgcluu -o $REPORTDIR $STATDIR

For the Debian package, we now use a "tmpfiles" snippet instead:

# STATDIR
D /var/lib/pgcluu/data 02750 postgres www-data -
# REPORTDIR
D /var/lib/pgcluu/report 02750 postgres www-data -

Perhaps this change could also be adopted upstream in pgcluu.

https://salsa.debian.org/postgresql/pgcluu/-/commit/f21d19f25b5e3bbb50110b69bdc929664c56e543

df7cb avatar Aug 11 '25 11:08 df7cb