Mike Gerdts wrote:
> I'm looking for some clarification on how file dependencies are
> supposed to work.
> 
> At http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6240573 it says:
> 
>> file:// dependencies are currently overused by SMF consumers.  The problem
>> is that a file:// dependency means "wait for this file to become available
>> before starting".  That's not the usual case.  Most users of file: 
>> dependencies
>> are trying to express the concept that "if this file is missing, there is
>> a problem."
> 
> (dp Cc'd because he begs for it in the bug report)
> 
> In cases where required files are automounted, this behavior doesn't
> seem to be the case.  Rather, the service never comes online.
> Specifying a dependency on autofs is not sufficient because autofs
> doesn't start to work until several seconds after it comes online.

That's probably a bug worth filing against autofs.

> This causes the service to go into maintenance because the start
> method doesn't exist. The best workaround (aside from not using the
> automounter) is to have a start method like:
> 
> /bin/sh -c 'while [ ! -f /path/to/cmd ] ; do sleep 1 ; done ; /path/to/cmd %m'
> 
> However, http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=5106165
> suggests that file dependencies are only evaluated once at service
> start.  This behavior, however, seems to be at odds with smf(5):
> 
>   Dependencies
>      Service instances  may  have  dependencies  on  services  or
>      files. Those dependencies govern when the service is started
>      and automatically  stopped.  When  the  dependencies  of  an
>      enabled  service  are  not satisfied, the service is kept in
>      the offline state. When its dependencies are satisfied,  the
>      service  is started.  . . .
> 
> What is the correct behavior?  Should a service that depends on a file
> come online when the file appears?

It doesn't as implemented today.  5106165 is accurate.  Feel free to 
file a bug against smf(5), or I'll do so later today/tomorrow.

liane

Reply via email to