Bug 470654

Summary: can not enable/disable a system service in a single runlevel
Product: [openSUSE] openSUSE 11.1 Reporter: yc wang <wangyc0307>
Component: YaST2Assignee: Dr. Werner Fink <werner>
Status: RESOLVED WONTFIX QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: grey-olli, puzel, wangyc0307, werner
Version: Final   
Target Milestone: ---   
Hardware: All   
OS: openSUSE 11.1   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: the screenshot of what I was doing
insserv-1.12.0-22.24.i586.rpm
insserv-1.12.0-22.24.x86_64.rpm

Description yc wang 2009-01-29 16:20:50 UTC
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121300 SUSE/3.0.5-1.1 Firefox/3.0.5

when I tried to enable a system service just in a single runlevel , for example, the vsftpd only in runlevel 5,  I used the runlevel dialog of Yast, I switched to the expert mode, selected the vsftpd entry, and ticked ONLY the runlevel 5's check box. But it turned out that vsftpd in runlevel 3 AND 5 were BOTH enabled. Actually, this is the case for all the services - when the check box of one runlevel is checked, the service will be enabled in ALL the runlevels which is supposed to be "Default-Start" . 

So I would like to make sure if this is designed to work like this or this is really a bug. And if it is designed to be so, I still hope I can enable/disable a system service in a single runlevel. 

I think this will happen in all openSUSE11.1 machines and is easy to reproduce, so I don't offer the yast's log, but if you really need that, please tell me. Thank you.

Reproducible: Always

Steps to Reproduce:
1.
2.
3.
Comment 1 yc wang 2009-01-29 16:27:54 UTC
Created attachment 268682 [details]
the screenshot of what I was doing
Comment 2 Lukas Ocilka 2009-02-19 09:54:22 UTC
Yes, this is reproducible with another service I tried:

YaST called this command
Service.ycp:241 Calling /sbin/insserv -f /etc/init.d/smt,start=5

But the service had been enabled in Default-Start instead of runlevel 5 only
(I did that on service disabled in all levels).

/etc/init.d/smt contains (header):
### BEGIN INIT INFO
# Provides:                     smt
# Required-Start:               $local_fs $remote_fs $network mysql apache2 cron
# X-UnitedLinux-Should-Start:   $local_fs $remote_fs $network mysql ypclient apache2 cron
# Required-Stop:                $local_fs $remote_fs $network
# X-UnitedLinux-Should-Stop:    
# Default-Start:                3 5
# Default-Stop:                 0 1 2 6
# Short-Description:            SMT - Subscription Management Tool for SLE
# Description:                  Handles SMT service by apache2 with plugins, mysql and cron
### END INIT INFO

Reassigning to the insserv maintainer...
Comment 3 Dr. Werner Fink 2009-02-20 15:51:54 UTC
If you call /sbin/insserv -f /etc/init.d/smt,start=5
then you get runlevel 5 as you are overwriting the
default runlevel specified in the file /etc/init.d/smt
this is how it works and this is how it is readable in
man insserv.
Comment 4 yc wang 2009-02-21 08:17:26 UTC
It seems that if you call /sbin/insserv -f /etc/init.d/smt,start=n, then BOTH the default runlevel AND the n runlevel(if it's not in the default runlevel) will be enabled. Maybe this is the way it had been designed.
But for me, as a end user, I don't really care how /sbin/insserv works and what the default runlevel is. What I want is to enable a specified runlevel, as ticking the corresponding check box, and I don't hope the default runlevel is enabled too. So can this be satisfied simply with YaST? Thanks.
Comment 5 yc wang 2009-02-21 08:19:42 UTC
It seems that if you call /sbin/insserv -f /etc/init.d/smt,start=n, then BOTH
the default runlevel AND the n runlevel(if it's not in the default runlevel)
will be enabled. Maybe this is the way it had been designed.
But for me, as a end user, I don't really care how /sbin/insserv works and what
the default runlevel is. What I want is to enable a specified runlevel, as
ticking the corresponding check box, and I don't hope the default runlevel is
enabled too. So can this be satisfied simply with YaST? Thanks.
Comment 6 Dr. Werner Fink 2009-02-23 10:41:41 UTC
I'll not change insserv. The default runlevels are a hard requirement
otherwise the system may not boot correct.  If you really want to
ignore the system default you may use an overwrite file:

   mkdir -p /etc/insserv/overrides
   sed -rn '/^### BEGIN INIT INFO/,/^### END INIT INFO/{
       s/(.*Default-Start:[[:blank:]]*).*/\15/
       p
   }' < /etc/init.d/smt > /etc/insserv/overrides/smt

this is curently the only way to not only add an additional runelvel
but remove the default values intended by the author of the script.
Comment 7 Dr. Werner Fink 2009-02-23 12:32:13 UTC
Created attachment 274646 [details]
insserv-1.12.0-22.24.i586.rpm

insserv allowing to disregard default run levels of scripts with
option -f.
Comment 8 Dr. Werner Fink 2009-02-23 12:33:01 UTC
Created attachment 274647 [details]
insserv-1.12.0-22.24.x86_64.rpm

insserv allowing to disregard default run levels of scripts with
option -f.
Comment 9 Dr. Werner Fink 2009-02-23 12:34:16 UTC
You may try out one of the above attachments with a insserv
allowing to disregard default run levels if option -f is
specified ... but this will not become part of openSuSE 11.1.
Comment 10 yc wang 2009-03-01 09:43:34 UTC
Thank you for the bug-470654_insserv-1.12.0-22.24.i586.rpm, it worked. However I still think the design is kind of strange: It's not that you can't disable the service in default runlevels -- you can disable it in all default runlevels, *but* you can't disable it respectively, for example, you can't disable it in runlevel 3 while enabling it in runlevel 5, Do the two runlevels interact? 
Actually, I used to use Fedora, and its system-config-service utility can do what I expect. So I thought openSUSE was supposed to do that too. Anyway, I won't ask for that again, and thanks very much for your help
Comment 11 Dr. Werner Fink 2009-03-30 12:54:01 UTC
*** Bug 482532 has been marked as a duplicate of this bug. ***