On Tue, 30 Dec 2003, Greg Zartman wrote:

> What is the correct way to start a supervised service from within an 
> RPM? 

I doubt there is a single "correct way".

> For example:  I create an rpm that installs a new service and then 
> want to start said service.  Is this done in the %POST script with 
> /etc/rc.d/init.d/xxxx, svc -u /var/service/xxx, or something entirely 
> different?

The first question to ask yourself is whether you want the rpm to start 
the service. 

If the rpm will only ever be installed from CDROM, you don't 
want to start the service. 

If the rpm might be installed from CDROM, you won't want to start the
service duing CDROM install, but you might want to at other times. You'll
need to work out how to detect whether the installer is running, or the
system is up and fully running.

If the rpm will be installed by a higher level management system (some 
equivalent of Mitel blades), then service control might be provided by 
that system (so that you can ensure that all rpms are installed and 
configured before you try to start services).

OK, now you want to start the service. If the service directory does not 
contain a 'down' file, there's nothing to do - svscan will find the 
service directory and start the service for you. If the service directory 
does contain a 'down' file (which it would if you wanted to delay startup 
of the service during bootup), then you would wish to start it, which you 
can do with any of:

/etc/rc.d/init.d/xxxx
/etc/rc7.d/Snnxxxx
svc -u /service/xxxx

Of these, only /etc/rc7.d/Snnxxxx will check the config database for a
"status == enabled" property for the service. If you care about the db
property, that's what you'll want to do. Whichever way you do it, "svc -u"  
will eventually be called, and is what will actually bring the service up.

--
Charlie Brady                         [EMAIL PROTECTED]
Mitel Networks Corporation      http://www.mitel.com/
Phone: +1 (613) 592 5660 or 592 2122  Fax: +1 (613) 592 1175

A: Because we read from top to bottom, left to right.
Q: Why should i start my reply below the quoted text?


--
Please report bugs to [EMAIL PROTECTED]
Please mail [EMAIL PROTECTED] (only) to discuss security issues
Support for registered customers and partners to [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Searchable archive at http://www.mail-archive.com/devinfo%40lists.e-smith.org

Reply via email to