From edewata at redhat.com Sat Oct 1 03:38:22 2011 From: edewata at redhat.com (Endi Sukma Dewata) Date: Fri, 30 Sep 2011 22:38:22 -0500 Subject: [Freeipa-devel] [PATCH] 285 Added confirmation when adding multiple entries. In-Reply-To: <4E8256AA.3040507@redhat.com> References: <4E823994.7020604@redhat.com> <4E8256AA.3040507@redhat.com> Message-ID: <4E868B2E.7060604@redhat.com> On 9/27/2011 6:05 PM, Endi Sukma Dewata wrote: > On 9/27/2011 4:01 PM, Endi Sukma Dewata wrote: >> The adder dialog has been modified to show a confirmation message >> after each successful addition. >> >> Ticket #1786 > > Rebased on top of 286 (because 286 needs to go to ipa-2-1 branch). Rebased on top of 292. -- Endi S. Dewata -------------- next part -------------- A non-text attachment was scrubbed... Name: freeipa-edewata-0285-3-Added-confirmation-when-adding-multiple-entries.patch Type: text/x-patch Size: 10920 bytes Desc: not available URL: From edewata at redhat.com Sat Oct 1 03:42:17 2011 From: edewata at redhat.com (Endi Sukma Dewata) Date: Fri, 30 Sep 2011 22:42:17 -0500 Subject: [Freeipa-devel] [PATCH] 293 Added selectable labels for radio buttons. Message-ID: <4E868C19.6040001@redhat.com> The radio buttons in association facet and radio widget are now linked to their labels so that they can be selected by clicking the labels. Ticket #1782 -- Endi S. Dewata -------------- next part -------------- A non-text attachment was scrubbed... Name: freeipa-edewata-0293-Added-selectable-labels-for-radio-buttons.patch Type: text/x-patch Size: 3602 bytes Desc: not available URL: From jcholast at redhat.com Sat Oct 1 17:45:27 2011 From: jcholast at redhat.com (Jan Cholasta) Date: Sat, 01 Oct 2011 19:45:27 +0200 Subject: [Freeipa-devel] [PATCH] 129 migrate process cannot handle multivalued pkey attribute In-Reply-To: <1317290498.13820.5.camel@dhcp-25-52.brq.redhat.com> References: <1317290498.13820.5.camel@dhcp-25-52.brq.redhat.com> Message-ID: <4E8751B7.9090408@redhat.com> On 29.9.2011 12:01, Martin Kosek wrote: > When group/user is migrated, the attribute used for RDN may be > multivalued. Make sure that we pick the value used in the RDN > which should be the unique one and not just the first one. > > https://fedorahosted.org/freeipa/ticket/1892 > Every time you do "import *", god kills a kitten. Also, it pollutes the module namespace with unnecessary symbols and decreases code readability. I'm a bit puzzled why do you do this: + try: + pkey = dn[ldap_obj.primary_key.name].lower() + except KeyError: + failed[ldap_obj_name][str(dn)] = unicode(_rdn_err_msg) + continue and not just this: + pkey = ava.value.lower() Besides that, the issue seems to be fixed. Honza -- Jan Cholasta From pvoborni at redhat.com Mon Oct 3 07:48:40 2011 From: pvoborni at redhat.com (Petr Vobornik) Date: Mon, 03 Oct 2011 09:48:40 +0200 Subject: [Freeipa-devel] [PATCH] 291 I18n clean-up. In-Reply-To: <4E863E18.1040803@redhat.com> References: <4E863E18.1040803@redhat.com> Message-ID: <4E8968D8.8030708@redhat.com> On 10/01/2011 12:09 AM, Endi Sukma Dewata wrote: > The hard-coded 'undo' and 'undo all' labels have been moved into > internal.py to allow translation. > > Ticket #1897 ACK -- Petr Vobornik From mkosek at redhat.com Mon Oct 3 07:54:49 2011 From: mkosek at redhat.com (Martin Kosek) Date: Mon, 03 Oct 2011 09:54:49 +0200 Subject: [Freeipa-devel] [PATCH] 129 migrate process cannot handle multivalued pkey attribute In-Reply-To: <4E8751B7.9090408@redhat.com> References: <1317290498.13820.5.camel@dhcp-25-52.brq.redhat.com> <4E8751B7.9090408@redhat.com> Message-ID: <1317628491.5905.13.camel@dhcp-25-52.brq.redhat.com> On Sat, 2011-10-01 at 19:45 +0200, Jan Cholasta wrote: > On 29.9.2011 12:01, Martin Kosek wrote: > > When group/user is migrated, the attribute used for RDN may be > > multivalued. Make sure that we pick the value used in the RDN > > which should be the unique one and not just the first one. > > > > https://fedorahosted.org/freeipa/ticket/1892 > > > > Every time you do "import *", god kills a kitten. Also, it pollutes the > module namespace with unnecessary symbols and decreases code readability. World is not just black and white. In this case I think its OK since ipalib/dn.py has a nice maintained __all__ list with all 3 DN related classes. Thus. I see no namespace pollution. > > I'm a bit puzzled why do you do this: > + try: > + pkey = dn[ldap_obj.primary_key.name].lower() > + except KeyError: > + failed[ldap_obj_name][str(dn)] = > unicode(_rdn_err_msg) > + continue > > and not just this: > + pkey = ava.value.lower() Good point. Updated patch attached. Martin > > Besides that, the issue seems to be fixed. > > Honza > -------------- next part -------------- A non-text attachment was scrubbed... Name: freeipa-mkosek-129-2-migrate-process-cannot-handle-multivalued-pkey-attri.patch Type: text/x-patch Size: 2517 bytes Desc: not available URL: From jcholast at redhat.com Mon Oct 3 08:10:25 2011 From: jcholast at redhat.com (Jan Cholasta) Date: Mon, 03 Oct 2011 10:10:25 +0200 Subject: [Freeipa-devel] [PATCH] 129 migrate process cannot handle multivalued pkey attribute In-Reply-To: <1317628491.5905.13.camel@dhcp-25-52.brq.redhat.com> References: <1317290498.13820.5.camel@dhcp-25-52.brq.redhat.com> <4E8751B7.9090408@redhat.com> <1317628491.5905.13.camel@dhcp-25-52.brq.redhat.com> Message-ID: <4E896DF1.7050300@redhat.com> On 3.10.2011 09:54, Martin Kosek wrote: > On Sat, 2011-10-01 at 19:45 +0200, Jan Cholasta wrote: >> On 29.9.2011 12:01, Martin Kosek wrote: >>> When group/user is migrated, the attribute used for RDN may be >>> multivalued. Make sure that we pick the value used in the RDN >>> which should be the unique one and not just the first one. >>> >>> https://fedorahosted.org/freeipa/ticket/1892 >>> >> >> Every time you do "import *", god kills a kitten. Also, it pollutes the >> module namespace with unnecessary symbols and decreases code readability. > > World is not just black and white. In this case I think its OK since > ipalib/dn.py has a nice maintained __all__ list with all 3 DN related > classes. Thus. I see no namespace pollution. IMO it still somewhat decreases code readability. But, whatever, it's no showstopper. > >> >> I'm a bit puzzled why do you do this: >> + try: >> + pkey = dn[ldap_obj.primary_key.name].lower() >> + except KeyError: >> + failed[ldap_obj_name][str(dn)] = >> unicode(_rdn_err_msg) >> + continue >> >> and not just this: >> + pkey = ava.value.lower() > > Good point. Updated patch attached. > > Martin > >> >> Besides that, the issue seems to be fixed. >> >> Honza >> > ACK. Honza -- Jan Cholasta From pvoborni at redhat.com Mon Oct 3 08:33:32 2011 From: pvoborni at redhat.com (Petr Vobornik) Date: Mon, 03 Oct 2011 10:33:32 +0200 Subject: [Freeipa-devel] [PATCH] 292 Disable sudo options Delete button if nothing selected. In-Reply-To: <4E863E60.1070401@redhat.com> References: <4E863E60.1070401@redhat.com> Message-ID: <4E89735C.8010407@redhat.com> On 10/01/2011 12:10 AM, Endi Sukma Dewata wrote: > The Delete button for sudo options in sudo rule details page now > will only work if there is at least one row selected. > > Ticket #1896 ACK -- Petr Vobornik From mkosek at redhat.com Mon Oct 3 08:49:31 2011 From: mkosek at redhat.com (Martin Kosek) Date: Mon, 03 Oct 2011 10:49:31 +0200 Subject: [Freeipa-devel] [PATCH] 129 migrate process cannot handle multivalued pkey attribute In-Reply-To: <4E896DF1.7050300@redhat.com> References: <1317290498.13820.5.camel@dhcp-25-52.brq.redhat.com> <4E8751B7.9090408@redhat.com> <1317628491.5905.13.camel@dhcp-25-52.brq.redhat.com> <4E896DF1.7050300@redhat.com> Message-ID: <1317631773.5905.36.camel@dhcp-25-52.brq.redhat.com> On Mon, 2011-10-03 at 10:10 +0200, Jan Cholasta wrote: > On 3.10.2011 09:54, Martin Kosek wrote: > > On Sat, 2011-10-01 at 19:45 +0200, Jan Cholasta wrote: > >> On 29.9.2011 12:01, Martin Kosek wrote: > >>> When group/user is migrated, the attribute used for RDN may be > >>> multivalued. Make sure that we pick the value used in the RDN > >>> which should be the unique one and not just the first one. > >>> > >>> https://fedorahosted.org/freeipa/ticket/1892 > >>> > >> > >> Every time you do "import *", god kills a kitten. Also, it pollutes the > >> module namespace with unnecessary symbols and decreases code readability. > > > > World is not just black and white. In this case I think its OK since > > ipalib/dn.py has a nice maintained __all__ list with all 3 DN related > > classes. Thus. I see no namespace pollution. > > IMO it still somewhat decreases code readability. But, whatever, it's no > showstopper. > > > > >> > >> I'm a bit puzzled why do you do this: > >> + try: > >> + pkey = dn[ldap_obj.primary_key.name].lower() > >> + except KeyError: > >> + failed[ldap_obj_name][str(dn)] = > >> unicode(_rdn_err_msg) > >> + continue > >> > >> and not just this: > >> + pkey = ava.value.lower() > > > > Good point. Updated patch attached. > > > > Martin > > > >> > >> Besides that, the issue seems to be fixed. > >> > >> Honza > >> > > > > ACK. > > Honza > Pushed to master, ipa-2-1. Martin From mkosek at redhat.com Mon Oct 3 10:36:47 2011 From: mkosek at redhat.com (Martin Kosek) Date: Mon, 03 Oct 2011 12:36:47 +0200 Subject: [Freeipa-devel] [PATCH] 133 Be more clear about selfsign option Message-ID: <1317638208.5905.37.camel@dhcp-25-52.brq.redhat.com> Installing IPA server --selfsign option is currently a one-way ticket to server with limited certificate capabilities. Make sure that user really want to install it by implementing the following steps: - moving the option to the bottom of certificate options section - adding a warning to ipa-server-install man page - adding a warning to ipa-server-install help - adding a warning to ipa-server-install configuration summary when one runs ipa-server-install https://fedorahosted.org/freeipa/ticket/1908 -------------- next part -------------- A non-text attachment was scrubbed... Name: freeipa-mkosek-133-be-more-clear-about-selfsign-option.patch Type: text/x-patch Size: 4033 bytes Desc: not available URL: From mkosek at redhat.com Mon Oct 3 13:18:47 2011 From: mkosek at redhat.com (Martin Kosek) Date: Mon, 03 Oct 2011 15:18:47 +0200 Subject: [Freeipa-devel] [PATCH] 291 I18n clean-up. In-Reply-To: <4E8968D8.8030708@redhat.com> References: <4E863E18.1040803@redhat.com> <4E8968D8.8030708@redhat.com> Message-ID: <1317647929.5905.39.camel@dhcp-25-52.brq.redhat.com> On Mon, 2011-10-03 at 09:48 +0200, Petr Vobornik wrote: > On 10/01/2011 12:09 AM, Endi Sukma Dewata wrote: > > The hard-coded 'undo' and 'undo all' labels have been moved into > > internal.py to allow translation. > > > > Ticket #1897 > > ACK > Pushed to master, ipa-2-1. Martin From mkosek at redhat.com Mon Oct 3 13:19:19 2011 From: mkosek at redhat.com (Martin Kosek) Date: Mon, 03 Oct 2011 15:19:19 +0200 Subject: [Freeipa-devel] [PATCH] 292 Disable sudo options Delete button if nothing selected. In-Reply-To: <4E89735C.8010407@redhat.com> References: <4E863E60.1070401@redhat.com> <4E89735C.8010407@redhat.com> Message-ID: <1317647961.5905.40.camel@dhcp-25-52.brq.redhat.com> On Mon, 2011-10-03 at 10:33 +0200, Petr Vobornik wrote: > On 10/01/2011 12:10 AM, Endi Sukma Dewata wrote: > > The Delete button for sudo options in sudo rule details page now > > will only work if there is at least one row selected. > > > > Ticket #1896 > > ACK > Pushed to master, ipa-2-1. Martin From abokovoy at redhat.com Mon Oct 3 13:44:23 2011 From: abokovoy at redhat.com (Alexander Bokovoy) Date: Mon, 3 Oct 2011 16:44:23 +0300 Subject: [Freeipa-devel] Fedora 16 support (systemd) Message-ID: <20111003134422.GA7270@redhat.com> Hi, I was working for a month on systemd support for FreeIPA and now there is something you may try -- http://koji.fedoraproject.org/koji/taskinfo?taskID=3399157 Provided you have Fedora 16 + updates-testing install, provided that you get FreeIPA packages from the Koji task above, FreeIPA can be installed and configured on Fedora 16. Note that systemd support *will not work* for anything before Fedora 16 + current updates-testing as it requires very recent systemd version (at least 36-3 build in F16) and depends on very recent dogtag, 389ds, and tomcat6 packages. Attached is also current patch to introduce systemd/fedora16 support. The patch is against ipa-2-1 branch, I have not checked how it applies to master yet. -- / Alexander Bokovoy -------------- next part -------------- diff --git a/Makefile b/Makefile index 9d88025..3cd08e2 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ PRJ_PREFIX=freeipa RPMBUILD ?= $(PWD)/rpmbuild TARGET ?= master -SUPPORTED_PLATFORM=redhat +SUPPORTED_PLATFORM ?= redhat # After updating the version in VERSION you should run the version-update # target. diff --git a/freeipa.spec.in b/freeipa.spec.in index 8ebe189..2458eaa 100644 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -28,6 +28,9 @@ BuildRequires: 389-ds-base-devel >= 1.2.9 BuildRequires: svrcore-devel BuildRequires: /usr/share/selinux/devel/Makefile BuildRequires: policycoreutils >= %{POLICYCOREUTILSVER} +%if 0%{?fedora} >= 16 +BuildRequires: systemd-units +%endif %endif BuildRequires: nspr-devel BuildRequires: nss-devel @@ -89,7 +92,11 @@ Requires(pre): 389-ds-base >= 1.2.9.7-1 Requires: openldap-clients Requires: nss Requires: nss-tools +%if 0%{?fedora} >= 16 +Requires: krb5-server >= 1.9.1-15 +%else Requires: krb5-server +%endif Requires: krb5-server-ldap Requires: krb5-pkinit-openssl Requires: cyrus-sasl-gssapi%{?_isa} @@ -102,6 +109,11 @@ Requires: python-ldap Requires: python-krbV Requires: acl Requires: python-pyasn1 >= 0.0.9a +%if 0%{?fedora} >= 16 +Requires: systemd-units >= 36-3 +Requires(pre): systemd-units +Requires(post): systemd-units +%endif %if 0%{?fedora} >= 15 Requires: selinux-policy >= 3.9.16-18 %else @@ -109,6 +121,12 @@ Requires: selinux-policy >= 3.9.7-27 %endif Requires(post): selinux-policy-base Requires: slapi-nis >= 0.21 +%if 0%{?fedora} >= 16 +Requires: pki-ca >= 9.0.14-1 +Requires: pki-silent >= 9.0.14-1 +# Only tomcat6 greater than this version provides proper systemd support +Requires: tomcat6 >= 6.0.32-17 +%else %if 0%{?fedora} >= 15 Requires: pki-ca >= 9.0.12 Requires: pki-silent >= 9.0.12 @@ -116,13 +134,19 @@ Requires: pki-silent >= 9.0.12 Requires: pki-ca >= 9.0.5 Requires: pki-silent >= 9.0.5 %endif +%endif Requires: dogtag-pki-common-theme Requires: dogtag-pki-ca-theme %if 0%{?rhel} Requires: subscription-manager %endif +%if 0%{?fedora} >= 16 +Requires(preun): python systemd-units +Requires(postun): python systemd-units +%else Requires(preun): python initscripts chkconfig Requires(postun): python initscripts chkconfig +%endif # We have a soft-requires on bind. It is an optional part of # IPA but if it is configured we need a way to require versions @@ -251,6 +275,9 @@ package. %build export CFLAGS="$CFLAGS %{optflags}" export CPPFLAGS="$CPPFLAGS %{optflags}" +%if 0%{?fedora} >= 16 +export SUPPORTED_PLATFORM=fedora16 +%endif make version-update cd ipa-client; ../autogen.sh --prefix=%{_usr} --sysconfdir=%{_sysconfdir} --localstatedir=%{_localstatedir} --libdir=%{_libdir} --mandir=%{_mandir}; cd .. %if ! %{ONLY_CLIENT} @@ -312,7 +339,16 @@ mkdir -p %{buildroot}%{_sysconfdir}/httpd/conf.d/ /bin/touch %{buildroot}%{_sysconfdir}/httpd/conf.d/ipa.conf /bin/touch %{buildroot}%{_sysconfdir}/httpd/conf.d/ipa-pki-proxy.conf /bin/touch %{buildroot}%{_sysconfdir}/httpd/conf.d/ipa-rewrite.conf -install -m755 ipa.init %{buildroot}%{_initrddir}/ipa +%if 0%{?fedora} >= 16 +# Default to systemd initscripts for F16 and above +mkdir -p %{buildroot}%{_unitdir} +for i in ipa.service ipa_kpasswd.service ; do + install -m 644 init/systemd/$i %{buildroot}%{_unitdir}/$i +done +rm -f %{buildroot}%{_initrddir}/ipa_kpasswd +%else +install -m755 init/SystemV/ipa.init %{buildroot}%{_initrddir}/ipa +%endif %endif mkdir -p %{buildroot}%{_sysconfdir}/ipa/ @@ -332,8 +368,14 @@ rm -rf %{buildroot} %if ! %{ONLY_CLIENT} %post server if [ $1 = 1 ]; then +%if 0%{?fedora} >= 16 +# Use systemd scheme + /bin/systemctl --system daemon-reload 2>&1 || : +%else +# Use SystemV scheme only before F16 /sbin/chkconfig --add ipa /sbin/chkconfig --add ipa_kpasswd +%endif fi if [ $1 -gt 1 ] ; then /usr/sbin/ipa-upgradeconfig || : @@ -342,14 +384,28 @@ fi %preun server if [ $1 = 0 ]; then +%if 0%{?fedora} >= 16 +# Use systemd scheme + /bin/systemctl --quiet stop ipa.service || : + /bin/systemctl --quiet disable ipa.service || : +%else +# Use SystemV scheme only before F16 /sbin/chkconfig --del ipa /sbin/chkconfig --del ipa_kpasswd /sbin/service ipa stop >/dev/null 2>&1 || : +%endif fi %postun server if [ "$1" -ge "1" ]; then +%if 0%{?fedora} >= 16 +# Use systemd scheme + /bin/systemctl --quiet is-active ipa.service >/dev/null && \ + /bin/systemctl try-restart ipa.service >/dev/null 2>&1 || : +%else +# Use SystemV scheme only before F16 /sbin/service ipa condrestart >/dev/null 2>&1 || : +%endif fi %pre server-selinux @@ -418,8 +474,15 @@ fi %{_sbindir}/ipa-upgradeconfig %{_sbindir}/ipa-compliance %{_sysconfdir}/cron.d/ipa-compliance +%if 0%{?fedora} >= 16 +# Use systemd scheme +%attr(644,root,root) %{_unitdir}/ipa.service +%attr(644,root,root) %{_unitdir}/ipa_kpasswd.service +%else +# Use SystemV scheme only before F16 %attr(755,root,root) %{_initrddir}/ipa %attr(755,root,root) %{_initrddir}/ipa_kpasswd +%endif %dir %{python_sitelib}/ipaserver %{python_sitelib}/ipaserver/* %dir %{_usr}/share/ipa @@ -550,6 +613,9 @@ fi %ghost %attr(0644,root,apache) %config(noreplace) %{_sysconfdir}/ipa/default.conf %changelog +* Mon Oct 3 2011 Alexander Bokovoy - 2.1.1-2 +- Default to systemd for Fedora 16 and onwards + * Mon Sep 12 2011 Alexander Bokovoy - 2.1.1-1 - Make sure platform adaptation is packaged in -python sub-package diff --git a/init/SystemV/ipa.init b/init/SystemV/ipa.init new file mode 100644 index 0000000..ead7df0 --- /dev/null +++ b/init/SystemV/ipa.init @@ -0,0 +1,40 @@ +#!/bin/sh +# +# ipa This starts and stops ipa controlled daemons +# +# chkconfig: - 21 79 +# description: IPA Server +# configdir: /etc/ipa/ +# + +export SYSTEMCTL_SKIP_REDIRECT=1 + +# 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 + +case "$1" in + start|stop|restart|status) + /usr/sbin/ipactl $1 + ;; + condrestart) + /sbin/service dirsrv status + RETVAL=$? + [ $RETVAL = 0 ] && /usr/sbin/ipactl restart + ;; + *) + echo "Usage: $0 {start|stop|status|restart|condrestart}" + exit 2 +esac diff --git a/init/systemd/ipa.service b/init/systemd/ipa.service new file mode 100644 index 0000000..ba27d1d --- /dev/null +++ b/init/systemd/ipa.service @@ -0,0 +1,14 @@ +[Unit] +Description=Identity, Policy, Audit +Requires=syslog.target network.target +After=syslog.target network.target + +[Service] +Type=oneshot +ExecStart=/usr/sbin/ipactl start +ExecStop=/usr/sbin/ipactl stop +RemainAfterExit=yes +TimeoutSec=0 + +[Install] +WantedBy=multi-user.target diff --git a/init/systemd/ipa_kpasswd.service b/init/systemd/ipa_kpasswd.service new file mode 100644 index 0000000..17aa463 --- /dev/null +++ b/init/systemd/ipa_kpasswd.service @@ -0,0 +1,10 @@ +[Unit] +Description=IPA Kerberos password service +Requires=krb5kdc.service +Wants=krb5kdc.service + +[Service] +Type=forking +PIDFile=/var/run/ipa_kpasswd.pid +ExecStart=/usr/sbin/ipa_kpasswd + diff --git a/install/tools/ipactl b/install/tools/ipactl index 4055cf9..13e4b00 100755 --- a/install/tools/ipactl +++ b/install/tools/ipactl @@ -24,7 +24,7 @@ try: from ipaserver.install import service from ipapython import services as ipaservices from ipaserver.install.dsinstance import config_dirname, realm_to_serverid - from ipaserver.install.installutils import is_ipa_configured + from ipaserver.install.installutils import is_ipa_configured, wait_for_open_ports, wait_for_open_socket from ipapython import sysrestore from ipapython import config from ipalib import api, errors @@ -32,6 +32,7 @@ try: import logging import ldap import ldap.sasl + import ldapurl import socket except ImportError: print >> sys.stderr, """\ @@ -117,6 +118,15 @@ def get_config(): attrs = ['cn', 'ipaConfigString'] try: + # systemd services are so fast that we come here before + # Directory Server actually starts listening. Wait for + # the socket/port be really available. + lurl = ldapurl.LDAPUrl(api.env.ldap_uri) + if lurl.urlscheme == 'ldapi': + wait_for_open_socket(lurl.hostport, timeout=6) + else: + (host,port) = lurl.hostport.split(':') + wait_for_open_ports(host, [port], timeout=6) con = ldap.initialize(api.env.ldap_uri) con.sasl_interactive_bind_s('', SASL_EXTERNAL) res = con.search_st(base, diff --git a/ipa.init b/ipa.init deleted file mode 100755 index ead7df0..0000000 --- a/ipa.init +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# -# ipa This starts and stops ipa controlled daemons -# -# chkconfig: - 21 79 -# description: IPA Server -# configdir: /etc/ipa/ -# - -export SYSTEMCTL_SKIP_REDIRECT=1 - -# 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 - -case "$1" in - start|stop|restart|status) - /usr/sbin/ipactl $1 - ;; - condrestart) - /sbin/service dirsrv status - RETVAL=$? - [ $RETVAL = 0 ] && /usr/sbin/ipactl restart - ;; - *) - echo "Usage: $0 {start|stop|status|restart|condrestart}" - exit 2 -esac diff --git a/ipapython/config.py b/ipapython/config.py index 051e39f..4e0fb11 100644 --- a/ipapython/config.py +++ b/ipapython/config.py @@ -178,7 +178,7 @@ def __discover_config(discover_server = True): if not config.default_domain: #try once with REALM -> domain - dom_name = config.default_realm.lower() + dom_name = config.default_realm.lower() #pylint: disable=E1103 name = "_ldap._tcp."+dom_name+"." rs = ipapython.dnsclient.query(name, ipapython.dnsclient.DNS_C_IN, ipapython.dnsclient.DNS_T_SRV) rl = len(rs) diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py index cfc979e..52ff9e2 100644 --- a/ipapython/ipautil.py +++ b/ipapython/ipautil.py @@ -1163,3 +1163,93 @@ def get_ipa_basedn(conn): return None +def config_replace_variables(filepath, replacevars=dict(), appendvars=dict()): + """ + Take a key=value based configuration file, and write new version + with certain values replaced or appended + + All (key,value) pairs from replacevars and appendvars that were not found + in the configuration file, will be added there. + + It is responsibility of a caller to ensure that replacevars and + appendvars do not overlap. + + It is responsibility of a caller to back up file. + + returns dictionary of affected keys and their previous values + + One have to run restore_context(filepath) afterwards or + security context of the file will not be correct after modification + """ + pattern = re.compile(''' +(^ + \s* + (?P