Like everything RedHat, service slapd start more or less runs /etc/init.d/slapd start. So just read the script and figure it out (hint: /etc/sysconfig/ldap).
First and most importantly, from the usage standpoint, it provides a standard interface that everybody can approach. I don't have to worry about what commands slapd takes versus apache, or samba, or any other service. It also means I can jump between any distributions with a reasonably safe expectation that I can start and stop services in an almost identical way. By using /etc/sysconfig for configuration, it also means that I can edit the way it starts up without having to delve into foreign code, potentially messing something up along the way.
On the technical aspect, not every application provides a nice way to daemonize itself. Some have no ability to background, others won't orphan a child so that when the shell closes the application closes. Using it as a service also allows the system to maintain when it runs, including at system startup. Using the SySV init scripts defined in /etc/init.d/functions in RedHat, it also allows it to formalize the interface--that is, check the status, restart, stop, start, etc..
Like everything RedHat,
service slapd start
more or less runs/etc/init.d/slapd start
. So just read the script and figure it out (hint:/etc/sysconfig/ldap
).First and most importantly, from the usage standpoint, it provides a standard interface that everybody can approach. I don't have to worry about what commands
slapd
takes versusapache
, orsamba
, or any other service. It also means I can jump between any distributions with a reasonably safe expectation that I can start and stop services in an almost identical way. By using/etc/sysconfig
for configuration, it also means that I can edit the way it starts up without having to delve into foreign code, potentially messing something up along the way.On the technical aspect, not every application provides a nice way to daemonize itself. Some have no ability to background, others won't orphan a child so that when the shell closes the application closes. Using it as a service also allows the system to maintain when it runs, including at system startup. Using the SySV init scripts defined in
/etc/init.d/functions
in RedHat, it also allows it to formalize the interface--that is, check the status, restart, stop, start, etc..