Re: systemd: How to wait for a device before starting a service

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 6, 2012 at 3:03 PM, Richard W.M. Jones <rjones@xxxxxxxxxx> wrote:
> On Fri, Jan 06, 2012 at 02:55:35PM -0600, Richard Shaw wrote:
>> Ok, I didn't know how to make the subject any shorter, but there's a
>> big BUT in this, but (hehe) first a summary.
>>
>> I have a user of MythTV that has capture devices which require a
>> firmware be uploaded. As a consequence, the /dev paths are not always
>> created by the time mythbackend tries to start. A solution to this is
>> to create a mythbackend.path unit file which will wait for the devices
>> to be created, BUT, they occasionally fail to initialize and the path
>> unit file doesn't seem to have a timeout option (or option for what to
>> do once the timeout is reached).
>>
>> A partial solution would be to use a timer unit file, but it too
>> doesn't do quite what I need. It doesn't appear that I can wait for
>> the start of one unit file (mythbackend.path) while starting a
>> different unit file (mythbackend.service) once the timeout is reached.
>>
>> I could use the same 'After=...' as I have on the main service file
>> which would approximate the same startup time, but that's rather
>> hackish. I am assuming that having two unit files (a path and a timer)
>> trying to start the same service isn't an issue and that the first one
>> wins.
>
> We use the following for the libguestfs live service:
>
> http://pkgs.fedoraproject.org/gitweb/?p=libguestfs.git;a=blob;f=99-guestfsd.rules;h=ab4f6800bbd847307aceb2cb52e984524eaee52c;hb=HEAD
>
> http://pkgs.fedoraproject.org/gitweb/?p=libguestfs.git;a=blob;f=guestfsd.service;h=482d1e2bf1fb1c791e3adfe3f58716c38edb6b3d;hb=HEAD

I did look at the device unit file but it would probably take me a
while to figure out how to use it and this needs to be done in a way
an average "techie" user can fix it for their specific hardware. My
plan was to create the timer and path files in a way they don't
interfere with normal operation such as mine (I have a HDHR network
based tuner, so I don't need this) and then leave decent instructions
in the files on how to customize it for their setup, including copying
the files to /etc/systemd/system so they dont' get overwritten on the
next update.

Richard
-- 
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxxx
https://admin.fedoraproject.org/mailman/listinfo/devel



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux