admin管理员组文章数量:1389379
Following the example described here, I created the .path and the .service thus:
[Unit]
Description=Watch for Foo in %i
[Install]
WantedBy=multi-user.target
[Path]
PathChanged=/tmp/%i.dbstatus
and the Foo.service
is simply:
[Unit]
Description=Process status-changes in %i
[Install]
WantedBy=multi-user.target
[Service]
Type=simple
ExecStart=/bin/bash -c "exec >> %h/mxapps/%i/logs/Foo.log 2>&1; date; env"
As in the example, whenever the contents of the /tmp/Bar.dbstatus
changes, the service is triggered -- hurrah! The removal of the file triggers the service too -- very good.
However, when I try to create the name as a ("broken") symlink: ln -s Meow /tmp/Bar.dbstatus
, there is no reaction...
I'd like to use the symlinks, because -- unlike a sequence of open(), write(), and close() -- the symlink() is atomic (and so is the readlink()).
Is there anything I can tweak for systemd to react? Using PathModified
instead of PathChanged
didn't help...
(Systemd on RHEL7 is quite old -- version 219.)
本文标签: rhel7Systemd pathunit for a symlinkStack Overflow
版权声明:本文标题:rhel7 - Systemd path-unit for a symlink - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744633056a2616656.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论