[ofa-general] [PATCH] opensm/opensm.spec: comment out service auto-startup setup

Sasha Khapyorsky sashak at voltaire.com
Sat Sep 13 09:25:29 PDT 2008


Hi Al,

On 23:52 Fri 12 Sep     , Al Chu wrote:
> 
> I don't know how this issue is handled in Suse, but I don't think it
> should be handled by removing the post-install script in the rpm spec
> file.

What I can find is 'chkconfig --add', requested run levels are described
in optional '# Default-Start: ' tag. Something like

	# Default-Start: none

will disable setup and 'chkconfig --add' will do nothing.

This could work as immediate solution and keep RH setup untouched.

> I believe the post install script is typical for redhat/fedora
> systems.  On my RHEL server, a quick look shows most of the popular
> daemons automatically add the daemon to chkconfig.

With RH it is different, startup script must have tag:

	# chkconfig: <levels> <start-priority> <end-priority>

> # > rpm -q --scripts vixie-cron
> postinstall scriptlet (using /bin/sh):
> /sbin/chkconfig --add crond
> 
> # > rpm -q --scripts openssh-server
> postinstall scriptlet (using /bin/sh):
> /sbin/chkconfig --add sshd
>
> # > rpm -q --scripts httpd
> postinstall scriptlet (using /bin/sh):
> # Register the httpd service
> /sbin/chkconfig --add httpd
> 
> # > rpm -q --scripts mysql-server
> postinstall scriptlet (using /bin/sh):
> if [ $1 = 1 ]; then
>     /sbin/chkconfig --add mysqld
> fi
>
> Whether the daemon should be started up automatically on boot is
> configured in the init.d script by specifying what run levels it should
> be configured on/off automatically.
>
> I see in the git master opensm it
> seems to be off by default:
> 
> # > grep chkconfig redhat-opensm.init.in 
> # chkconfig: - 15 85

Correct, and in post-install time 'chkconfig --add' will do nothing
(almost, it will register the service with no startup run-levels).
When user will want to setup startup on boot she will need to edit
startup script and re-run 'chkconfig --add'. If so what is a clear
benefit in running 'chkconfig --add' at post-install time? I don't know.
Maybe only convention.

Sasha

> So perhaps we need to bug some Suse knowledgeable people on how to do
> this properly.  Because I think this patch will break RHEL behavior.
> 
> > So script itself should support 'condrestart' command?
> 
> This is the way I've personally done it.  I can't say what the most
> common method is, but it seems fairly common.  A grep in /etc/init.d on
> my RHEL system shows it is all over the place.
> 
> Al
> 
> On Sat, 2008-09-13 at 05:12 +0300, Sasha Khapyorsky wrote:
> > Hi Al,
> > 
> > On 14:27 Thu 11 Sep     , Al Chu wrote:
> > > 
> > > Although the %post script below may not be 100% portable, I think it's
> > > pretty typical for system daemon rpms.  A quick "rpm -q --scripts
> > > <daemon-rpm>" shows its pretty common for system daemons on RHEL.  It
> > > should be tweaked for portability rather than being removed.
> > 
> > The issue is that it starts opensm service on boot automatically after
> > installation (without user requesting this with 'chkconfig' or so) - see
> > bug #1181  - https:// bugs.openfabrics.org/show_bug.cgi?id=1181
> > 
> > > Personally, I've never done "/sbin/service FOO condrestart" in rpm
> > > scripts.  I do "%{initrddir}/FOO condrestart".  Maybe that's more
> > > portable??
> > 
> > So script itself should support 'condrestart' command?
> > 
> > Sasha
> > 
> > > 
> > > Al
> > > 
> > > On Thu, 2008-09-11 at 23:11 +0300, Sasha Khapyorsky wrote:
> > > > This addresses bug#1181.
> > > > 
> > > > Comment out opensm service auto-startup setup at %post section.
> > > > 
> > > > Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
> > > > ---
> > > > 
> > > > I don't really know why it was done this way originally. So please send
> > > > any comments and/or objections.
> > > > 
> > > >  opensm/opensm.spec.in |   10 +++++-----
> > > >  1 files changed, 5 insertions(+), 5 deletions(-)
> > > > 
> > > > diff --git a/opensm/opensm.spec.in b/opensm/opensm.spec.in
> > > > index 2e3abfc..fc7677d 100644
> > > > --- a/opensm/opensm.spec.in
> > > > +++ b/opensm/opensm.spec.in
> > > > @@ -104,11 +104,11 @@ install -m 755 scripts/sldd.sh $RPM_BUILD_ROOT%{_sbindir}/sldd.sh
> > > >  rm -rf $RPM_BUILD_ROOT
> > > >  
> > > >  %post
> > > > -if [ $1 = 1 ]; then
> > > > -    /sbin/chkconfig --add opensmd
> > > > -else
> > > > -    /sbin/service opensmd condrestart
> > > > -fi
> > > > +#if [ $1 = 1 ]; then
> > > > +#    /sbin/chkconfig --add opensmd
> > > > +#else
> > > > +#    /sbin/service opensmd condrestart
> > > > +#fi
> > > >  
> > > >  %preun
> > > >  if [ $1 = 0 ]; then
> > > -- 
> > > Albert Chu
> > > chu11 at llnl.gov
> > > 925-422-5311
> > > Computer Scientist
> > > High Performance Systems Division
> > > Lawrence Livermore National Laboratory
> > > 
> > 
> -- 
> Albert Chu
> chu11 at llnl.gov
> 925-422-5311
> Computer Scientist
> High Performance Systems Division
> Lawrence Livermore National Laboratory
> 



More information about the general mailing list