YaST - System Services (Runlevel from xNo to xYes)

Hi

I’ve navigated with YaST in the commandline-mode to “System Services (Runlevel): Services”. I changed the entry from " xdleserver xNo x" to “xYes”. The goal is, that the dleserver would start at the system start. Everything looked fine:
I was able to open the sub-menu with “CTRL + ALT + 3” and then this dialog appeared: “[Enable][Disable][Help][Cancel][ OK ]” I’ve pushed “ALT + E”. After that, this message appeared:

/etc/init.d/dleserver start returned 0 (success): [OK]

I’ve confirmed this message as well. After that, the entry looked like that:

xdleserver          	xNo*	x

I was again in the previous menu after pushing “OK” (System Services (Runlevel)). I hit the menu again to check the entry. It was again on “No”:

xdleserver          	xNo	x

Do you know why I can’t change that? I thought it worked cause it said “returned 0 (success)”

FYI: The script in /etc/init.d looks like that:

[CODE]#!/bin/sh

chkconfig: 5 66 34

description: dleserver_vftodo

DLE=/opt/dle

cd /opt/dle/scripts

case “$1” in
start)
echo -n “Starting dle Server …”
su dle -c “/usr/bin/nohup /opt/dle/scripts/startserver.sh 1>>/opt/dle/log/server_out.log 2>&1 &”
;;
stop)
echo -n “Shutting down dleServer …”
su dle -c “/usr/bin/nohup /opt/dle/scripts/stopserver.sh 1>>/opt/dle/log/server_out.log 2>&1 &”
;;
status)
status dleserver_vftodo
;;
*)
echo “Usage: $0 {start|stop|status}”
exit 1
;;
esac[/CODE]

Hi DiViNe,

first of all, which version of SLES are you trying this on?

[QUOTE=DiViNe;29699]I’ve navigated with YaST in the commandline-mode to “System Services (Runlevel): Services”. I changed the entry from " xdleserver xNo x" to “xYes”. The goal is, that the dleserver would start at the system start. Everything looked fine:
I was able to open the sub-menu with “CTRL + ALT + 3” and then this dialog appeared: “[Enable][Disable][Help][Cancel][ OK ]” I’ve pushed “ALT + E”. After that, this message appeared:

/etc/init.d/dleserver start returned 0 (success): [OK][/QUOTE]

I tried to reproduce this on SLES11SP3, for some arbitrary service. Selecting “Alt-E” to enable that previously non-started, not enabled service did indeed return above message - this is expected, as the service is not only enabled, but started as well.

[QUOTE=DiViNe;29699]I’ve confirmed this message as well. After that, the entry looked like that:

xdleserver              xNo*    x

This indicates that the service was (still) not enabled, but is in a different state (==started) right now.

[QUOTE=DiViNe;29699]I was again in the previous menu after pushing “OK” (System Services (Runlevel)). I hit the menu again to check the entry. It was again on “No”:

xdleserver              xNo    x

Do you know why I can’t change that? I thought it worked cause it said “returned 0 (success)”[/QUOTE]
That status response was from starting the service, which seems to have worked. It was enabling the service that failed.

[QUOTE=DiViNe;29699]FYI: The script in /etc/init.d looks like that:

[CODE]#!/bin/sh

chkconfig: 5 66 34

description: dleserver_vftodo

DLE=/opt/dle
[…][/CODE][/QUOTE]

The script’s LSB header looks far from complete.

What happens if you try this from command line, i.e “chkconfig dleserver on”? What problems and/or errors does it report?

Regards,
Jens

Hi Jens

Thank you very much for your answers.

Ups, yes, sry. We’ve got 3 test server and all of them running the same version:
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 3

OK, maybe that might be a/the problem. I never wrote an init script, but I read the first part of this (http://www.thegeekstuff.com/2012/03/lsbinit-script/) and it looks like you’re right.
Is it a big thing to fix the init-script?

r01vm040ux012:~ # chkconfig dleserver on insserv: warning: script 'dleserver' missing LSB tags insserv: warning: script 'dleserver' missing LSB tags insserv: Default-Start undefined, assuming default start runlevel(s) for script `dleserver' insserv: Service network is missed in the runlevels 4 to use service cfengine3 insserv: Service syslog is missed in the runlevels 4 to use service lbaseonline r01vm040ux012:~ # chkconfig dlserver dlserver: unknown service r01vm040ux012:~ # chkconfig dlserver on dlserver: unknown service r01vm040ux012:~ # chkconfig dleserver on r01vm040ux012:~ # chkconfig dleserver on
Is it normal, that I’ll get an other output after trying it again?

Have a nice day!

Cheers

Hi DiViNe,

[QUOTE=DiViNe;29713]Hi Jens

Thank you very much for your answers.

Ups, yes, sry. We’ve got 3 test server and all of them running the same version:
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 3

OK, maybe that might be a/the problem. I never wrote an init script, but I read the first part of this (http://www.thegeekstuff.com/2012/03/lsbinit-script/) and it looks like you’re right.
Is it a big thing to fix the init-script?[/QUOTE]

no - that article seems to explain it well, so just have a look around the other init scripts if in doubt, and add the headers with proper values.

[QUOTE=DiViNe;29713] [CODE]r01vm040ux012:~ # chkconfig dleserver on
insserv: warning: script ‘dleserver’ missing LSB tags
insserv: warning: script ‘dleserver’ missing LSB tags[/QUOTE]

I told you :slight_smile:

… but at least chkconfig tries to be helpful :slight_smile: OTOH, I’d rather assume that you’ll prefer to specify the run levels actually intended… “3 5” might be a good guess.

[QUOTE=DiViNe;29713]insserv: Service network is missed in the runlevels 4 to use service cfengine3 insserv: Service syslog is missed in the runlevels 4 to use service lbaseonline[/QUOTE]

These two messages seem to point at missing dependencies from other init scripts. It seems “cfengine3” and “lbaseonline” were copied from some other distribution, because run level 4 is marked as “not used” in SLES. Is it safe to assume that you have added non-SLES software packages to this server installation?

You’ll need to clean up these errors, as from my experience, this type of problem will sometimes make chkconfig stop working, even for properly defined services.

[QUOTE=DiViNe;29713]r01vm040ux012:~ # chkconfig dlserver dlserver: unknown service r01vm040ux012:~ # chkconfig dlserver on dlserver: unknown service[/QUOTE]

Expected. The service name is missing the “e”?

[QUOTE=DiViNe;29713]r01vm040ux012:~ # chkconfig dleserver on r01vm040ux012:~ # chkconfig dleserver on
Is it normal, that I’ll get an other output after trying it again?[/QUOTE]

Well, maybe it was able to enable the service (running “chkconfig dleserver” will tell you), so it didn’t call the code to re-enable the service and hence didn’t catch the other errors.

As a general word of advice: Sticking to SLES packages would circumvent this, but I do understand that you often have the need to get past that point. You’ll then need to know how to mess around with the software installation of your server properly (or have to deal with an installation that someone else was messing around with), so get in touch with the basics of LSB scripts and the specifics as used in SLES. Init scripts are vital to the operation of your server and you can easily get into a situation where “regular changes” won’t work because some non-conforming script put a foot in the doorway.

Regards,
Jens

Thank you very much!

Have nice week.

Cheers