Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

What is the difference between running slapd using

service slapd start

OR

slapd

?

How can I pass options to the service slapd start command, like slapd -h ldap:// -f salpd.conf?

Thanks.

share|improve this question

2 Answers 2

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).

share|improve this answer

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..

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.