Re: [Freeipa-devel] [PATCH] 1107 smartproxy cleanup

2014-05-13 Thread Martin Kosek
On 05/08/2014 07:38 PM, Nathaniel McCallum wrote:
 On Thu, 2014-05-08 at 13:36 -0400, Rob Crittenden wrote:
 Nathaniel McCallum wrote:
 On Thu, 2014-05-08 at 09:12 -0400, Rob Crittenden wrote:
 Rob Crittenden wrote:
 Rob Crittenden wrote:
 Remove some unused files, fix an import which means we don't need to
 import from ipaserver, fix up Requires so it should work better running
 on a different box than the IPA server.

 Found and fixed a couple more minor issues.

 Fix one more issue. This sets the ipa client log to /dev/null to
 suppress the error

 ipa: ERROR: Could not create log_dir u'/var/www/.ipa/log'

 What is the purpose of sending the bootstrap logs for smartproxy
 to /dev/null?

 It is all client logs. The smartproxy acts as an IPA client and clients 
 log some things in ~/.ipa/log by default. We don't really want these 
 logs in this case, it's logged anyway, and this suppresses the error by 
 writing things to the bit bucket.

 The other way would be to add an option to not log but that seems like 
 overkill.
 
 That is all that stood out to me. ACK
 
 Nathaniel

Pushed to master: 74412dbf88f78b19a54c35e326e173f5344922d0

Martin

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 1107 smartproxy cleanup

2014-05-08 Thread Rob Crittenden

Rob Crittenden wrote:

Rob Crittenden wrote:

Remove some unused files, fix an import which means we don't need to
import from ipaserver, fix up Requires so it should work better running
on a different box than the IPA server.


Found and fixed a couple more minor issues.


Fix one more issue. This sets the ipa client log to /dev/null to 
suppress the error


ipa: ERROR: Could not create log_dir u'/var/www/.ipa/log'

rob

From 2a58396d802d203dd91ebb88603aa92b25eba1db Mon Sep 17 00:00:00 2001
From: Rob Crittenden rcrit...@redhat.com
Date: Tue, 6 May 2014 15:52:11 -0400
Subject: [PATCH] Clean up Smartproxy support, drop unused code

Drop the logrotate file because Apache manages the logs
Drop the systemd configuration because we run in Apache
Import json_encode_binary from ipalib
Fix Requires
---
 freeipa.spec.in | 16 ++--
 smartproxy/Makefile.am  |  8 
 smartproxy/configure.ac |  2 --
 smartproxy/ipa-smartproxy.logrotate | 11 ---
 smartproxy/ipa-smartproxy.py|  6 ++
 smartproxy/ipa-smartproxy.service   | 12 
 6 files changed, 4 insertions(+), 51 deletions(-)
 delete mode 100644 smartproxy/ipa-smartproxy.logrotate
 delete mode 100644 smartproxy/ipa-smartproxy.service

diff --git a/freeipa.spec.in b/freeipa.spec.in
index 4e3fd7351757be773fae0b02c55549910c5b37ad..68812ee350d645164b02664e4ea51d98c2454a2a 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -81,7 +81,6 @@ BuildRequires:  libunistring-devel
 BuildRequires:  python-lesscpy
 BuildRequires:  python-kerberos
 BuildRequires:  python-cherrypy
-BuildRequires:  python-requests
 
 # Find out Kerberos middle version to infer ABI changes in DAL driver
 # We cannot load DAL driver into KDC with wrong ABI.
@@ -229,8 +228,8 @@ Group: System Environment/Base
 Requires: %{name}-client = %version-%release
 Requires: python-cherrypy
 Requires: gssproxy = 0.3.1
-Requires: python-requests
 Requires: python-kerberos = 1.1-14
+Requires: mod_wsgi
 
 %description server-foreman-smartproxy
 A Foreman-compatible REST API for managing hosts and hostgroups.
@@ -475,7 +474,6 @@ touch %{buildroot}%{_libdir}/krb5/plugins/libkrb5/winbind_krb5_locator.so
 mkdir -p %{buildroot}%{_unitdir}
 install -m 644 init/systemd/ipa.service %{buildroot}%{_unitdir}/ipa.service
 install -m 644 init/systemd/ipa_memcached.service %{buildroot}%{_unitdir}/ipa_memcached.service
-install -m 644 smartproxy/ipa-smartproxy.service %{buildroot}%{_unitdir}/ipa-smartproxy.service
 # END
 mkdir -p %{buildroot}/%{_localstatedir}/lib/ipa/backup
 %endif # ONLY_CLIENT
@@ -532,8 +530,6 @@ if [ $1 = 0 ]; then
 # NOTE: systemd specific section
 /bin/systemctl --quiet stop ipa.service || :
 /bin/systemctl --quiet disable ipa.service || :
-/bin/systemctl --quiet stop ipa-smartproxy.service || :
-/bin/systemctl --quiet disable ipa-smartproxy.service || :
 # END
 fi
 
@@ -570,15 +566,9 @@ if [ $1 -eq 0 ]; then
 %{_sbindir}/update-alternatives --remove winbind_krb5_locator.so /dev/null
 fi
 
-%preun server-foreman-smartproxy
-if [ $1 = 0 ]; then
-/bin/systemctl --quiet disable ipa-smartproxy.service || :
-fi
-
 %post server-foreman-smartproxy
 if [ $1 -gt 1 ] ; then
-/bin/systemctl --system daemon-reload 21 || :
-/bin/systemctl condrestart ipa-smartproxy.service 21 || :
+/bin/systemctl try-restart httpd.service /dev/null 21 || :
 fi
 %endif # ONLY_CLIENT
 
@@ -821,9 +811,7 @@ fi
 %{_usr}/share/ipa/smartproxy/ipa-smartproxy.py*
 %{_mandir}/man1/ipa-smartproxy.1.gz
 %{_mandir}/man5/ipa-smartproxy.conf.5.gz
-%attr(644,root,root) %{_unitdir}/ipa-smartproxy.service
 %config(noreplace) %{_sysconfdir}/ipa/ipa-smartproxy.conf
-%config(noreplace)%{_sysconfdir}/logrotate.d/ipa-smartproxy
 
 %endif # ONLY_CLIENT
 
diff --git a/smartproxy/Makefile.am b/smartproxy/Makefile.am
index f79aecfc303aac12d771170badea1eaf952b7ecf..c0994cc37c9b71552a12981a5e8b42082cca7db4 100644
--- a/smartproxy/Makefile.am
+++ b/smartproxy/Makefile.am
@@ -14,11 +14,6 @@ app_DATA =			\
 	ipa-smartproxy.py	\
 	$(NULL)
 
-rotatedir = $(LOGROTATE_DIR)
-rotate_DATA =			\
-	ipa-smartproxy.logrotate	\
-	$(NULL)
-
 SUBDIRS =			\
 	man			\
 	$(NULL)
@@ -40,6 +35,3 @@ MAINTAINERCLEANFILES =		\
 	missing			\
 	Makefile.in		\
 	$(NULL)
-
-install-data-hook:
-	mv $(DESTDIR)/$(LOGROTATE_DIR)/ipa-smartproxy.logrotate $(DESTDIR)/$(LOGROTATE_DIR)/ipa-smartproxy
diff --git a/smartproxy/configure.ac b/smartproxy/configure.ac
index 5908a7f13bc7d19df4e3086b42a176167b5c2546..76e208cf40c0dac66d9029a96831ec8c7b17853f 100644
--- a/smartproxy/configure.ac
+++ b/smartproxy/configure.ac
@@ -60,10 +60,8 @@ dnl ---
 
 IPA_DATA_DIR=$datadir/ipa
 IPA_SYSCONF_DIR=$sysconfdir/ipa
-LOGROTATE_DIR=$sysconfdir/logrotate.d
 AC_SUBST(IPA_DATA_DIR)
 AC_SUBST(IPA_SYSCONF_DIR)
-AC_SUBST(LOGROTATE_DIR)
 
 # Files
 
diff --git a/smartproxy/ipa-smartproxy.logrotate 

Re: [Freeipa-devel] [PATCH] 1107 smartproxy cleanup

2014-05-08 Thread Nathaniel McCallum
On Thu, 2014-05-08 at 09:12 -0400, Rob Crittenden wrote:
 Rob Crittenden wrote:
  Rob Crittenden wrote:
  Remove some unused files, fix an import which means we don't need to
  import from ipaserver, fix up Requires so it should work better running
  on a different box than the IPA server.
 
  Found and fixed a couple more minor issues.
 
 Fix one more issue. This sets the ipa client log to /dev/null to 
 suppress the error
 
 ipa: ERROR: Could not create log_dir u'/var/www/.ipa/log'

What is the purpose of sending the bootstrap logs for smartproxy
to /dev/null?

Nathaniel

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 1107 smartproxy cleanup

2014-05-08 Thread Rob Crittenden

Nathaniel McCallum wrote:

On Thu, 2014-05-08 at 09:12 -0400, Rob Crittenden wrote:

Rob Crittenden wrote:

Rob Crittenden wrote:

Remove some unused files, fix an import which means we don't need to
import from ipaserver, fix up Requires so it should work better running
on a different box than the IPA server.


Found and fixed a couple more minor issues.


Fix one more issue. This sets the ipa client log to /dev/null to
suppress the error

ipa: ERROR: Could not create log_dir u'/var/www/.ipa/log'


What is the purpose of sending the bootstrap logs for smartproxy
to /dev/null?


It is all client logs. The smartproxy acts as an IPA client and clients 
log some things in ~/.ipa/log by default. We don't really want these 
logs in this case, it's logged anyway, and this suppresses the error by 
writing things to the bit bucket.


The other way would be to add an option to not log but that seems like 
overkill.


rob

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 1107 smartproxy cleanup

2014-05-08 Thread Nathaniel McCallum
On Thu, 2014-05-08 at 13:36 -0400, Rob Crittenden wrote:
 Nathaniel McCallum wrote:
  On Thu, 2014-05-08 at 09:12 -0400, Rob Crittenden wrote:
  Rob Crittenden wrote:
  Rob Crittenden wrote:
  Remove some unused files, fix an import which means we don't need to
  import from ipaserver, fix up Requires so it should work better running
  on a different box than the IPA server.
 
  Found and fixed a couple more minor issues.
 
  Fix one more issue. This sets the ipa client log to /dev/null to
  suppress the error
 
  ipa: ERROR: Could not create log_dir u'/var/www/.ipa/log'
 
  What is the purpose of sending the bootstrap logs for smartproxy
  to /dev/null?
 
 It is all client logs. The smartproxy acts as an IPA client and clients 
 log some things in ~/.ipa/log by default. We don't really want these 
 logs in this case, it's logged anyway, and this suppresses the error by 
 writing things to the bit bucket.
 
 The other way would be to add an option to not log but that seems like 
 overkill.

That is all that stood out to me. ACK

Nathaniel

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 1107 smartproxy cleanup

2014-05-07 Thread Rob Crittenden

Rob Crittenden wrote:

Remove some unused files, fix an import which means we don't need to
import from ipaserver, fix up Requires so it should work better running
on a different box than the IPA server.


Found and fixed a couple more minor issues.

rob

From 9b86400d1a20bf536de01b8693789317f1a1acbe Mon Sep 17 00:00:00 2001
From: Rob Crittenden rcrit...@redhat.com
Date: Tue, 6 May 2014 15:52:11 -0400
Subject: [PATCH] Clean up Smartproxy support, drop unused code

Drop the logrotate file because Apache manages the logs
Drop the systemd configuration because we run in Apache
Import json_encode_binary from ipalib
Fix Requires
---
 freeipa.spec.in | 16 ++--
 smartproxy/Makefile.am  |  8 
 smartproxy/configure.ac |  2 --
 smartproxy/ipa-smartproxy.logrotate | 11 ---
 smartproxy/ipa-smartproxy.py|  4 +---
 smartproxy/ipa-smartproxy.service   | 12 
 6 files changed, 3 insertions(+), 50 deletions(-)
 delete mode 100644 smartproxy/ipa-smartproxy.logrotate
 delete mode 100644 smartproxy/ipa-smartproxy.service

diff --git a/freeipa.spec.in b/freeipa.spec.in
index 4e3fd7351757be773fae0b02c55549910c5b37ad..68812ee350d645164b02664e4ea51d98c2454a2a 100644
--- a/freeipa.spec.in
+++ b/freeipa.spec.in
@@ -81,7 +81,6 @@ BuildRequires:  libunistring-devel
 BuildRequires:  python-lesscpy
 BuildRequires:  python-kerberos
 BuildRequires:  python-cherrypy
-BuildRequires:  python-requests
 
 # Find out Kerberos middle version to infer ABI changes in DAL driver
 # We cannot load DAL driver into KDC with wrong ABI.
@@ -229,8 +228,8 @@ Group: System Environment/Base
 Requires: %{name}-client = %version-%release
 Requires: python-cherrypy
 Requires: gssproxy = 0.3.1
-Requires: python-requests
 Requires: python-kerberos = 1.1-14
+Requires: mod_wsgi
 
 %description server-foreman-smartproxy
 A Foreman-compatible REST API for managing hosts and hostgroups.
@@ -475,7 +474,6 @@ touch %{buildroot}%{_libdir}/krb5/plugins/libkrb5/winbind_krb5_locator.so
 mkdir -p %{buildroot}%{_unitdir}
 install -m 644 init/systemd/ipa.service %{buildroot}%{_unitdir}/ipa.service
 install -m 644 init/systemd/ipa_memcached.service %{buildroot}%{_unitdir}/ipa_memcached.service
-install -m 644 smartproxy/ipa-smartproxy.service %{buildroot}%{_unitdir}/ipa-smartproxy.service
 # END
 mkdir -p %{buildroot}/%{_localstatedir}/lib/ipa/backup
 %endif # ONLY_CLIENT
@@ -532,8 +530,6 @@ if [ $1 = 0 ]; then
 # NOTE: systemd specific section
 /bin/systemctl --quiet stop ipa.service || :
 /bin/systemctl --quiet disable ipa.service || :
-/bin/systemctl --quiet stop ipa-smartproxy.service || :
-/bin/systemctl --quiet disable ipa-smartproxy.service || :
 # END
 fi
 
@@ -570,15 +566,9 @@ if [ $1 -eq 0 ]; then
 %{_sbindir}/update-alternatives --remove winbind_krb5_locator.so /dev/null
 fi
 
-%preun server-foreman-smartproxy
-if [ $1 = 0 ]; then
-/bin/systemctl --quiet disable ipa-smartproxy.service || :
-fi
-
 %post server-foreman-smartproxy
 if [ $1 -gt 1 ] ; then
-/bin/systemctl --system daemon-reload 21 || :
-/bin/systemctl condrestart ipa-smartproxy.service 21 || :
+/bin/systemctl try-restart httpd.service /dev/null 21 || :
 fi
 %endif # ONLY_CLIENT
 
@@ -821,9 +811,7 @@ fi
 %{_usr}/share/ipa/smartproxy/ipa-smartproxy.py*
 %{_mandir}/man1/ipa-smartproxy.1.gz
 %{_mandir}/man5/ipa-smartproxy.conf.5.gz
-%attr(644,root,root) %{_unitdir}/ipa-smartproxy.service
 %config(noreplace) %{_sysconfdir}/ipa/ipa-smartproxy.conf
-%config(noreplace)%{_sysconfdir}/logrotate.d/ipa-smartproxy
 
 %endif # ONLY_CLIENT
 
diff --git a/smartproxy/Makefile.am b/smartproxy/Makefile.am
index f79aecfc303aac12d771170badea1eaf952b7ecf..c0994cc37c9b71552a12981a5e8b42082cca7db4 100644
--- a/smartproxy/Makefile.am
+++ b/smartproxy/Makefile.am
@@ -14,11 +14,6 @@ app_DATA =			\
 	ipa-smartproxy.py	\
 	$(NULL)
 
-rotatedir = $(LOGROTATE_DIR)
-rotate_DATA =			\
-	ipa-smartproxy.logrotate	\
-	$(NULL)
-
 SUBDIRS =			\
 	man			\
 	$(NULL)
@@ -40,6 +35,3 @@ MAINTAINERCLEANFILES =		\
 	missing			\
 	Makefile.in		\
 	$(NULL)
-
-install-data-hook:
-	mv $(DESTDIR)/$(LOGROTATE_DIR)/ipa-smartproxy.logrotate $(DESTDIR)/$(LOGROTATE_DIR)/ipa-smartproxy
diff --git a/smartproxy/configure.ac b/smartproxy/configure.ac
index 5908a7f13bc7d19df4e3086b42a176167b5c2546..76e208cf40c0dac66d9029a96831ec8c7b17853f 100644
--- a/smartproxy/configure.ac
+++ b/smartproxy/configure.ac
@@ -60,10 +60,8 @@ dnl ---
 
 IPA_DATA_DIR=$datadir/ipa
 IPA_SYSCONF_DIR=$sysconfdir/ipa
-LOGROTATE_DIR=$sysconfdir/logrotate.d
 AC_SUBST(IPA_DATA_DIR)
 AC_SUBST(IPA_SYSCONF_DIR)
-AC_SUBST(LOGROTATE_DIR)
 
 # Files
 
diff --git a/smartproxy/ipa-smartproxy.logrotate b/smartproxy/ipa-smartproxy.logrotate
deleted file mode 100644
index 12e25164cd5dea23a219422e20ea07c03a6c9a8e..
--- a/smartproxy/ipa-smartproxy.logrotate
+++