Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd.path: DirectoryNotEmpty doesn't trigger for files starting with . #32751

Open
antifuchs opened this issue May 10, 2024 · 2 comments
Open
Labels
documentation pid1 RFE 🎁 Request for Enhancement, i.e. a feature request

Comments

@antifuchs
Copy link

systemd version the issue has been seen with

255

Used distribution

NixOS 23.11

Linux kernel version used

6.6.30

CPU architectures issue was seen on

x86_64

Component

systemd

Expected behaviour you didn't see

I have a systemd.path defined with a clause DirectoryNotEmpty=/data/transfers/ready - when a regular file with any name at all gets created in the directory, a transfer should be triggered. I was expecting files matching any glob pattern, visible or hidden, to trigger the trigger-transfer.service to be started.

Unexpected behaviour you saw

I do see the trigger-transfer.service being started for regular files starting with any character that isn't the . - but "hidden" / "dot" files like .foo inside the directory do not start the service.

Steps to reproduce the problem

  1. Make a unit like the following:
# /etc/systemd/system/trigger-transfer.path
[Path]
DirectoryNotEmpty=/data/transfers/ready
Unit=trigger-transfer.service

[Install]
WantedBy=multi-user.target
  1. Create a oneshot unit named trigger-transfer.service (not shown)
  2. Run touch /data/transfers/ready/foo - the service gets started
  3. Run touch /data/transfers/ready/.foo - the service does not get started.

Additional program output to the terminal or log subsystem illustrating the issue

No response

@antifuchs antifuchs added the bug 🐛 Programming errors, that need preferential fixing label May 10, 2024
@github-actions github-actions bot added the pid1 label May 10, 2024
@YHNdnzj
Copy link
Member

YHNdnzj commented May 10, 2024

This is intended behavior, and it's consistent with ConditionDirectoryNotEmpty=: #23220.

But such behavior is not documented, which is something we should fix.

@YHNdnzj YHNdnzj added RFE 🎁 Request for Enhancement, i.e. a feature request documentation and removed bug 🐛 Programming errors, that need preferential fixing labels May 10, 2024
@antifuchs
Copy link
Author

Ah, that makes sense. Is there a way to opt into hidden files triggering a start? (Documented or undocumented...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation pid1 RFE 🎁 Request for Enhancement, i.e. a feature request
Development

No branches or pull requests

2 participants