Changes to 'refs/tags/spacewalk-web-2.1.23-1'
by Tomáš Kašpárek
Tag 'spacewalk-web-2.1.23-1' created by Tomas Kasparek <tkasparek(a)redhat.com> at 2013-10-07 07:47 +0000
Tagging package [spacewalk-web] version [2.1.23-1] in directory [web/].
Changes since spacewalk-setup-2.1.6-1:
Tomas Kasparek (3):
Revert "removing Perl code associated with reboot system page"
Revert "removing Perl reboot system page"
Automatic commit of package [spacewalk-web] release [2.1.23-1].
---
rel-eng/packages/spacewalk-web | 2 -
web/html/network/systems/details/reboot_confirm.pxt | 39 ++++++++++++++++++++
web/modules/sniglets/Sniglets/Servers.pm | 27 +++++++++++++
web/spacewalk-web.spec | 6 ++-
4 files changed, 72 insertions(+), 2 deletions(-)
---
10 years, 6 months
rel-eng/packages web/spacewalk-web.spec
by Tomáš Kašpárek
rel-eng/packages/spacewalk-web | 2 +-
web/spacewalk-web.spec | 6 +++++-
2 files changed, 6 insertions(+), 2 deletions(-)
New commits:
commit ca83576b11c64af686b1687123ae0c0bffe28a60
Author: Tomas Kasparek <tkasparek(a)redhat.com>
Date: Mon Oct 7 09:47:45 2013 +0200
Automatic commit of package [spacewalk-web] release [2.1.23-1].
diff --git a/rel-eng/packages/spacewalk-web b/rel-eng/packages/spacewalk-web
index c478bea..dce5e38 100644
--- a/rel-eng/packages/spacewalk-web
+++ b/rel-eng/packages/spacewalk-web
@@ -1 +1 @@
-2.1.22-1 web/
+2.1.23-1 web/
diff --git a/web/spacewalk-web.spec b/web/spacewalk-web.spec
index a3121f1..5961f9c 100644
--- a/web/spacewalk-web.spec
+++ b/web/spacewalk-web.spec
@@ -4,7 +4,7 @@ Name: spacewalk-web
Summary: Spacewalk Web site - Perl modules
Group: Applications/Internet
License: GPLv2
-Version: 2.1.22
+Version: 2.1.23
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk/
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -272,6 +272,10 @@ rm -rf $RPM_BUILD_ROOT
# $Id$
%changelog
+* Mon Oct 07 2013 Tomas Kasparek <tkasparek(a)redhat.com> 2.1.23-1
+- Revert "removing Perl reboot system page"
+- Revert "removing Perl code associated with reboot system page"
+
* Tue Oct 01 2013 Michael Mraka <michael.mraka(a)redhat.com> 2.1.22-1
- 1013629 - clean up old help links
10 years, 6 months
2 commits - web/html web/modules
by Tomáš Kašpárek
web/html/network/systems/details/reboot_confirm.pxt | 39 ++++++++++++++++++++
web/modules/sniglets/Sniglets/Servers.pm | 27 +++++++++++++
2 files changed, 66 insertions(+)
New commits:
commit 58509da1827988432eccd90064a1d6e63c0cd531
Author: Tomas Kasparek <tkasparek(a)redhat.com>
Date: Mon Oct 7 09:31:26 2013 +0200
Revert "removing Perl reboot system page"
This reverts commit 76f8d2125a17b30ce893faca3c24b1ef477f378c.
diff --git a/web/html/network/systems/details/reboot_confirm.pxt b/web/html/network/systems/details/reboot_confirm.pxt
new file mode 100644
index 0000000..898ff1f
--- /dev/null
+++ b/web/html/network/systems/details/reboot_confirm.pxt
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf8"?>
+<pxt-passthrough>
+
+<pxt-use class="Grail::Frame" />
+<pxt-use class="Sniglets::Servers" />
+<pxt-use class="Sniglets::Sets" />
+<pxt-use class="Sniglets::HTML" />
+<pxt-use class="Sniglets::ServerActions" />
+
+
+<grail-canvas-template base="/templates/c.pxt" mode="main_canvas">
+<pxt-formvar>
+ <pxt-include-late file="/network/components/systems/system_details_toolbar.pxi" />
+</pxt-formvar>
+
+ <rhn-navi-nav prefix="system_details" file="/nav/system_detail.xml" style="contentnav" />
+
+<pxt-include-late file="/network/components/message_queues/local.pxi" />
+
+<rhn-up2date-at-least version="2.9.3" release="2.2.1AS">
+
+<h2>System Reboot Confirmation</h2>
+
+<p>This will schedule a reboot of this system.</p>
+
+
+<pxt-form method="post">
+<p>If you are <strong>certain</strong> you wish to do this, you may schedule the reboot to take place as soon as possible, or no earlier than a specified time:</p>
+
+<rhn-schedule-action-interface action="schedule_errata_updates" callback="rhn:reboot_server_cb" label="Schedule Reboot" />
+
+<pxt-hidden name="sid" />
+
+</pxt-form>
+
+</rhn-up2date-at-least>
+
+</grail-canvas-template>
+</pxt-passthrough>
commit 2e61832fd9363a9c0c01e64ec38c07fc147405b2
Author: Tomas Kasparek <tkasparek(a)redhat.com>
Date: Mon Oct 7 09:31:18 2013 +0200
Revert "removing Perl code associated with reboot system page"
This reverts commit 09cd32cbfa33bfcade4364bc3c0eee053844ee33.
diff --git a/web/modules/sniglets/Sniglets/Servers.pm b/web/modules/sniglets/Sniglets/Servers.pm
index 2b5bc13..1f3482c 100644
--- a/web/modules/sniglets/Sniglets/Servers.pm
+++ b/web/modules/sniglets/Sniglets/Servers.pm
@@ -72,6 +72,8 @@ sub register_callbacks {
my $class = shift;
my $pxt = shift;
+ $pxt->register_callback('rhn:reboot_server_cb' => \&reboot_server_cb);
+
$pxt->register_callback('rhn:server_prefs_form_cb' => \&server_prefs_form_cb);
$pxt->register_callback('rhn:ssm_change_system_prefs_cb' => \&ssm_change_system_prefs_cb);
@@ -343,6 +345,31 @@ sub server_history_event_details {
return $params{__block__};
}
+sub reboot_server_cb {
+ my $pxt = shift;
+ my $sid = $pxt->param('sid');
+ die "no server id" unless $sid;
+
+ my $server = RHN::Server->lookup(-id => $sid);
+ die "no server obj" unless $server;
+
+ my $earliest_date = Sniglets::ServerActions->parse_date_pickbox($pxt);
+ my $action_id = RHN::Scheduler->schedule_reboot(-org_id => $pxt->user->org_id,
+ -user_id => $pxt->user->id,
+ -earliest => $earliest_date,
+ -server_id => $sid);
+
+
+ my $pretty_earliest_date = $pxt->user->convert_time($earliest_date);
+ warn("asdfasdfasdf");
+# my $message = sprintf(<<EOM, $server->name, $server->name, $action_id);
+#Reboot scheduled for system <strong>%s</strong> for $pretty_earliest_date. To cancel the reboot, remove <strong>%s</strong> from <a href="/rhn/schedule/InProgressSystems.do?aid=%d"><strong>the list of systems to be rebooted</strong></a>.
+#EOM
+#
+# $pxt->push_message(site_info => $message);
+ $pxt->redirect("/rhn/systems/details/Overview.do?sid=$sid&message=system.reboot.scheduled&messagep1=" . $server->name . "&messagep2=" . $pretty_earliest_date . "&messagep3=" . $action_id);
+}
+
my @user_server_prefs = ( { name => 'receive_notifications',
label => 'Receive Notifications of Updates/Errata' },
{ name => 'include_in_daily_summary',
10 years, 6 months
Changes to 'refs/tags/spacewalk-setup-2.1.6-1'
by Tomáš Kašpárek
Tag 'spacewalk-setup-2.1.6-1' created by Tomas Kasparek <tkasparek(a)redhat.com> at 2013-10-07 06:33 +0000
Tagging package [spacewalk-setup] version [2.1.6-1] in directory [spacewalk/setup/].
Changes since rhncfg-5.10.64-1:
Tomas Kasparek (2):
setting up configuration for editarea for apache >= 2.4
Automatic commit of package [spacewalk-setup] release [2.1.6-1].
---
rel-eng/packages/spacewalk-setup | 2 +-
spacewalk/setup/bin/spacewalk-setup | 12 ++++++++++++
spacewalk/setup/share/editarea.conf.1 | 7 +++++++
spacewalk/setup/spacewalk-setup.spec | 6 +++++-
4 files changed, 25 insertions(+), 2 deletions(-)
---
10 years, 6 months
rel-eng/packages spacewalk/setup
by Tomáš Kašpárek
rel-eng/packages/spacewalk-setup | 2 +-
spacewalk/setup/spacewalk-setup.spec | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 77b531f2f8f0d0a2f83fe4f6e40701e275288394
Author: Tomas Kasparek <tkasparek(a)redhat.com>
Date: Mon Oct 7 08:33:04 2013 +0200
Automatic commit of package [spacewalk-setup] release [2.1.6-1].
diff --git a/rel-eng/packages/spacewalk-setup b/rel-eng/packages/spacewalk-setup
index 059e679..c8f3d4d 100644
--- a/rel-eng/packages/spacewalk-setup
+++ b/rel-eng/packages/spacewalk-setup
@@ -1 +1 @@
-2.1.5-1 spacewalk/setup/
+2.1.6-1 spacewalk/setup/
diff --git a/spacewalk/setup/spacewalk-setup.spec b/spacewalk/setup/spacewalk-setup.spec
index 2b8e4c5..40ca911 100644
--- a/spacewalk/setup/spacewalk-setup.spec
+++ b/spacewalk/setup/spacewalk-setup.spec
@@ -1,7 +1,7 @@
%{!?fedora: %global sbinpath /sbin}%{?fedora: %global sbinpath %{_sbindir}}
Name: spacewalk-setup
-Version: 2.1.5
+Version: 2.1.6
Release: 1%{?dist}
Summary: Initial setup tools for Red Hat Spacewalk
@@ -103,6 +103,9 @@ rm -rf %{buildroot}
%doc LICENSE
%changelog
+* Mon Oct 07 2013 Tomas Kasparek <tkasparek(a)redhat.com> 2.1.6-1
+- setting up configuration for editarea for apache >= 2.4
+
* Tue Sep 17 2013 Michael Mraka <michael.mraka(a)redhat.com> 2.1.5-1
- Grammar error occurred
10 years, 6 months
spacewalk/setup
by Tomáš Kašpárek
spacewalk/setup/bin/spacewalk-setup | 12 ++++++++++++
spacewalk/setup/share/editarea.conf.1 | 7 +++++++
spacewalk/setup/spacewalk-setup.spec | 1 +
3 files changed, 20 insertions(+)
New commits:
commit d02add4b1ce892588f509069966eddfb50aeea77
Author: Tomas Kasparek <tkasparek(a)redhat.com>
Date: Thu Oct 3 15:22:35 2013 +0200
setting up configuration for editarea for apache >= 2.4
editarea is used on Spacewalk. When using Fedora 19 & apache 2.4 getting
/editarea/edit_area_full.js results in Forbidden.
Apache auth is now done in a set of modules for 2.4. According to the
documentation https://httpd.apache.org/docs/2.4/upgrading.html
2.2 configuration:
Order deny,allow
Deny from all
2.4 configuration:
Require all denied
I am not sure why the default changed, as httpd/conf.d/editarea.conf did
not had a configuration before, but adding the corresponding 2.4 part
fixes the problem.
diff --git a/spacewalk/setup/bin/spacewalk-setup b/spacewalk/setup/bin/spacewalk-setup
index 5194806..8c826bb 100755
--- a/spacewalk/setup/bin/spacewalk-setup
+++ b/spacewalk/setup/bin/spacewalk-setup
@@ -31,6 +31,7 @@ use Spacewalk::Setup ();
use Fcntl qw(F_GETFD F_SETFD FD_CLOEXEC);
use IO::Socket ();
use RHN::DB ();
+use File::Copy;
my $DEBUG;
$DEBUG = 0;
@@ -138,6 +139,9 @@ Spacewalk::Setup::update_monitoring_ack_enqueuer(\%opts, \%answers);
print Spacewalk::Setup::loc("* Configuring apache SSL virtual host.\n");
setup_ssl_vhost(\%opts, \%answers);
+print Spacewalk::Setup::loc("* Configuring editarea.\n");
+setup_editarea();
+
print Spacewalk::Setup::loc("* Configuring tomcat.\n");
setup_tomcat(\%opts, \%answers);
@@ -537,6 +541,14 @@ sub setup_ssl_vhost {
return;
}
+sub setup_editarea {
+ my $conf_file = "/etc/httpd/conf.d/editarea.conf";
+ if( -e $conf_file) {
+ Spacewalk::Setup::backup_file("/etc/httpd/conf.d", "editarea.conf");
+ }
+ copy(Spacewalk::Setup::SHARED_DIR . "/editarea.conf.1", $conf_file);
+}
+
sub setup_tomcat {
my $opts = shift;
my $answers = shift;
diff --git a/spacewalk/setup/share/editarea.conf.1 b/spacewalk/setup/share/editarea.conf.1
new file mode 100644
index 0000000..ab90b9c
--- /dev/null
+++ b/spacewalk/setup/share/editarea.conf.1
@@ -0,0 +1,7 @@
+alias /editarea /usr/share/editarea
+
+<IfVersion >= 2.4>
+<Directory /usr/share/editarea>
+Require all granted
+</Directory>
+</IfVersion>
diff --git a/spacewalk/setup/spacewalk-setup.spec b/spacewalk/setup/spacewalk-setup.spec
index 5a6d9a7..2b8e4c5 100644
--- a/spacewalk/setup/spacewalk-setup.spec
+++ b/spacewalk/setup/spacewalk-setup.spec
@@ -57,6 +57,7 @@ install -m 0755 share/embedded_diskspace_check.py %{buildroot}/%{_datadir}/space
install -m 0644 share/sudoers.* %{buildroot}/%{_datadir}/spacewalk/setup/
install -m 0644 share/ssl.conf.* %{buildroot}/%{_datadir}/spacewalk/setup/
install -m 0644 share/tomcat.* %{buildroot}/%{_datadir}/spacewalk/setup/
+install -m 0644 share/editarea.conf.* %{buildroot}/%{_datadir}/spacewalk/setup/
install -m 0644 share/server.xml.xsl %{buildroot}/%{_datadir}/spacewalk/setup/
install -m 0644 share/web.xml.patch %{buildroot}/%{_datadir}/spacewalk/setup/
install -m 0644 share/old-jvm-list %{buildroot}/%{_datadir}/spacewalk/setup/
10 years, 6 months
Changes to 'refs/tags/rhncfg-5.10.64-1'
by Michael Mraka
Tag 'rhncfg-5.10.64-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2013-10-04 13:35 +0000
Tagging package [rhncfg] version [5.10.64-1] in directory [client/tools/rhncfg/].
Changes since rhnlib-2.5.68-1:
Matej Kollar (5):
Tabs vs. Spaces War
Some seemingly unimportant spaces
Eliminating eval where possible
There is no up2date anymore
Allow user to save entered data as answer file
Michael Mraka (2):
Adding fallback support for numeric UID/GID
Automatic commit of package [rhncfg] release [5.10.64-1].
---
client/tools/rhncfg/config_common/transactions.py | 16
client/tools/rhncfg/rhncfg.spec | 5
proxy/installer/configure-proxy.sh | 393 +++++++++++-----------
rel-eng/packages/rhncfg | 2
4 files changed, 223 insertions(+), 193 deletions(-)
---
10 years, 6 months
2 commits - client/tools rel-eng/packages
by Michael Mraka
client/tools/rhncfg/config_common/transactions.py | 16 +++++++++++-----
client/tools/rhncfg/rhncfg.spec | 5 ++++-
rel-eng/packages/rhncfg | 2 +-
3 files changed, 16 insertions(+), 7 deletions(-)
New commits:
commit 1f2cf61849cc039cea5dae14dc9121def578e44c
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Oct 4 15:35:24 2013 +0200
Automatic commit of package [rhncfg] release [5.10.64-1].
diff --git a/client/tools/rhncfg/rhncfg.spec b/client/tools/rhncfg/rhncfg.spec
index b1259d9..902c002 100644
--- a/client/tools/rhncfg/rhncfg.spec
+++ b/client/tools/rhncfg/rhncfg.spec
@@ -8,7 +8,7 @@ Group: Applications/System
License: GPLv2
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
-Version: 5.10.63
+Version: 5.10.64
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -120,6 +120,9 @@ fi
# $Id$
%changelog
+* Fri Oct 04 2013 Michael Mraka <michael.mraka(a)redhat.com> 5.10.64-1
+- Adding fallback support for numeric UID/GID
+
* Mon Sep 30 2013 Michael Mraka <michael.mraka(a)redhat.com> 5.10.63-1
- removed trailing whitespaces
diff --git a/rel-eng/packages/rhncfg b/rel-eng/packages/rhncfg
index 2c630bd..db0dade 100644
--- a/rel-eng/packages/rhncfg
+++ b/rel-eng/packages/rhncfg
@@ -1 +1 @@
-5.10.63-1 client/tools/rhncfg/
+5.10.64-1 client/tools/rhncfg/
commit 2844654af3ca8d80fc438acf7f552e0489f7cb3e
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Fri Oct 4 15:31:14 2013 +0200
Adding fallback support for numeric UID/GID
if lookup fails and username/groupname is numeric
Nick Piacentine <npiace(a)mars.asu.edu>
diff --git a/client/tools/rhncfg/config_common/transactions.py b/client/tools/rhncfg/config_common/transactions.py
index 8e3f3d3..b449ac2 100644
--- a/client/tools/rhncfg/config_common/transactions.py
+++ b/client/tools/rhncfg/config_common/transactions.py
@@ -125,10 +125,13 @@ class DeployTransaction:
try:
user_record = pwd.getpwnam(file_info['username'])
+ uid = user_record[2]
except Exception, e:
- raise cfg_exceptions.UserNotFound(file_info['username']), None, sys.exc_info()[2]
-
- uid = user_record[2]
+ #Check if username is an int
+ try:
+ uid = int(file_info['username'])
+ except ValueError:
+ raise cfg_exceptions.UserNotFound(file_info['username']), None, sys.exc_info()[2]
else:
#default to root (3.2 sats)
uid = 0
@@ -139,10 +142,13 @@ class DeployTransaction:
# determine gid
try:
group_record = grp.getgrnam(file_info['groupname'])
+ gid = group_record[2]
except Exception, e:
- raise cfg_exceptions.GroupNotFound(file_info['groupname']), None, sys.exc_info()[2]
+ try:
+ gid = int(file_info['groupname'])
+ except ValueError:
+ raise cfg_exceptions.GroupNotFound(file_info['groupname']), None, sys.exc_info()[2]
- gid = group_record[2]
else:
#default to root (3.2 sats)
gid = 0
10 years, 6 months
5 commits - proxy/installer
by mkollar
proxy/installer/configure-proxy.sh | 393 +++++++++++++++++++------------------
1 file changed, 207 insertions(+), 186 deletions(-)
New commits:
commit 26c23c7a2de9259a8874f615ba942705659d681c
Author: Matej Kollar <mkollar(a)redhat.com>
Date: Thu Oct 3 08:16:28 2013 +0200
Allow user to save entered data as answer file
diff --git a/proxy/installer/configure-proxy.sh b/proxy/installer/configure-proxy.sh
index 848ab2a..066b14b 100755
--- a/proxy/installer/configure-proxy.sh
+++ b/proxy/installer/configure-proxy.sh
@@ -154,6 +154,24 @@ while : ; do
shift
done
+ACCUMULATED_ANSWERS=""
+
+generate_answers() {
+ if [ "$INTERACTIVE" = 1 -a ! -z "$ACCUMULATED_ANSWERS" ]; then
+ local WRITE_ANSWERS
+ echo "There were some answers you had to enter manually."
+ echo "Would you like to have written those into file"
+ echo -n "formatted as answers file? [Y/n]: "
+ read WRITE_ANSWERS
+ WRITE_ANSWERS=$(yes_no ${WRITE_ANSWERS:-Y})
+ if [ "$WRITE_ANSWERS" = 1 ]; then
+ local tmp=$(mktemp proxy-answers.txt.XXXXX)
+ echo "Writing $tmp"
+ echo "# Answer file generated by ${0##*/} at $(date)$ACCUMULATED_ANSWERS" > $tmp
+ fi
+ fi
+}
+
default_or_input() {
local MSG="$1"
local VARIABLE="$2"
@@ -170,11 +188,12 @@ default_or_input() {
echo -n "$MSG [$DEFAULT]: "
if [ "$INTERACTIVE" = "1" -a -z "$VARIABLE_ISSET" ]; then
read INPUT
+ ACCUMULATED_ANSWERS+=$(printf "\n%q=%q" "$VARIABLE" "${INPUT:-$DEFAULT}")
elif [ -z "$VARIABLE_ISSET" ]; then
- echo $DEFAULT
+ echo "$DEFAULT"
else
DEFAULT=${!VARIABLE}
- echo $DEFAULT
+ echo "$DEFAULT"
fi
if [ -z "$INPUT" ]; then
INPUT="$DEFAULT"
@@ -203,6 +222,7 @@ config_error() {
--http-proxy-password="$HTTP_PASSWORD" \
--ca-cert="$CA_CHAIN" \
--deactivate --non-interactive
+ generate_answers
exit $1
fi
}
@@ -231,6 +251,7 @@ in
section.
Then re-run this script again.
WARNING
+ generate_answers
exit 3
fi
}
@@ -288,6 +309,7 @@ Please do copy your CA key and public certificate from $RHN_PARENT to
/root/ssl-build directory. You may want to execute this command:
scp 'root@$RHN_PARENT:/root/ssl-build/{RHN-ORG-PRIVATE-SSL-KEY,RHN-ORG-TRUSTED-SSL-CERT,rhn-ca-openssl.cnf}' $SSL_BUILD_DIR
CA_KEYS
+ generate_answers
exit 1
fi
@@ -295,6 +317,7 @@ check_ca_conf
if ! /sbin/runuser nobody -s /bin/sh --command="[ -r $CA_CHAIN ]" ; then
echo Error: File $CA_CHAIN is not readable by nobody user.
+ generate_answers
exit 1
fi
@@ -591,3 +614,5 @@ else
echo Skipping start of services.
echo Use "/usr/sbin/rhn-proxy start" to manualy start proxy.
fi
+
+generate_answers
commit dc75b28866902d6cf860d795b787804b145faf70
Author: Matej Kollar <mkollar(a)redhat.com>
Date: Tue Oct 1 17:47:03 2013 +0200
There is no up2date anymore
diff --git a/proxy/installer/configure-proxy.sh b/proxy/installer/configure-proxy.sh
index fd07463..848ab2a 100755
--- a/proxy/installer/configure-proxy.sh
+++ b/proxy/installer/configure-proxy.sh
@@ -235,17 +235,12 @@ WARNING
fi
}
-#do we have yum or up2date?
-YUM_OR_UPDATE="up2date -i"
-UPGRADE="up2date -u"
-if [ -f /usr/bin/yum ]; then
- YUM_OR_UPDATE="yum install"
- UPGRADE="yum upgrade"
- # add -y for non-interactive installation
- if [ "$INTERACTIVE" = "0" ]; then
- YUM_OR_UPDATE="$YUM_OR_UPDATE -y"
- UPGRADE="$UPGRADE -y"
- fi
+YUM="yum install"
+UPGRADE="yum upgrade"
+# add -y for non-interactive installation
+if [ "$INTERACTIVE" = "0" ]; then
+ YUM="$YUM -y"
+ UPGRADE="$UPGRADE -y"
fi
SYSCONFIG_DIR=/etc/sysconfig/rhn
RHNCONF_DIR=/etc/rhn
@@ -377,7 +372,7 @@ if [ -x /usr/sbin/rhn-proxy ]; then
/usr/sbin/rhn-proxy stop
fi
-$YUM_OR_UPDATE spacewalk-proxy-management
+$YUM spacewalk-proxy-management
# check if package install successfully
rpm -q spacewalk-proxy-management >/dev/null
if [ $? -ne 0 ]; then
@@ -396,14 +391,14 @@ else
echo "You do not have monitoring installed."
echo "Do you want to install monitoring scout?"
- default_or_input "Will run '$YUM_OR_UPDATE spacewalk-proxy-monitoring'." INSTALL_MONITORING 'Y/n'
+ default_or_input "Will run '$YUM spacewalk-proxy-monitoring'." INSTALL_MONITORING 'Y/n'
INSTALL_MONITORING=$(yes_no $INSTALL_MONITORING)
if [ "$INSTALL_MONITORING" = "1" ]; then
- $YUM_OR_UPDATE spacewalk-proxy-monitoring
+ $YUM spacewalk-proxy-monitoring
MONITORING=$?
fi
else
- $YUM_OR_UPDATE spacewalk-proxy-monitoring
+ $YUM spacewalk-proxy-monitoring
# check if package install successfully
rpm -q spacewalk-proxy-monitoring >/dev/null
if [ $? -ne 0 ]; then
commit 453273cb322ed9cb6524f6dbd4cc82d2e7d88a2f
Author: Matej Kollar <mkollar(a)redhat.com>
Date: Tue Oct 1 14:37:16 2013 +0200
Eliminating eval where possible
Eval is evil. On few places eval remained,
maily becasue older bash do not have -g option
for declare builtin. Otherwise construction
declare -g "$VAR"="$ARG"
would be nicer and safer
diff --git a/proxy/installer/configure-proxy.sh b/proxy/installer/configure-proxy.sh
index 83952bd..fd07463 100755
--- a/proxy/installer/configure-proxy.sh
+++ b/proxy/installer/configure-proxy.sh
@@ -96,7 +96,7 @@ set_value() {
local VAR="$2"
local ARG="$3"
[[ "$ARG" =~ ^- ]] && echo "$0: option $OPTION requires argument!" && print_help
- eval "$VAR=$ARG"
+ eval "$(printf "%q=%q" "$VAR" "$ARG")"
}
INTERACTIVE=1
@@ -108,6 +108,7 @@ if [ $? != 0 ] ; then
print_help
fi
+# It is getopt's responsibility to make this safe
eval set -- "$OPTS"
while : ; do
@@ -159,7 +160,7 @@ default_or_input() {
local DEFAULT="$3"
local INPUT
- local CURRENT_VALUE=$(eval "echo \$$VARIABLE")
+ local CURRENT_VALUE=${!VARIABLE}
#in following code is used not so common expansion
#var_a=${var_b:-word}
#which is like: var_a = $var_b ? word
@@ -172,13 +173,13 @@ default_or_input() {
elif [ -z "$VARIABLE_ISSET" ]; then
echo $DEFAULT
else
- eval "DEFAULT=\$$VARIABLE"
+ DEFAULT=${!VARIABLE}
echo $DEFAULT
fi
if [ -z "$INPUT" ]; then
INPUT="$DEFAULT"
fi
- eval "$VARIABLE='$INPUT'"
+ eval "$(printf "%q=%q" "$VARIABLE" "$INPUT")"
}
yes_no() {
commit bebb316e76dd3be8ad9ee34e75e9e5246e03bf06
Author: Matej Kollar <mkollar(a)redhat.com>
Date: Tue Oct 1 14:08:54 2013 +0200
Some seemingly unimportant spaces
diff --git a/proxy/installer/configure-proxy.sh b/proxy/installer/configure-proxy.sh
index fdb9ac2..83952bd 100755
--- a/proxy/installer/configure-proxy.sh
+++ b/proxy/installer/configure-proxy.sh
@@ -5,7 +5,7 @@ if [ 0$UID -gt 0 ]; then
exit 1
fi
-print_help () {
+print_help() {
cat <<HELP
usage: configure-proxy.sh [options]
@@ -78,7 +78,7 @@ HELP
exit 1
}
-parse_answer_file () {
+parse_answer_file() {
local FILE="$1"
local ALIAS
if [ ! -r "$FILE" ] ; then
@@ -153,7 +153,7 @@ while : ; do
shift
done
-default_or_input () {
+default_or_input() {
local MSG="$1"
local VARIABLE="$2"
local DEFAULT="$3"
@@ -192,7 +192,7 @@ yes_no() {
esac
}
-config_error () {
+config_error() {
if [ $1 -gt 0 ]; then
echo "$2 Installation interrupted."
/usr/bin/rhn-proxy-activate \
@@ -207,13 +207,13 @@ config_error () {
}
# Return 0 if rhnParent is Hosted. Otherwise return 1.
-is_hosted () {
+is_hosted() {
[ "$1" = "xmlrpc.rhn.redhat.com" -o \
$( PYTHONPATH='/usr/share/rhn' python -c "from up2date_client import config; cfg = config.initUp2dateConfig(); print '$1' in cfg['hostedWhitelist']" ) = "True" ]
return $?
}
-check_ca_conf () {
+check_ca_conf() {
if [ -f /root/ssl-build/rhn-ca-openssl.cnf ] \
&& awk '/^[[:space:]]*\[[[:space:]]*[_[:alnum:]]*[[:space:]]*]/ {CORRECT_SECTION=0} \
/^[[:space:]]*\[[[:space:]]*CA_default[[:space:]]*]/ {CORRECT_SECTION=1} \
commit 02cd16eb604aa239acabcb117b943dc05873ea41
Author: Matej Kollar <mkollar(a)redhat.com>
Date: Tue Oct 1 14:05:35 2013 +0200
Tabs vs. Spaces War
+ I tried to unify 4 spaces indentation.
diff --git a/proxy/installer/configure-proxy.sh b/proxy/installer/configure-proxy.sh
index 83b0693..fdb9ac2 100755
--- a/proxy/installer/configure-proxy.sh
+++ b/proxy/installer/configure-proxy.sh
@@ -1,12 +1,12 @@
#!/bin/bash
if [ 0$UID -gt 0 ]; then
- echo Run as root.
- exit 1
+ echo Run as root.
+ exit 1
fi
print_help () {
- cat <<HELP
+ cat <<HELP
usage: configure-proxy.sh [options]
options:
@@ -20,7 +20,7 @@ options:
Enable monitoring scout.
--force-own-ca
Do not use parent CA and force to create your own.
- -h, --help
+ -h, --help
show this help message and exit
--http-password=HTTP_PASSWORD
The password to use for an authenticated proxy.
@@ -75,7 +75,7 @@ options:
--version=VERSION
Version of Spacewalk Proxy Server you want to activate.
HELP
- exit 1
+ exit 1
}
parse_answer_file () {
@@ -105,7 +105,7 @@ CNAME_INDEX=0
OPTS=$(getopt --longoptions=help,answer-file:,non-interactive,version:,rhn-parent:,traceback-email:,use-ssl::,ca-chain:,force-own-ca,http-proxy:,http-username:,http-password:,ssl-build-dir:,ssl-org:,ssl-orgunit:,ssl-common:,ssl-city:,ssl-state:,ssl-country:,ssl-email:,ssl-password:,ssl-cname:,install-monitoring::,enable-scout::,monitoring-parent:,monitoring-parent-ip:,populate-config-channel::,start-services:: -n ${0##*/} -- h "$@")
if [ $? != 0 ] ; then
- print_help
+ print_help
fi
eval set -- "$OPTS"
@@ -154,62 +154,62 @@ while : ; do
done
default_or_input () {
- local MSG="$1"
- local VARIABLE="$2"
- local DEFAULT="$3"
-
- local INPUT
- local CURRENT_VALUE=$(eval "echo \$$VARIABLE")
- #in following code is used not so common expansion
- #var_a=${var_b:-word}
- #which is like: var_a = $var_b ? word
- DEFAULT=${CURRENT_VALUE:-$DEFAULT}
- local VARIABLE_ISSET=$(set | grep "^$VARIABLE=")
-
- echo -n "$MSG [$DEFAULT]: "
- if [ "$INTERACTIVE" = "1" -a -z "$VARIABLE_ISSET" ]; then
- read INPUT
- elif [ -z "$VARIABLE_ISSET" ]; then
- echo $DEFAULT
- else
- eval "DEFAULT=\$$VARIABLE"
- echo $DEFAULT
- fi
- if [ -z "$INPUT" ]; then
- INPUT="$DEFAULT"
- fi
- eval "$VARIABLE='$INPUT'"
+ local MSG="$1"
+ local VARIABLE="$2"
+ local DEFAULT="$3"
+
+ local INPUT
+ local CURRENT_VALUE=$(eval "echo \$$VARIABLE")
+ #in following code is used not so common expansion
+ #var_a=${var_b:-word}
+ #which is like: var_a = $var_b ? word
+ DEFAULT=${CURRENT_VALUE:-$DEFAULT}
+ local VARIABLE_ISSET=$(set | grep "^$VARIABLE=")
+
+ echo -n "$MSG [$DEFAULT]: "
+ if [ "$INTERACTIVE" = "1" -a -z "$VARIABLE_ISSET" ]; then
+ read INPUT
+ elif [ -z "$VARIABLE_ISSET" ]; then
+ echo $DEFAULT
+ else
+ eval "DEFAULT=\$$VARIABLE"
+ echo $DEFAULT
+ fi
+ if [ -z "$INPUT" ]; then
+ INPUT="$DEFAULT"
+ fi
+ eval "$VARIABLE='$INPUT'"
}
yes_no() {
- case "$1" in
- Y|y|Y/n|n/Y|1)
- echo 1
- ;;
- *)
- echo 0
- ;;
- esac
+ case "$1" in
+ Y|y|Y/n|n/Y|1)
+ echo 1
+ ;;
+ *)
+ echo 0
+ ;;
+ esac
}
config_error () {
- if [ $1 -gt 0 ]; then
- echo "$2 Installation interrupted."
- /usr/bin/rhn-proxy-activate \
- --server="$RHN_PARENT" \
- --http-proxy="$HTTP_PROXY" \
- --http-proxy-username="$HTTP_USERNAME" \
- --http-proxy-password="$HTTP_PASSWORD" \
- --ca-cert="$CA_CHAIN" \
- --deactivate --non-interactive
- exit $1
- fi
+ if [ $1 -gt 0 ]; then
+ echo "$2 Installation interrupted."
+ /usr/bin/rhn-proxy-activate \
+ --server="$RHN_PARENT" \
+ --http-proxy="$HTTP_PROXY" \
+ --http-proxy-username="$HTTP_USERNAME" \
+ --http-proxy-password="$HTTP_PASSWORD" \
+ --ca-cert="$CA_CHAIN" \
+ --deactivate --non-interactive
+ exit $1
+ fi
}
# Return 0 if rhnParent is Hosted. Otherwise return 1.
is_hosted () {
- [ "$1" = "xmlrpc.rhn.redhat.com" -o \
- $( PYTHONPATH='/usr/share/rhn' python -c "from up2date_client import config; cfg = config.initUp2dateConfig(); print '$1' in cfg['hostedWhitelist']" ) = "True" ]
+ [ "$1" = "xmlrpc.rhn.redhat.com" -o \
+ $( PYTHONPATH='/usr/share/rhn' python -c "from up2date_client import config; cfg = config.initUp2dateConfig(); print '$1' in cfg['hostedWhitelist']" ) = "True" ]
return $?
}
@@ -219,8 +219,8 @@ check_ca_conf () {
/^[[:space:]]*\[[[:space:]]*CA_default[[:space:]]*]/ {CORRECT_SECTION=1} \
/^[[:space:]]*copy_extensions[[:space:]]*=[[:space:]]*copy/ && CORRECT_SECTION==1 {exit 1}' \
/root/ssl-build/rhn-ca-openssl.cnf > /dev/null \
- && [ ${#SSL_CNAME_PARSED[@]} -gt 0 ]; then
- cat <<WARNING
+ && [ ${#SSL_CNAME_PARSED[@]} -gt 0 ]; then
+ cat <<WARNING
It seems you tried to use the --set-cname option. On inspection we noticed that the openssl configuration file we use is missing a critically important option. Without this option, not only will multi host SSL certificates not work, but the planet Earth will implode in a massive rip in the time/space continuum. To avoid this failure, we choose to gracefully exit here and request for you to edit the openssl configuration file
/root/ssl-build/rhn-ca-openssl.cnf
and add this line:
@@ -230,21 +230,21 @@ in
section.
Then re-run this script again.
WARNING
- exit 3
- fi
+ exit 3
+ fi
}
#do we have yum or up2date?
YUM_OR_UPDATE="up2date -i"
UPGRADE="up2date -u"
if [ -f /usr/bin/yum ]; then
- YUM_OR_UPDATE="yum install"
- UPGRADE="yum upgrade"
- # add -y for non-interactive installation
- if [ "$INTERACTIVE" = "0" ]; then
- YUM_OR_UPDATE="$YUM_OR_UPDATE -y"
- UPGRADE="$UPGRADE -y"
- fi
+ YUM_OR_UPDATE="yum install"
+ UPGRADE="yum upgrade"
+ # add -y for non-interactive installation
+ if [ "$INTERACTIVE" = "0" ]; then
+ YUM_OR_UPDATE="$YUM_OR_UPDATE -y"
+ UPGRADE="$UPGRADE -y"
+ fi
fi
SYSCONFIG_DIR=/etc/sysconfig/rhn
RHNCONF_DIR=/etc/rhn
@@ -256,8 +256,8 @@ SQUID_DIR=/etc/squid
SYSTEMID_PATH=`PYTHONPATH='/usr/share/rhn' python -c "from up2date_client import config; cfg = config.initUp2dateConfig(); print cfg['systemIdPath'] "`
if [ ! -r $SYSTEMID_PATH ]; then
- echo ERROR: Spacewalk Proxy does not appear to be registered
- exit 2
+ echo ERROR: Spacewalk Proxy does not appear to be registered
+ exit 2
fi
SYSTEM_ID=$(/usr/bin/xsltproc /usr/share/rhn/get_system_id.xslt $SYSTEMID_PATH | cut -d- -f2)
@@ -267,8 +267,8 @@ HOSTNAME=$(hostname)
SSL_BUILD_DIR=${SSL_BUILD_DIR:-/root/ssl-build}
if ! [ -d $SSL_BUILD_DIR ] && [ 0$FORCE_OWN_CA -eq 0 ]; then
- echo "Error: ssl build directory $SSL_BUILD_DIR does not exist. Please create this directory."
- exit 1
+ echo "Error: ssl build directory $SSL_BUILD_DIR does not exist. Please create this directory."
+ exit 1
fi
default_or_input "RHN Parent" RHN_PARENT $(awk -F= '/serverURL=/ {split($2, a, "/")} END { print a[3]}' $SYSCONFIG_DIR/up2date)
@@ -285,21 +285,21 @@ default_or_input "CA Chain" CA_CHAIN $(awk -F'[=;]' '/sslCACert=/ {a=$2} END { p
if [ 0$FORCE_OWN_CA -eq 0 ] && \
! is_hosted "$RHN_PARENT" && \
- [ ! -f /root/ssl-build/RHN-ORG-PRIVATE-SSL-KEY ] && \
- ! diff $CA_CHAIN /root/ssl-build/RHN-ORG-TRUSTED-SSL-KEY &>/dev/null; then
- cat <<CA_KEYS
-Please do copy your CA key and public certificate from $RHN_PARENT to
+ [ ! -f /root/ssl-build/RHN-ORG-PRIVATE-SSL-KEY ] && \
+ ! diff $CA_CHAIN /root/ssl-build/RHN-ORG-TRUSTED-SSL-KEY &>/dev/null; then
+ cat <<CA_KEYS
+Please do copy your CA key and public certificate from $RHN_PARENT to
/root/ssl-build directory. You may want to execute this command:
scp 'root@$RHN_PARENT:/root/ssl-build/{RHN-ORG-PRIVATE-SSL-KEY,RHN-ORG-TRUSTED-SSL-CERT,rhn-ca-openssl.cnf}' $SSL_BUILD_DIR
CA_KEYS
- exit 1
+ exit 1
fi
check_ca_conf
if ! /sbin/runuser nobody -s /bin/sh --command="[ -r $CA_CHAIN ]" ; then
- echo Error: File $CA_CHAIN is not readable by nobody user.
- exit 1
+ echo Error: File $CA_CHAIN is not readable by nobody user.
+ exit 1
fi
VERSION_FROM_PARENT=$(rhn-proxy-activate --server=$RHN_PARENT --list-available-versions 2>/dev/null|sort|tail -n1)
@@ -316,11 +316,11 @@ default_or_input "HTTP Proxy" HTTP_PROXY ''
if [ "$HTTP_PROXY" != "" ]; then
- default_or_input "HTTP username" HTTP_USERNAME ''
+ default_or_input "HTTP username" HTTP_USERNAME ''
- if [ "$HTTP_USERNAME" != "" ]; then
- default_or_input "HTTP password" HTTP_PASSWORD ''
- fi
+ if [ "$HTTP_USERNAME" != "" ]; then
+ default_or_input "HTTP password" HTTP_PASSWORD ''
+ fi
fi
cat <<SSLCERT
@@ -345,15 +345,15 @@ default_or_input "Country code" SSL_COUNTRY ''
default_or_input "Email" SSL_EMAIL "$TRACEBACK_EMAIL"
if [ ${#SSL_CNAME_PARSED[@]} -eq 0 ]; then
- VARIABLE_ISSET=$(set | grep "^SSL_CNAME=")
- if [ -z $VARIABLE_ISSET ]; then
- default_or_input "Cname aliases (separated by space)" SSL_CNAME_ASK ''
- CNAME=($SSL_CNAME_ASK)
- for ALIAS in ${CNAME[@]}; do
- SSL_CNAME_PARSED[CNAME_INDEX++]=--set-cname=$ALIAS
- done
- check_ca_conf
- fi
+ VARIABLE_ISSET=$(set | grep "^SSL_CNAME=")
+ if [ -z $VARIABLE_ISSET ]; then
+ default_or_input "Cname aliases (separated by space)" SSL_CNAME_ASK ''
+ CNAME=($SSL_CNAME_ASK)
+ for ALIAS in ${CNAME[@]}; do
+ SSL_CNAME_PARSED[CNAME_INDEX++]=--set-cname=$ALIAS
+ done
+ check_ca_conf
+ fi
fi
/usr/bin/rhn-proxy-activate --server="$RHN_PARENT" \
@@ -373,14 +373,14 @@ if [ $? -eq 0 ]; then
fi
if [ -x /usr/sbin/rhn-proxy ]; then
- /usr/sbin/rhn-proxy stop
+ /usr/sbin/rhn-proxy stop
fi
$YUM_OR_UPDATE spacewalk-proxy-management
# check if package install successfully
rpm -q spacewalk-proxy-management >/dev/null
if [ $? -ne 0 ]; then
- config_error 2 "Installation of package spacewalk-proxy-management failed."
+ config_error 2 "Installation of package spacewalk-proxy-management failed."
fi
$UPGRADE
@@ -393,7 +393,7 @@ else
MONITORING=$?
if [ $MONITORING -ne 0 ]; then
echo "You do not have monitoring installed."
- echo "Do you want to install monitoring scout?"
+ echo "Do you want to install monitoring scout?"
default_or_input "Will run '$YUM_OR_UPDATE spacewalk-proxy-monitoring'." INSTALL_MONITORING 'Y/n'
INSTALL_MONITORING=$(yes_no $INSTALL_MONITORING)
@@ -427,16 +427,16 @@ else
--ca-cert="$CA_CHAIN" | \
awk '/\: [0-9a-f]+/ { print $4 }' `
else
- ENABLE_SCOUT=0
+ ENABLE_SCOUT=0
fi
fi
ln -sf /etc/pki/spacewalk/jabberd/server.pem /etc/jabberd/server.pem
if [ "$VERSION" = '5.3' -o "$VERSION" = '5.2' -o "$VERSION" = '5.1' -o "$VERSION" = '5.0' ]; then
- sed -e "s/\${session.hostname}/$HOSTNAME/g" </usr/share/rhn/installer/jabberd/c2s.xml >/etc/jabberd/c2s.xml
- sed -e "s/\${session.hostname}/$HOSTNAME/g" </usr/share/rhn/installer/jabberd/sm.xml >/etc/jabberd/sm.xml
+ sed -e "s/\${session.hostname}/$HOSTNAME/g" </usr/share/rhn/installer/jabberd/c2s.xml >/etc/jabberd/c2s.xml
+ sed -e "s/\${session.hostname}/$HOSTNAME/g" </usr/share/rhn/installer/jabberd/sm.xml >/etc/jabberd/sm.xml
else
- /usr/bin/spacewalk-setup-jabberd --macros "hostname:$HOSTNAME"
+ /usr/bin/spacewalk-setup-jabberd --macros "hostname:$HOSTNAME"
fi
# size of squid disk cache will be 60% of free space on /var/spool/squid
@@ -452,19 +452,19 @@ if [ $SQUID_VER_MAJOR -ge 3 ] ; then
fi
sed "$SQUID_REWRITE" < $DIR/squid.conf > $SQUID_DIR/squid.conf
sed -e "s|\${session.ca_chain:/usr/share/rhn/RHNS-CA-CERT}|$CA_CHAIN|g" \
- -e "s/\${session.http_proxy}/$HTTP_PROXY/g" \
- -e "s/\${session.http_proxy_username}/$HTTP_USERNAME/g" \
- -e "s/\${session.http_proxy_password}/$HTTP_PASSWORD/g" \
- -e "s/\${session.rhn_parent}/$RHN_PARENT/g" \
- -e "s/\${session.traceback_mail}/$TRACEBACK_EMAIL/g" \
- -e "s/\${session.use_ssl:0}/$USE_SSL/g" \
- -e "s/\${session.enable_monitoring_scout:0}/$ENABLE_SCOUT/g" \
- < $DIR/rhn.conf > $RHNCONF_DIR/rhn.conf
+ -e "s/\${session.http_proxy}/$HTTP_PROXY/g" \
+ -e "s/\${session.http_proxy_username}/$HTTP_USERNAME/g" \
+ -e "s/\${session.http_proxy_password}/$HTTP_PASSWORD/g" \
+ -e "s/\${session.rhn_parent}/$RHN_PARENT/g" \
+ -e "s/\${session.traceback_mail}/$TRACEBACK_EMAIL/g" \
+ -e "s/\${session.use_ssl:0}/$USE_SSL/g" \
+ -e "s/\${session.enable_monitoring_scout:0}/$ENABLE_SCOUT/g" \
+ < $DIR/rhn.conf > $RHNCONF_DIR/rhn.conf
if [ $MONITORING -eq 0 ]; then
- sed -e "s/\${session.enable_monitoring_scout:0}/$ENABLE_SCOUT/g" \
- -e "s/\${session.rhn_monitoring_parent_ip}/$MONITORING_PARENT_IP/g" \
- -e "s/\${session.rhn_monitoring_parent}/$MONITORING_PARENT/g" \
- -e "s/\${session.scout_shared_key}/$SCOUT_SHARED_KEY/g" \
+ sed -e "s/\${session.enable_monitoring_scout:0}/$ENABLE_SCOUT/g" \
+ -e "s/\${session.rhn_monitoring_parent_ip}/$MONITORING_PARENT_IP/g" \
+ -e "s/\${session.rhn_monitoring_parent}/$MONITORING_PARENT/g" \
+ -e "s/\${session.scout_shared_key}/$SCOUT_SHARED_KEY/g" \
< $DIR/cluster.ini > $RHNCONF_DIR/cluster.ini
fi
@@ -478,113 +478,113 @@ if [ $USE_SSL -eq 1 ]; then
PROTO="https"
fi
sed -e "s/\$PROTO/$PROTO/g" \
- -e "s/\$RHN_PARENT/$RHN_PARENT/g" < $DIR/cobbler-proxy.conf > $HTTPDCONFD_DIR/cobbler-proxy.conf
+ -e "s/\$RHN_PARENT/$RHN_PARENT/g" < $DIR/cobbler-proxy.conf > $HTTPDCONFD_DIR/cobbler-proxy.conf
# lets do SSL stuff
SSL_BUILD_DIR=${SSL_BUILD_DIR:-"/root/ssl-build"}
if [ -n "$SSL_PASSWORD" ] ; then
- # use SSL_PASSWORD if already set
- RHN_SSL_TOOL_PASSWORD_OPTION="--password"
- RHN_SSL_TOOL_PASSWORD="$SSL_PASSWORD"
+ # use SSL_PASSWORD if already set
+ RHN_SSL_TOOL_PASSWORD_OPTION="--password"
+ RHN_SSL_TOOL_PASSWORD="$SSL_PASSWORD"
elif [ "$INTERACTIVE" = "0" ] ; then
- # non-interactive mode but no SSL_PASSWORD :(
- config_error 4 "Please define SSL_PASSWORD."
+ # non-interactive mode but no SSL_PASSWORD :(
+ config_error 4 "Please define SSL_PASSWORD."
fi
if [ ! -f $SSL_BUILD_DIR/RHN-ORG-PRIVATE-SSL-KEY ]; then
- echo "Generating CA key and public certificate:"
- /usr/bin/rhn-ssl-tool --gen-ca -q \
- --dir="$SSL_BUILD_DIR" \
- --set-common-name="$SSL_COMMON" \
- --set-country="$SSL_COUNTRY" \
- --set-city="$SSL_CITY" \
- --set-state="$SSL_STATE" \
- --set-org="$SSL_ORG" \
- --set-org-unit="$SSL_ORGUNIT" \
- --set-email="$SSL_EMAIL" \
- $RHN_SSL_TOOL_PASSWORD_OPTION $RHN_SSL_TOOL_PASSWORD
- config_error $? "CA certificate generation failed!"
+ echo "Generating CA key and public certificate:"
+ /usr/bin/rhn-ssl-tool --gen-ca -q \
+ --dir="$SSL_BUILD_DIR" \
+ --set-common-name="$SSL_COMMON" \
+ --set-country="$SSL_COUNTRY" \
+ --set-city="$SSL_CITY" \
+ --set-state="$SSL_STATE" \
+ --set-org="$SSL_ORG" \
+ --set-org-unit="$SSL_ORGUNIT" \
+ --set-email="$SSL_EMAIL" \
+ $RHN_SSL_TOOL_PASSWORD_OPTION $RHN_SSL_TOOL_PASSWORD
+ config_error $? "CA certificate generation failed!"
else
- echo "Using CA key at $SSL_BUILD_DIR/RHN-ORG-PRIVATE-SSL-KEY."
+ echo "Using CA key at $SSL_BUILD_DIR/RHN-ORG-PRIVATE-SSL-KEY."
fi
RPM_CA=$(grep noarch $SSL_BUILD_DIR/latest.txt 2>/dev/null)
if [ ! -f $SSL_BUILD_DIR/$RPM_CA ]; then
- echo "Generating distributable RPM for CA public certificate:"
- /usr/bin/rhn-ssl-tool --gen-ca -q --rpm-only --dir="$SSL_BUILD_DIR"
- RPM_CA=$(grep noarch $SSL_BUILD_DIR/latest.txt)
+ echo "Generating distributable RPM for CA public certificate:"
+ /usr/bin/rhn-ssl-tool --gen-ca -q --rpm-only --dir="$SSL_BUILD_DIR"
+ RPM_CA=$(grep noarch $SSL_BUILD_DIR/latest.txt)
fi
if [ ! -f $HTMLPUB_DIR/$RPM_CA ] || [ ! -f $HTMLPUB_DIR/RHN-ORG-TRUSTED-SSL-CERT ] || \
! diff $HTMLPUB_DIR/RHN-ORG-TRUSTED-SSL-CERT $SSL_BUILD_DIR/RHN-ORG-TRUSTED-SSL-CERT &>/dev/null; then
- echo "Copying CA public certificate to $HTMLPUB_DIR for distribution to clients:"
- cp $SSL_BUILD_DIR/RHN-ORG-TRUSTED-SSL-CERT $SSL_BUILD_DIR/$RPM_CA $HTMLPUB_DIR/
+ echo "Copying CA public certificate to $HTMLPUB_DIR for distribution to clients:"
+ cp $SSL_BUILD_DIR/RHN-ORG-TRUSTED-SSL-CERT $SSL_BUILD_DIR/$RPM_CA $HTMLPUB_DIR/
fi
echo "Generating SSL key and public certificate:"
/usr/bin/rhn-ssl-tool --gen-server -q --no-rpm \
- --set-hostname "$HOSTNAME" \
- --dir="$SSL_BUILD_DIR" \
- --set-country="$SSL_COUNTRY" \
- --set-city="$SSL_CITY" \
- --set-state="$SSL_STATE" \
- --set-org="$SSL_ORG" \
- --set-org-unit="$SSL_ORGUNIT" \
- --set-email="$SSL_EMAIL" \
- ${SSL_CNAME_PARSED[@]} \
- $RHN_SSL_TOOL_PASSWORD_OPTION $RHN_SSL_TOOL_PASSWORD
+ --set-hostname "$HOSTNAME" \
+ --dir="$SSL_BUILD_DIR" \
+ --set-country="$SSL_COUNTRY" \
+ --set-city="$SSL_CITY" \
+ --set-state="$SSL_STATE" \
+ --set-org="$SSL_ORG" \
+ --set-org-unit="$SSL_ORGUNIT" \
+ --set-email="$SSL_EMAIL" \
+ ${SSL_CNAME_PARSED[@]} \
+ $RHN_SSL_TOOL_PASSWORD_OPTION $RHN_SSL_TOOL_PASSWORD
config_error $? "SSL key generation failed!"
echo "Installing SSL certificate for Apache and Jabberd:"
rpm -Uv $(/usr/bin/rhn-ssl-tool --gen-server --rpm-only --dir="$SSL_BUILD_DIR" 2>/dev/null |grep noarch.rpm)
if [ -e $HTTPDCONFD_DIR/ssl.conf ]; then
- mv $HTTPDCONFD_DIR/ssl.conf $HTTPDCONFD_DIR/ssl.conf.bak
+ mv $HTTPDCONFD_DIR/ssl.conf $HTTPDCONFD_DIR/ssl.conf.bak
fi
sed -e "s|^SSLCertificateFile /etc/pki/tls/certs/localhost.crt$|SSLCertificateFile $HTTPDCONF_DIR/ssl.crt/server.crt|g" \
- -e "s|^SSLCertificateKeyFile /etc/pki/tls/private/localhost.key$|SSLCertificateKeyFile $HTTPDCONF_DIR/ssl.key/server.key|g" \
- -e "s|</VirtualHost>|RewriteEngine on\nRewriteOptions inherit\nSSLProxyEngine on\n</VirtualHost>|" \
- < $HTTPDCONFD_DIR/ssl.conf.bak > $HTTPDCONFD_DIR/ssl.conf
+ -e "s|^SSLCertificateKeyFile /etc/pki/tls/private/localhost.key$|SSLCertificateKeyFile $HTTPDCONF_DIR/ssl.key/server.key|g" \
+ -e "s|</VirtualHost>|RewriteEngine on\nRewriteOptions inherit\nSSLProxyEngine on\n</VirtualHost>|" \
+ < $HTTPDCONFD_DIR/ssl.conf.bak > $HTTPDCONFD_DIR/ssl.conf
CHANNEL_LABEL="rhn_proxy_config_$SYSTEM_ID"
default_or_input "Create and populate configuration channel $CHANNEL_LABEL?" POPULATE_CONFIG_CHANNEL 'Y/n'
POPULATE_CONFIG_CHANNEL=$(yes_no $POPULATE_CONFIG_CHANNEL)
if [ "$POPULATE_CONFIG_CHANNEL" = "1" ]; then
- RHNCFG_STATUS=1
- while [ $RHNCFG_STATUS != 0 ] ; do
- CONFIG_CHANNELS=$(rhncfg-manager list-channels --server-name "$RHN_PARENT")
- RHNCFG_STATUS=$?
- done
- if ! grep -q -E "^ +$CHANNEL_LABEL$" <<<"$CONFIG_CHANNELS" ; then
- rhncfg-manager create-channel --server-name "$RHN_PARENT" "$CHANNEL_LABEL"
- fi
- rhncfg-manager update --server-name "$RHN_PARENT" \
- --channel="$CHANNEL_LABEL" \
- $HTTPDCONFD_DIR/ssl.conf \
- $RHNCONF_DIR/rhn.conf \
- $RHNCONF_DIR/cluster.ini \
- $SQUID_DIR/squid.conf \
- $HTTPDCONFD_DIR/cobbler-proxy.conf \
- $HTTPDCONF_DIR/httpd.conf \
- $JABBERD_DIR/c2s.xml \
- $JABBERD_DIR/sm.xml
+ RHNCFG_STATUS=1
+ while [ $RHNCFG_STATUS != 0 ] ; do
+ CONFIG_CHANNELS=$(rhncfg-manager list-channels --server-name "$RHN_PARENT")
+ RHNCFG_STATUS=$?
+ done
+ if ! grep -q -E "^ +$CHANNEL_LABEL$" <<<"$CONFIG_CHANNELS" ; then
+ rhncfg-manager create-channel --server-name "$RHN_PARENT" "$CHANNEL_LABEL"
+ fi
+ rhncfg-manager update --server-name "$RHN_PARENT" \
+ --channel="$CHANNEL_LABEL" \
+ $HTTPDCONFD_DIR/ssl.conf \
+ $RHNCONF_DIR/rhn.conf \
+ $RHNCONF_DIR/cluster.ini \
+ $SQUID_DIR/squid.conf \
+ $HTTPDCONFD_DIR/cobbler-proxy.conf \
+ $HTTPDCONF_DIR/httpd.conf \
+ $JABBERD_DIR/c2s.xml \
+ $JABBERD_DIR/sm.xml
fi
echo "Enabling Spacewalk Proxy."
if [ $ENABLE_SCOUT -ne 0 ]; then
- MonitoringScout="MonitoringScout"
+ MonitoringScout="MonitoringScout"
fi
for service in squid httpd jabberd $MonitoringScout; do
- if [ -x /usr/bin/systemctl ] ; then
- /usr/bin/systemctl enable $service
- else
- /sbin/chkconfig --add $service
- /sbin/chkconfig --level 345 $service on
- fi
+ if [ -x /usr/bin/systemctl ] ; then
+ /usr/bin/systemctl enable $service
+ else
+ /sbin/chkconfig --add $service
+ /sbin/chkconfig --level 345 $service on
+ fi
done
# default is 1
@@ -592,6 +592,6 @@ START_SERVICES=$(yes_no ${START_SERVICES:-1})
if [ "$START_SERVICES" = "1" ]; then
/usr/sbin/rhn-proxy restart
else
- echo Skipping start of services.
- echo Use "/usr/sbin/rhn-proxy start" to manualy start proxy.
+ echo Skipping start of services.
+ echo Use "/usr/sbin/rhn-proxy start" to manualy start proxy.
fi
10 years, 6 months
Changes to 'refs/tags/rhnlib-2.5.68-1'
by Michael Mraka
Tag 'rhnlib-2.5.68-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2013-10-04 10:52 +0000
Tagging package [rhnlib] version [2.5.68-1] in directory [client/rhel/rhnlib/].
Changes since spacewalk-backend-2.1.26-1:
Michael Mraka (1):
Automatic commit of package [rhnlib] release [2.5.68-1].
---
client/rhel/rhnlib/rhnlib.spec | 5 ++++-
rel-eng/packages/rhnlib | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
---
10 years, 6 months