[Freeipa-devel] [PATCH] 0097 Avoid --list option of chkconfig

Simo Sorce simo at redhat.com
Wed May 4 21:16:49 UTC 2011


On Wed, 2011-05-04 at 16:57 -0400, Simo Sorce wrote:
> On Wed, 2011-05-04 at 17:12 +0200, Martin Kosek wrote:
> > On Wed, 2011-05-04 at 11:01 -0400, Simo Sorce wrote:
> > > On Wed, 2011-05-04 at 16:56 +0200, Martin Kosek wrote:
> > > > On Wed, 2011-05-04 at 10:28 -0400, Simo Sorce wrote:
> > > > > The chkconfig --list option is not reliable as it works differently on a
> > > > > F15 system with systemd enabled services, avoid using it as we have
> > > > > alternative better ways.
> > > > > 
> > > > > Simo.
> > > > > 
> > > > 
> > > > NACK. This breaks the installation:
> > > > 
> > > > # ipa-server-install
> > > > ...
> > > > Configuring ntpd
> > > >   [1/4]: stopping ntpd
> > > >   [2/4]: writing configuration
> > > >   [3/4]: configuring ntpd to start on boot
> > > > Unexpected error - see ipaserver-install.log for details:
> > > >  Command '/sbin/chkconfig --level 3 ntpd' returned non-zero exit status 1
> > > > 
> > > > I think you want to make use of raiseonerr=False parameter in
> > > > ipautil.run().
> > > > 
> > > > Plus, I would prefer integers to be used in runlevels array instead of a
> > > > string containing an integer. Makes more sense to do it this way.
> > > 
> > > New patch attached.
> > > 
> > > Simo.
> > > 
> > 
> > ACK. Worked for me on both F-14 and F-15.
> 
> Hold on pushing this one, it seem that chkconfig service and chkconfig
> service --list were not mututally exchangable in this context as we
> thought ...

After the conversation here [1] and after looking more closely at how
the functions that used --list were actually used in the code I came to
the conclusion that the use of chkconfig service --list was not really
needed in either cases.

In the client we assume all services we need to be present through
packaging dependencies anyway, and even if we fail we properly catch any
exception so it is never a fatal issue.

In the server install we used to check if the service was enabled at all
run levels before considering it really enabled, but upon careful
consideration I believe we do not really care. In each place we called
is_enabled() what we care about is really just if the service is enabled
in the current runlevel, not if it is normally enabled at other run
levels, and actually checking for other runlevels could cause issue
because a service not enabled at runlevel 4 but currently enabled at the
one the install is running with would result disabled, and that's not
what callers are really expecting from that test.

So long story short I have a patch the basically radically strips away
the previous code and radically simplifies it to one simple call in the
server code and none at all in the client code.

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freeipa-simo-0097-3-install-scripts-avoid-using-list-with-chkconfig.patch
Type: text/x-patch
Size: 2625 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/freeipa-devel/attachments/20110504/5668a9e7/attachment.bin>


More information about the Freeipa-devel mailing list