<div dir="ltr">Ugh, looks like that message had gotten lost in spam somehow... Sorry for all the noise! <br>
</div><div dir="ltr"><br>
</div><div dir="ltr">--<br>
</div><div dir="ltr">Ryan (ライアン)<br>
</div><div dir="ltr">Yoko Shimomura, ryo (supercell/<u>EGOIST</u>), Hiroyuki Sawano >> everyone else<br>
</div><div dir="ltr"><a href="https://refi64.com/">https://refi64.com/</a></div><div class="wps_quotion">On Colin Guthrie <gmane@colin.guthr.ie>, Mar 27, 2018 4:11 AM wrote:<br type='attribution'><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p/><p dir="ltr">Perhaps you missed Lennart's reply?
<br>
<br>
I have to say it doesn't sound like the right place to fix things.
<br>
Really the daemon needs to be fixed.
<br>
<br>
What you suggest sounds quite racy generally (at least the
<br>
WantsFileBefore= bit anyway) and really is just to paper over a badly
<br>
written daemon that also breaks (at least in theory) on SysV. I'd say
<br>
effort would be better spent making the daemon work.
<br>
<br>
Failing that (i.e. if the daemon code is not available), I'd just write
<br>
a very simple wrapper around your binary that implements the appropriate
<br>
waiting around the execution and keep the hack localised to this daemon
<br>
(or just stick with your ExecPreStart/PostStart and your "wait-for-file"
<br>
script solution). Probably not a general purpose approach that should be
<br>
encouraged :-)
<br>
<br>
Col
<br>
<br>
Ryan Gonzalez wrote on 24/03/18 01:35:
<br>
> I know everyone here is super busy, but I just wanted to bump this a sec
<br>
> before letting it die to make sure it didn't just get lost or something.
<br>
> (If someone agrees that it should be a feature, I'd happily try to work
<br>
> on it.)
<br>
>
<br>
> On Tue, Mar 20, 2018 at 4:08 PM, Ryan Gonzalez <<a href="mailto:rymg19@gmail.com">rymg19@gmail.com</a>> wrote:
<br>
>> Hello!! Recently, I was trying to help out someone on IRC move some
<br>
>> sysvinit scripts over to systemd units, and there was one interesting
<br>
>> issue that came up. Many older daemons will create sockets at some
<br>
>> unspecified point in their startup sequence, with no indication of
<br>
>> when this occurs. In this case, it was a bit after the pid file, so
<br>
>> systemd started running units that required this socket ready before
<br>
>> it was actually ready. Using socket activation here would be great,
<br>
>> but again, this is an older daemon, and AFAIK socket activation
<br>
>> *always* requires a deamon to read the socket path over stdin. Here's
<br>
>> my idea: what if there were WantsFileBefore= and WantsFileAfter=
<br>
>> options, that could be used like this: [Service] Type=oneshot
<br>
>> ExecStart=/usr/bin/my-service
<br>
>> WantsFileBefore=this-file-should-be-existant-before-running-service
<br>
>> WantsFileAfter=systemd-should-wait-until-this-file-exists-before-continuing
<br>
>> In short, WantsFileBefore=file would be roughly equivalent to
<br>
>> ExecPreStart=wait-for-file file, and WantsFileAfter=file would be
<br>
>> roughly equivalent to ExecPostStart=wait-for-file file. Of course, now
<br>
>> there would be no need to useless shell commands. Thoughts?
<br>
>> --
<br>
>> Ryan (ライアン) Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki
<br>
>> Sawano >> everyone else <a href="https://refi64.com">https://refi64.com</a>/
<br>
>
<br>
> --
<br>
> Ryan (ライアン) Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano
<br>
>>> everyone else <a href="https://refi64.com">https://refi64.com</a>/
<br>
>
<br>
>
<br>
>
<br>
> _______________________________________________
<br>
> systemd-devel mailing list
<br>
> <a href="mailto:systemd-devel@lists.freedesktop.org">systemd-devel@lists.freedesktop.org</a>
<br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel">https://lists.freedesktop.org/mailman/listinfo/systemd-devel</a>
<br>
>
<br>
<br>
<br>
--
<br>
<br>
Colin Guthrie
<br>
gmane(at)<a href="http://colin.guthr.ie">colin.guthr.ie</a>
<br>
<a href="http://colin.guthr.ie">http://colin.guthr.ie</a>/
<br>
<br>
Day Job:
<br>
Tribalogic Limited <a href="http://www.tribalogic.net">http://www.tribalogic.net</a>/
<br>
Open Source:
<br>
Mageia Contributor <a href="http://www.mageia.org">http://www.mageia.org</a>/
<br>
PulseAudio Hacker <a href="http://www.pulseaudio.org">http://www.pulseaudio.org</a>/
<br>
Trac Hacker <a href="http://trac.edgewall.org/">http://trac.edgewall.org/</a>
<br>
</p>
</blockquote></div>