PDA

View Full Version : use of chkconfig


tekknokrat
3rd April 2009, 01:11 PM
I am trying to move the priority of the wpa_supplicant init.d script.

The script is modified to the new priorities and header looks like this:

/etc/init.d/wpa_supplicant:
#!/bin/bash
#
# wpa_supplicant
#
# chkconfig: - 09 91
# description: wpa_supplicant is a WPA Supplicant for Linux, BSD and \
# Windows with support for WPA and WPA2 (IEEE 802.11i / RSN). Supplicant \
# is the IEEE 802.1X/WPA component that is used in the client stations. \
# It implements key negotiation with a WPA Authenticator and it controls \
# the roaming and IEEE 802.11 authentication/association of the wlan driver.
# processname: wpa_supplicant
# config: /etc/wpa_supplicant/wpa_supplicant.conf
#
### BEGIN INIT INFO
# Provides: wpa_supplicant
# Required-Start: $local_fs messagebus
# Required-Stop: $local_fs messagebus
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: start and stop wpa_supplicant
# Description: wpa_supplicant is a tool for connecting to wireless networks
### END INIT INFO

I tried several commands to get the symlinks updated to fit the new entry:

chkconfig --level 2345 wpa_supplicant off
chkconfig --level 2345 wpa_supplicant on

chkconfig --level 2345 wpa_supplicant reset

chkconfig --level 2345 wpa_supplicant resetpriorities

But none of the changes the symlink:

ls /etc/rc*.d/|grep wpa
K84wpa_supplicant
K84wpa_supplicant
S23wpa_supplicant
S23wpa_supplicant
S23wpa_supplicant
S23wpa_supplicant
K84wpa_supplicant


Any suggestions?

giulix
3rd April 2009, 04:10 PM
Most probably --del and --add will do the trick

tekknokrat
3rd April 2009, 04:25 PM

Most probably --del and --add will do the trick

nope, only forgot that in my list.

~$ sudo chkconfig --del wpa_supplicant
~$ sudo chkconfig --add wpa_supplicant
~$ ls /etc/rc*.d/|grep wpa
K84wpa_supplicant
K84wpa_supplicant
S23wpa_supplicant
S23wpa_supplicant
S23wpa_supplicant
S23wpa_supplicant
K84wpa_supplicant

giulix
3rd April 2009, 04:49 PM
Somehow the lines between
###### BEGIN INIT INFO
and
###### END INIT INFO
included seem to confuse chkconfig on my Centos 4 (no prob in deleting the links, though). See whether removing them improves the situation

tekknokrat
3rd April 2009, 10:49 PM
Got it solved when removing the Required-Start/Required-Stop statements, thanks for pointing that out.
I wonder where it gets the default priority for --add service.

giulix
8th April 2009, 02:35 PM
It seems to depend from dependencies in the init scripts. Check this (http://fedoraproject.org/wiki/Packaging/SysVInitScript) and this (http://git.fedorahosted.org/git/?p=chkconfig.git;a=blob;f=chkconfig.c;h=a6ca0ef3a9 bac9a10de508f55377f37f44c2ba2e;hb=HEAD) (function frobOneDependencies) for insights.