<div id="geary-body" dir="auto"><div>I know everyone here is super busy, but I just wanted to bump this a sec before letting it die to make sure it didn't just get lost or something. (If someone agrees that it should be a feature, I'd happily try to work on it.)</div></div><div id="geary-quote" dir="auto"><br>On Tue, Mar 20, 2018 at 4:08 PM, Ryan Gonzalez <rymg19@gmail.com> wrote:<br><blockquote type="cite"><div class="plaintext" style="white-space: pre-wrap;">Hello!!
Recently, I was trying to help out someone on IRC move some sysvinit scripts over to systemd units, and there was one interesting issue that came up. Many older daemons will create sockets at some unspecified point in their startup sequence, with no indication of when this occurs. In this case, it was a bit after the pid file, so systemd started running units that required this socket ready before it was actually ready.
Using socket activation here would be great, but again, this is an older daemon, and AFAIK socket activation *always* requires a deamon to read the socket path over stdin.
Here's my idea: what if there were WantsFileBefore= and WantsFileAfter= options, that could be used like this:
[Service]
Type=oneshot
ExecStart=/usr/bin/my-service
WantsFileBefore=this-file-should-be-existant-before-running-service
WantsFileAfter=systemd-should-wait-until-this-file-exists-before-continuing
In short, WantsFileBefore=file would be roughly equivalent to ExecPreStart=wait-for-file file, and WantsFileAfter=file would be roughly equivalent to ExecPostStart=wait-for-file file. Of course, now there would be no need to useless shell commands.
Thoughts?
<div>--
</div>Ryan (ライアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
<a href="https://refi64.com/">https://refi64.com/</a></div></blockquote><span style="white-space: pre-wrap;"><div><span style="white-space: pre-wrap;"><br></span></div>--</span><br><span style="white-space: pre-wrap;">Ryan (ライアン)
Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone else
https://refi64.com/</span><span style="white-space: pre-wrap;"><br><br></span></div>