]> www.infradead.org Git - users/hch/xfsprogs.git/commit
xfs_scrub: don't set WorkingDirectory= in systemd job
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 14 Apr 2020 16:56:20 +0000 (12:56 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Tue, 14 Apr 2020 16:56:20 +0000 (12:56 -0400)
commit49bf5d8df1106ad1c85d02ffc3d6f5a0335c539b
tree2d575954cc8c5af16524e2e0bcb03f4afbe58b2a
parent52e6dd8037a1ad74bdb50e966ad615a6d7b6cd34
xfs_scrub: don't set WorkingDirectory= in systemd job

Somewhere between systemd 237 and 245, they changed the order in which a
job has its uid/gid set; capabilities applied; and working directory
set.  Whereas before they did it in an order such that you could set the
working directory to a path inaccessible to 'nobody' (either because
they did it before changing the uid or after adding capabilities), now
they don't and users instead get a service failure:

xfs_scrub@-boot.service: Changing to the requested working directory failed: Permission denied
xfs_scrub@-boot.service: Failed at step CHDIR spawning /usr/sbin/xfs_scrub: Permission denied
xfs_scrub@-boot.service: Main process exited, code=exited, status=200/CHDIR

Regardless, xfs_scrub works just fine with PWD set to /, so remove that
directive.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
scrub/xfs_scrub@.service.in