diff options
author | Simo Sorce <ssorce@redhat.com> | 2010-12-04 15:42:14 -0500 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2010-12-10 12:28:38 -0500 |
commit | 2efc08a6fc8c0407ff2169e3ef7eed92eaaa6545 (patch) | |
tree | dfaed647e2746972026c0c134c7ce113c0e522f7 /ipa.init | |
parent | ded15c72fff4805e9a095c5a8f82b463603f5d1b (diff) | |
download | freeipa-2efc08a6fc8c0407ff2169e3ef7eed92eaaa6545.tar.gz freeipa-2efc08a6fc8c0407ff2169e3ef7eed92eaaa6545.tar.xz freeipa-2efc08a6fc8c0407ff2169e3ef7eed92eaaa6545.zip |
Introduce ipa control script that reads configuration off ldap
This replace the former ipactl script, as well as replace the current way ipa
components are started.
Instead of enabling each service in the system init scripts, enable only the
ipa script, and then let it start all components based on the configuration
read from the LDAP tree.
resolves: https://fedorahosted.org/freeipa/ticket/294
Diffstat (limited to 'ipa.init')
-rwxr-xr-x | ipa.init | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/ipa.init b/ipa.init new file mode 100755 index 000000000..92c9f4918 --- /dev/null +++ b/ipa.init @@ -0,0 +1,45 @@ +#!/bin/sh +# +# ipa This starts and stops ipa +# +# chkconfig: - 21 79 +# description: IPA Server +# processname: /usr/sbin/ns-slapd +# configdir: /etc/ipa/ +# piddir: /var/run/dirsrv +# + +# Source function library. +if [ -f /etc/rc.d/init.d/functions ] ; then +. /etc/rc.d/init.d/functions +fi +# Source networking configuration. +if [ -f /etc/sysconfig/network ] ; then +. /etc/sysconfig/network +fi + +# Check that networking is up. +if [ "${NETWORKING}" = "no" ] +then + echo "Networking is down" + exit 0 +fi + +# Lockfile +if [ -d "/var/lock/subsys" ] ; then + lockfile="/var/lock/subsys/dirsrv" +else + lockfile="/var/lock/dirsrv/lock" +fi + +case "$1" in + start|stop|restart|status) + /usr/sbin/ipactl $1 + ;; + condrestart) + [ ! -f $lockfile ] || /usr/sbin/ipactl restart + ;; + *) + echo "Usage: $0 {start|stop|status|restart|condrestart}" + exit 2 +esac |