RPM Community Forums

Mailing List Message of <rpm-users>

Re: Creating an RPM to install a daemon

From: Jeff Johnson <n3npq@mac.com>
Date: Thu 28 Oct 2010 - 18:33:26 CEST
Message-id: <C1AD2C0B-0A83-4E1C-A23E-FF83BA1E07D0@mac.com>

On Oct 28, 2010, at 11:10 AM, Joe Flowers wrote:

> Hello Everyone,
> I am trying to create an RPM that will install a daemon "correctly", but I'm not sure if or where I should put the command:
> chkconfig --level 345 /etc/rc.d/mydaemon on

Well first of all, chkconfig doesn't do the right
thing in many cases like installing into a chroot,
or with SELinux enabled, or if networking isn't
configured, etc etc etc.

So one can make a strong argument (I just tried, YMMV) for _NOT_
doing chkconfig in package scriptlets whatsoever, but rather
configure daemon startup (if changed) in some other way,

The underlying design principle that is violated with chkconfig in packaging
scriptlets is that
	package management != configuration management
the important difference is the persistence involved:
	The time scale and state for package management is rather different
	than that for configuration management.
And in many cases :One size does not fit all usage cases".

But the specific answer to your question is usually to add to %post/%preun.

You likely have examples on your system using chkconfig already installed:

	rpm -qa --scripts > /tmp/scripts

and then look for an example of what is being attempted with chkconfig.

Do the same thing.

> Should this line go somewhere in the Makefile (like the "install" section), or should it go in the RPM .spec file somewhere?

Not the Makefile, but in the %post or %preun scriptlet in the spec file.

> Is there some other command I should use rather than this external "chkconfig" program?

For configuring a daemon to start at a run level, chkconfig is what you want.


73 de Jeff
Received on Thu Oct 28 18:34:05 2010
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.