Dan Cox<[EMAIL PROTECTED]> wrote on 2007-06-12 18:04:
> Should 'rc' be executing the %sections of an rc script at all if it's
> disabled?
> 
The current implementation does, leaving the ultimate checking to the
%section. As Ralf wrote, this was intended for flexibility but
experience told us this was overkill and a possible optimization could
be to not even call the %section and get rid of the "rcService postfix
enable yes || exit 0" code which exists in every rc.FOO file.

> At the moment it appears that enable is being hard coded to 'yes' in
> rc, line 286. Based on the logic in the rest of the section it doesn't
> appear that this was the original intention?
> 
You are scratching the surface only. This and the next ~200 lines of
code are preinitialization only, the exec follows thereafter :-) One of
the required dirty tricks is to read the rc.conf twice. First time for
getting the rc_def(ault) definition and then to get the rc_all and, by
reading the appropriate rc.FOO, to get the enable_FOO which could
leverage rc_def from the first pass. This beast is tricky. Other
challenges are the support to run multiple sections (allows "openpkg rc
apache status stop status start status")  one one or all ("openpkg rc
all ...") packages in priority order (bind before mysql before apache)
and tuning in for the correct user for each package and each section, if
required and if possible ..., capture stdout/stderr but display only
based on content availability and return code ...  Oh, well. This
scripts sounds like an easy piece until you look inside. 

-- 
http://thomas.lotterer.net
______________________________________________________________________
OpenPKG                                             http://openpkg.org
User Communication List                      openpkg-users@openpkg.org

Reply via email to