<div dir="ltr"><div>I'm not very clear on what you are trying to do, so if my understanding is correct:</div><div><br></div><div>daemon.service : the service you are trying to delay</div><div>trigger_file : the file created by dhclient </div><div><br></div><div>moreover you want daemon.service to be part of the startup transaction (I'm not certain why) and not triggered on the file creation as a .path unit would do. </div><div><br></div><div>I would create an intermediate service wait_for_file.service that would be Type=oneshot and would simply trigger some sort of shell script waiting for trigger_file to appear and the terminate.</div><div><br></div><div>daemon.service would have Wants=wait_for_file and After=wait_for_file and you should be good.</div><div><br></div><div><br></div><div>a .path would be a slightly different way of doing it that would not be limited to the startup phase, but again i'm not completely sure what you are trying to do</div><div><br></div><div>HTH</div><div>Jeremy</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le lun. 19 août 2019 à 14:49, Colin Hogben <<a href="mailto:systemd@pythontech.co.uk">systemd@pythontech.co.uk</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
(Hoping this is an appropriate place to ask this question...)<br>
<br>
During system start-up, I want to defer starting a unit (a service)<br>
until a particular file is written (amongst other dependencies). In<br>
my case I am writing the service's configuration file within a<br>
dhclient hook script.<br>
<br>
Any guidance on achieving this with systemd would be much appreciated.<br>
<br>
I don't think a .path unit is the appropriate tool for the job, since<br>
AIUI that is intended to start a new systemd transaction rather than<br>
for scheduling within an existing transaction. I tried having my<br>
service depend on (via Requires/After) the foo.unit related to<br>
foo.path, but then systemd starts foo.unit straight away regardless of<br>
foo.path. If I have After=foo.unit and Requires=foo.path, then it seems <br>
like foo.unit is not "pulled in", and the After has no effect. But <br>
maybe I missed something.<br>
<br>
The .path causes its related unit to start, whereas I think I want to<br>
provoke a transition in a unit from startING to startED - am I right?<br>
<br>
I thought of using the 'inotify' executable within a unit upon which<br>
my service could depend. Unfortunately, CentOS (& Redhat) in their<br>
wisdom decided not to package inotify-tools.<br>
<br>
Thanks for any help,<br>
-- <br>
Colin Hogben<br>
_______________________________________________<br>
systemd-devel mailing list<br>
<a href="mailto:systemd-devel@lists.freedesktop.org" target="_blank">systemd-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/systemd-devel</a></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><table border="0" style="border-collapse:collapse;border-spacing:0px;color:rgb(51,51,51);font-family:Raleway,regular;font-size:14px;padding:20px"><tbody><tr><td style="padding:0px 30px 0px 0px;font-size:13px;color:rgb(255,128,84);text-align:center"><a href="http://www.smile.eu/" style="background-color:transparent;color:rgb(221,72,20)" target="_blank"><img src="http://ftp.smile.fr/client/Communication/signature/img/Logo-new.png" alt="SMILE" style="border: 0px; vertical-align: middle; max-width: 100%; height: auto;"> </a><br><br><p style="margin:0px 0px 10px">20 rue des Jardins<br>92600 Asnières-sur-Seine</p></td><td style="padding:0px 0px 0px 20px;border-left:1px solid rgb(59,127,254);font-size:13px;color:rgb(255,128,84)"><div style="font-size:14px"><b>Jérémy ROSEN</b></div><div style="color:rgb(59,127,254)">Architecte technique<br></div><br><div style="color:rgb(59,127,254)"><span style="white-space:nowrap"><img src="http://ftp.smile.fr/client/Communication/signature/img/mail.png" alt="email" width="12" height="10" style="border: 0px; vertical-align: middle; margin-right: 5px;"> <a href="mailto:jeremy.rosen@smile.fr" style="background-color:transparent;color:rgb(59,127,254)" target="_blank">jeremy.rosen@smile.fr</a> </span><br><span style="white-space:nowrap"><img src="http://ftp.smile.fr/client/Communication/signature/img/phone.png" alt="phone" width="10" height="10" style="border: 0px; vertical-align: middle; margin-right: 5px;"></span> +33 6 88 25 87 42 <br><span style="white-space:nowrap"><img src="http://ftp.smile.fr/client/Communication/signature/img/web.png" alt="url" width="12" height="12" style="border: 0px; vertical-align: middle; margin-right: 5px;"> <a href="http://www.smile.eu/" style="background-color:transparent;color:rgb(59,127,254)" target="_blank">http://www.smile.eu</a></span></div><br><div><span><a href="https://twitter.com/GroupeSmile" style="background-color:transparent;color:rgb(221,72,20);margin-right:5px" target="_blank"><img src="http://ftp.smile.fr/client/Communication/signature/img/rs-twitter.png" alt="Twitter" style="border: 0px; vertical-align: middle; max-width: 100%; height: auto;"></a></span> <span><a href="https://www.facebook.com/smileopensource" style="background-color:transparent;color:rgb(221,72,20);margin-right:5px" target="_blank"><img src="http://ftp.smile.fr/client/Communication/signature/img/rs-facebook.png" alt="Facebook" style="border: 0px; vertical-align: middle; max-width: 100%; height: auto;"></a></span> <span><a href="https://www.linkedin.com/company/smile" style="background-color:transparent;color:rgb(221,72,20);margin-right:5px" target="_blank"><img src="http://ftp.smile.fr/client/Communication/signature/img/rs-linkedin.png" alt="LinkedIn" style="border: 0px; vertical-align: middle; max-width: 100%; height: auto;"></a></span> <span><a href="https://github.com/Smile-SA" style="background-color:transparent;color:rgb(221,72,20);margin-right:5px" target="_blank"><img src="http://ftp.smile.fr/client/Communication/signature/img/rs-github.png" alt="Github" style="border: 0px; vertical-align: middle; max-width: 100%; height: auto;"></a></span></div></td></tr></tbody></table><br style="color:rgb(51,51,51);font-family:Raleway,regular;font-size:14px"><div style="color:rgb(51,51,51);font-family:Raleway,regular;font-size:14px"><a href="https://www.smile.eu/fr/publications/livres-blancs/yocto?utm_source=signature&utm_medium=email&utm_campaign=signature" style="background-color:transparent;color:rgb(221,72,20)" target="_blank"><img src="https://signature.smile.eu/assets/img/bandeaux_signature_mail_yocto.gif.gif" alt="Découvrez l’univers Smile, rendez-vous sur smile.eu" border="0" style="border: 0px; vertical-align: middle;"></a></div></div></div></div></div>