<div><div dir="auto">you need to active your service unit when your files show up by monitoring the path using an additional path unit: <a href="https://www.freedesktop.org/software/systemd/man/systemd.path.html">https://www.freedesktop.org/software/systemd/man/systemd.path.html</a></div><br><div class="gmail_quote"><div>On Thu, Oct 5, 2017 at 12:59 AM sdrb <<a href="mailto:sdrb@onet.eu">sdrb@onet.eu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'd like to ask how to achieve following functionality in systemd:<br>
<br>
I'd like to start alsa-restore.service only once just after one of the<br>
specified files appears. Those file matches: /dev/snd/control*.<br>
<br>
For now I have something like this:<br>
<br>
[Unit]<br>
Description=Save/Restore Sound Card State<br>
ConditionPathExistsGlob=/dev/snd/control*<br>
After=sysinit.target<br>
<br>
[Service]<br>
Type=oneshot<br>
RemainAfterExit=true<br>
ExecStart=-/sbin/alsactl restore -f /etc/asound.state<br>
<br>
[Install]<br>
WantedBy=multi-user.target<br>
<br>
<br>
but during the start when there is no any of /dev/snd/control* files -<br>
the condition is not meet and the service is not going up.<br>
Those files appears later.<br>
<br>
So that what I'd like to achieve is to wait for appearing of those files<br>
and then starting alsa-restore service.<br>
<br>
Is it possible to do in systemd? If yes - how to do this?<br>
<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><br>
</blockquote></div></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><b>Camilo Aguilar</b></div><div>Software Engineer</div><div><a href="http://github.com/c4milo" target="_blank">http://github.com/c4milo</a></div><br><br></div></div>