I am total Linux n00b entrusted with bunch of PUIAS (RedHat) 6.4 servers and desktops. I noticed after rebooting my computing nodes (done just for testing purposes) that many of the daemons which are started manually after initial installation (ipmi, mcelog, fail2ban) are not running and have to be restarted manually. This server is suppose to run on the run level 3 (no GUI). Similar exercise on the same OS version on the desktops (run level 5) produces totally different outcome. Namely all daemons are properly started. Is this excepted and should I edit /etc/init.d scripts or maybe just write mine which will start services? Is there the other correct way of doing this?I am coming from OpenBSD world where build in daemons are simply stared by editing /etc/rc.conf.local  and all other daemons are started by editing /etc/rc.local.
Daemons not starting during the boot on PUIAS (RedHat) 6.4
rhel;init script;init.d
(I'm not trying to be pedantic, I just don't know how much you know or don't know, so I'm basically braindumping here)First off, just be aware that Red Hat picks weird stuff to install and enable by default. For instance it's either RHEL5 or RHEL6 that will install avahi and enable it to start at boot. I think both versions install and enable cups for almost all the installation profiles you can pick. RHEL6 doesn't install man by default, etc, etc.On RHEL there are three ways you can manage services:Manually modify the symlinks underneath /etc/rc.d or /etc/rcX.d Use chkconfig (modeled after IRIX's tool of the same name) use the setup command provided by the setuptool package (which may or may not be installed depending on the profile that was selected during the initial install).More details on each:Manual Management:The RHEL/System V startup sequence is thus:/etc/rc.sysinit is ran, which gets most of the critical parts of the operating system such as critical filesystems in place.init then looks into /etc/rcX.d (where X for the runlevel it's booting into) and executes all the files/symlinks contained therein (in alphabetical order).If their name begins with and S it gives the script start as its argv[1]/$1 If their name begins with a K it stops (or kills) the service. Convention has it that dependencies are handled by changing the number after the K or S which has the effect of just changing its alphabetical position.It executes whatever is in /etc/rc.localThe actual service scripts will be in /etc/rc.d/init.d (which is also symlinked to on /etc/init.d). If you want a service to start at run level 3 (network but no GUI) you could do this:# cd /etc/rc3.d# ln -s /etc/init.d/myService S99myServiceUsing chkconfigThe purpose of chkconfig is basically to automate the above process for you. It has the drawback of requiring that the initscripts have a certain header before you can manage the service with chkconfig. For example, this is the start of the networking service:#! /bin/bash## network       Bring up/down networking## chkconfig: 2345 10 90# description: Activates/Deactivates all network interfaces configured to \#              start at boot time.#### BEGIN INIT INFO# Provides: $network### END INIT INFOThis enables chkconfig and figure out what number it needs to set/modify in order to get dependencies to work out properly. You lose the ability to change order but because of the above it hardly ever actually matters.chkconfig is easier and is frankly what I use most of the time.You can check which services are configured at what run levels via chkconfig --list For example:[root@ditirlns01 ~]# chkconfig --list | headNetworkManager  0:off 1:off 2:off  3:off  4:off 5:off  6:offacpid           0:off 1:off 2:on 3:on   4:on   5:on 6:offanacron         0:off 1:off 2:on 3:on   4:on   5:on 6:offarptables_jf    0:off 1:off 2:on 3:on   4:on   5:on 6:offatd             0:off 1:off 2:off  3:off  4:on 5:on 6:offauditd          0:off 1:off 2:off  3:off  4:off 5:off  6:offautofs          0:off 1:off 2:off  3:off  4:on 5:on 6:offavahi-daemon    0:off 1:off 2:off  3:off  4:on 5:on 6:offavahi-dnsconfd  0:off 1:off 2:off  3:off  4:off 5:off  6:offcapi            0:off 1:off 2:off  3:off  4:off 5:off  6:offOr check on the status of particular services:[root@ditirlns01 ~]# chkconfig --list auditdauditd          0:off 1:off 2:off  3:off  4:off 5:off  6:offYou can enable a service via chkconfig <serviceName> on Continuing the example above:[root@ditirlns01 ~]# chkconfig auditd on[root@ditirlns01 ~]# chkconfig --list auditdauditd          0:off 1:off 2:on 3:on   4:on   5:on 6:offAs you can see chkconfig enable the auditd service for run levels 3 thru 5.If you didn't want that you, can use the --levels option to set specific run levels to enable:[root@ditirlns01 ~]# chkconfig auditd off[root@ditirlns01 ~]# chkconfig auditd on --levels=3[root@ditirlns01 ~]# chkconfig --list auditdauditd          0:off 1:off 2:off  3:on 4:off  5:off   6:offWith setuptoolsetup is the latest iteration of system management, designed to make common administrative tasks a little easier. It would work that way if Red Hat would install everything needed to make it so. But starting with RHEL6 they separated out setuptool functionality amongst several packages (I guess to make it more comprehensive without clogging the menu). It's a pretty self-explanatory ncurses-based wrapper around chkconfig except that it doesn't let you single out particular run levels:Not much to say about it beyond that.Let me know if that answered you question.