[ofa-general] [PATCH] opensm/opensm.spec: comment out service auto-startup setup
Al Chu
chu11 at llnl.gov
Fri Sep 12 21:05:43 PDT 2008
Hey Sasha,
I suddenly remembered that I've had to support a daemon on Suse before
and looked at that project's init.d script :-)
I *think* I remember how this is handled in Suse now. It's a different
set of comments at the top of the init.d script. In
opensm/scripts/opensm.init.in I see this:
### BEGIN INIT INFO
# Provides: opensm
# Required-Start: $syslog
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Description: Manage OpenSM
### END INIT INFO
I think this indicates that by default opensm should start on boot on
run levels 2 3 5. Which I guess is what we don't want. I'm going to
take a guess that the following patch will fix the problem. Patch is
completely untested (I don't have a suse system). So hopefully someone
else can try it out.
Al
On Fri, 2008-09-12 at 23:52 -0400, Al Chu wrote:
> Hey Sasha,
>
> > 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
>
> 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. 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.
>
> # > 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
>
> 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
>
> _______________________________________________
> general mailing list
> general at lists.openfabrics.org
> http:// lists.openfabrics.org/cgi-bin/mailman/listinfo/general
>
> To unsubscribe, please visit http:// openib.org/mailman/listinfo/openib-general
>
--
Albert Chu
chu11 at llnl.gov
925-422-5311
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-do-not-start-opensm-on-boot-automatically.patch
Type: application/mbox
Size: 770 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080913/cdf684b5/attachment.mbox>
More information about the general
mailing list