aguilarojo wrote:Of course what chkconfig is looking at are what daemons are running at which level.
Of course, before making any changes regarding what levels the daemons are to run be sure to check references regarding what each runlevel actually is supposed to be and do. After you've acquired that understanding then changing a runlevel to on/off is the same. You do the following:
- Code: Select all
# chkconfig --level 2 yum-updatesd on
Actually - with the latest versions of chkconfig it isn't necessary to do that if the startup script is written correctly. That information is now contained in the startup script itself.
e.g. for /etc/rc.d/init.d/sendmail
- Code: Select all
[root@localhost ~]# cat /etc/rc.d/init.d/sendmail
#!/bin/bash
#
# sendmail This shell script takes care of starting and stopping
# sendmail.
#
# chkconfig: 2345 80 30
# description: Sendmail is a Mail Transport Agent, which is the program \
# that moves mail from one machine to another.
# processname: sendmail
# config: /etc/mail/sendmail.cf
# pidfile: /var/run/sendmail.pid
See that commented out chkconfig line? That tells the chkconfig utility what the default parameters are. So - rather than checking the run config at each level:
- Code: Select all
[root@localhost ~]# chkconfig --list sendmail
sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@localhost ~]#
and turning it off level by level as you suggested, for most people, you can do this:
- Code: Select all
[root@localhost ~]# chkconfig sendmail off
[root@localhost ~]# chkconfig --list sendmail
sendmail 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@localhost ~]#
and if you want to restore the default settings:
- Code: Select all
[root@localhost ~]# chkconfig sendmail on
[root@localhost ~]# chkconfig --list sendmail
sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off
[root@localhost ~]#
Neat, huh? Much easier for beginners.
It also sets the correct name for the startup and kill scripts in the various runlevel directories. Again, using the sendmail example above, we see that the start script should be prefixed with an 80, and the kill script prefixed with a 30. On my unix box:
- Code: Select all
[root@localhost rc.d]# cd rc0.d
[root@localhost rc0.d]# ls |grep sendmail
K30sendmail
[root@localhost rc0.d]# cd ../rc3.d
[root@localhost rc3.d]# ls |grep sendmail
S80sendmail
[root@localhost rc3.d]#
Coming from a Solaris background, where you had to do all of this on the file system itself, I do love this utility.
Anyway - otakusupreme - you want to do this from a terminal window:
su -l
<enter root password>
chkconfig sendmail offThe output should look something like this:
- Code: Select all
[paulp@localhost ~]$ su -l
Password:
[root@localhost ~]# chkconfig sendmail off
[root@localhost ~]# chkconfig --list sendmail
sendmail 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@localhost ~]#
Cheers,
Paul