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

conman spec details for proper uconfigured behavior



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I'm passing on a question on behalf of a customer at one of the
national laboratories regarding some "best practices" packaging
guidelines.  The package in question is a serial console management
program called 'conman':

When the conman rpm is installed, a default "example" config
is installed in /etc/conman.conf (ie, the entire file consists
of comments).  And the conman.spec has a %post stanza that does
something like:

  /sbin/chkconfig --add conman

in order to have conmand started at boot.  Most daemons in Red Hat
seem to follow this convention.  But if conman isn't configured,
the following output is displayed at boot:

  Starting ConMan: conmandERROR:     Configuration "/etc/conman.conf"
  has no consoles defined
                                                             [FAILED]

The beginning and end of the above output comes from the init script,
whereas the ERROR msg in the chewy center comes from conmand's stderr.
Since the default conman.conf only has comments, there are no consoles
defined and conmand exits with an error.

This seems reasonable , but some users have stated that they would
like to have these error messages at boot suppressed if the package
has not been configured.

After some testing, it looks as if the best alternative they've come up
with is to keep:

  %post
  /sbin/chkconfig --add conman

And change the initscript from:

  # chkconfig: 2345 95 5

to something like:

  # chkconfig: - 95 5

(along with removing the LSB Default-Start & Default-Stop lines).

This way, chkconfig still registers the service and creates the K* symlinks,
but no S* symlinks are created and the daemon won't be started by default.
To enable it at boot, the admin must "chkconfig conman on".  

Some other options that have been tossed around are:

Simply not call "chkconfig --add" in %post and require the admin to
manually do this when configuring the package. Most of the daemons in
Red Hat / Fedora perform a chkconfig in %post, so this seems somewhat
atypical.

Another option is to install /etc/conman.conf.example, and have the
init script immediately exit with an error #6 (as defined by LSB)
if /etc/conman.conf does not exist -- no success or failed messages
or anything.  Thus, an unconfigured package would produce no output.
In the %files stanza, they would then have something like:

  %files
  %{_sysconfdir}/conman.conf.example
  %ghost %config(missingok) %{_sysconfdir}/conman.conf

This way, "rpm -qc conman" still lists /etc/conman.conf as a config
file.

Other than the 3 options above, is there a better way to configure
the package to supress the error messages at boot if conman hasn't
been configured?

Thanks.


- -- 
*************
Kent Baxley
Technical Account Manager
Red Hat, Inc.
kbaxley redhat com
gpg key id: E281242D
http://pgp.mit.edu

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (GNU/Linux)

iEYEARECAAYFAkneRqgACgkQ1zXVseKBJC0TnwCeOK9Fet7/8VE8VHbbm0IA08VL
76QAniKXJ2IiSdS1tFP3amdIbW3hIf9m
=5CSq
-----END PGP SIGNATURE-----


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