Skip to content

Commit

Permalink
Upgrade conserver to 8.2.1 version
Browse files Browse the repository at this point in the history
- Deprecated the patch for sslauthority.
- Leverage sslcacertificatefile configuration from upstream.
- Apply init script patches from old version.
- Changelog and package information for this new version on
  rhels and ubuntu systems.

implement-feature: xcat2#18
  • Loading branch information
chenglch committed Jun 9, 2017
1 parent 01bd7d9 commit cceacc3
Show file tree
Hide file tree
Showing 9 changed files with 191 additions and 32 deletions.
18 changes: 9 additions & 9 deletions conserver/README
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,28 @@ To make the conserver-xcat rpm, run:

To update the initscript.patch or initscript1.patch:

1. Copy conserver-8.1.16.tar.gz to a directory, say /root/conserverstar
1. Copy conserver-8.2.1.tar.gz to a directory, say /root/conserverstar
mkdir /root/conservertar
cp conserver-8.1.16.tar.gz /root/conserverstar
cp conserver-8.2.1.tar.gz /root/conserverstar

2. Copy the initscript.patch or initscript1.patch to the same directory
cp initscript.patch /root/conserverstar

3. Uncompress the conserver-8.1.16.tar.gz into two copies:
tar zxvf conserver-8.1.16.tar.gz
mv conserver-8.1.16 conserver-8.1.16-diffinit
tar zxvf conserver-8.1.16.tar.gz
3. Uncompress the conserver-8.2.1.tar.gz into two copies:
tar zxvf conserver-8.2.1.tar.gz
mv conserver-8.2.1 conserver-8.2.1-diffinit
tar zxvf conserver-8.2.1.tar.gz

4. Patch the conserver.init with the original patch copied from SVN repository
cd /root/conservertar
cat initscript.patch | /usr/bin/patch -s -p1 --fuzz=0
select conserver-8.1.16-diffinit/contrib/redhat-rpm/conserver.init as the file to patch
select conserver-8.2.1-diffinit/contrib/redhat-rpm/conserver.init as the file to patch

5. Update the conserver-8.1.16-diffinit/contrib/redhat-rpm/conserver.init with whatever changes that are needed
5. Update the conserver-8.2.1-diffinit/contrib/redhat-rpm/conserver.init with whatever changes that are needed

6. Generate the new patch:
cd /root/conserverstart
diff -ruN conserver-8.1.16/contrib/redhat-rpm/conserver.init conserver-8.1.16-diffinit/contrib/redhat-rpm/conserver.init > initscript.patch
diff -ruN conserver-8.2.1/contrib/redhat-rpm/conserver.init conserver-8.2.1-diffinit/contrib/redhat-rpm/conserver.init > initscript_8.2.1.patch

7. Copy the new patch to the xcat-dep SVN repository and checkin
cp initscript.patch ~/xcat/xcat-dep/trunk/conserver/
Expand Down
14 changes: 7 additions & 7 deletions conserver/bldconserver.pl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
# check the source files
my $pwd = `pwd`;
chomp($pwd);
if ( (! -f "$pwd/conserver-8.1.16.tar.gz")
if ( (! -f "$pwd/conserver-8.2.1.tar.gz")
|| (! -f "$pwd/conserver.spec")
|| (! -f "$pwd/certificate-auth.patch")
|| (! -f "$pwd/initscript.patch")
Expand All @@ -54,10 +54,10 @@
$blddir = "/usr/src/packages";
}

#&runcmd("mkdir -p $blddir/SOURCES");
#&runcmd("mkdir -p $blddir/SPECS");
#&runcmd("mkdir -p $blddir/BUILD");
#&runcmd("mkdir -p $blddir/RPMS");
&runcmd("mkdir -p $blddir/SOURCES");
&runcmd("mkdir -p $blddir/SPECS");
&runcmd("mkdir -p $blddir/BUILD");
&runcmd("mkdir -p $blddir/RPMS");

# clean the env
$cmd = "rm -rf $blddir/SOURCES/conserver*";
Expand All @@ -70,7 +70,7 @@
&runcmd($cmd);

# copy the build files
$cmd = "cp -rf ./conserver-8.1.16.tar.gz $blddir/SOURCES/";
$cmd = "cp -rf ./conserver-8.2.1.tar.gz $blddir/SOURCES/";
&runcmd($cmd);

$cmd = "cp -rf ./*.patch $blddir/SOURCES/";
Expand All @@ -82,7 +82,7 @@
$cmd = "rpmbuild -bb $blddir/SPECS/conserver.spec";
&runcmd($cmd);

my $objrpm = "$blddir/RPMS/$arch/conserver-xcat-8.1.16-10.$arch.rpm";
my $objrpm = "$blddir/RPMS/$arch/conserver-xcat-8.2.1-1.$arch.rpm";
my $dstdir = "/tmp/build/$os/$arch";

# check the build result
Expand Down
Binary file added conserver/conserver-8.2.1.tar.gz
Binary file not shown.
12 changes: 3 additions & 9 deletions conserver/conserver.spec
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
#

%define pkg conserver
%define ver 8.1.16
%define ver 8.2.1

# define the name of the machine on which the main conserver
# daemon will be running if you don't want to use the default
# hostname (console)
%define master console

%define distver 10
%define distver 1

Summary: Serial console server daemon/client
Name: %{pkg}-xcat
Expand All @@ -21,10 +21,7 @@ License: BSD
Group: System Environment/Daemons
URL: http://www.conserver.com/
Source: http://www.conserver.com/%{pkg}-%{ver}.tar.gz
Patch: certificate-auth.patch
Patch1: initscript.patch
Patch2: initscript1.patch
Patch3: segfault-sslopt.patch
Patch: initscript_8.2.1.patch
BuildRoot: %{_tmppath}/%{pkg}-buildroot
BuildRequires: openssl-devel
Prefix: %{_prefix}
Expand All @@ -43,9 +40,6 @@ bells and whistles to accentuate that basic functionality.
%{__rm} -rf %{buildroot}
%setup -n %{pkg}-%{ver}
%patch -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1


%build
Expand Down
6 changes: 6 additions & 0 deletions conserver/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
conserver-xcat (8.2.1-1) unstable; urgency=low

* Upgrade to 8.2.1 version

-- chenglch <[email protected]> Wed, 07 Jun 2017 18:05:49 -0500

conserver-xcat (8.1.16-3) unstable; urgency=low

* Changed to conserver-xcat package
Expand Down
1 change: 1 addition & 0 deletions conserver/debian/patches/initscript_8.2.1.patch
5 changes: 1 addition & 4 deletions conserver/debian/patches/series
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
certificate-auth.patch
initscript.patch
initscript1.patch
segfault-sslopt.patch
initscript_8.2.1.patch
161 changes: 161 additions & 0 deletions conserver/initscript_8.2.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
--- conserver-8.2.1_orig/contrib/redhat-rpm/conserver.init 2009-10-08 06:59:58.000000000 +0800
+++ conserver-8.2.1/contrib/redhat-rpm/conserver.init 2017-06-07 15:35:57.000000000 +0800
@@ -7,66 +7,115 @@
# config: /etc/conserver.cf
#

-DAEMON=/usr/sbin/conserver
+### BEGIN INIT INFO
+# Provides: conserver
+# Required-Start:
+# Required-Stop:
+# Default-Start: 2 3 4 5
+# Default-stop:
+# Short-Description: conserver
+# Description: Console server
+### END INIT INFO

-# Source function library.
-. /etc/rc.d/init.d/functions
-
-# Source networking configuration.
-. /etc/sysconfig/network
+RHPassed()
+{
+ passed
+ echo
+}
+RHSuccess()
+{
+ success
+ echo
+}
+RHFailure()
+{
+ failure
+ echo
+}
+MStatus()
+{
+ ps ax|grep -v grep|grep /usr/sbin/conserver >& /dev/null
+ if [ "$?" = "0" ]; then
+ RVAL=0
+ echo "conserver is running"
+ else
+ RVAL=3
+ echo "consever is not running"
+ fi
+ return $RVAL
+}

-# Source defaults
-. /etc/default/conserver

-# Check that networking is up.
-[ ${NETWORKING} = "no" ] && exit 0
+# Source function library.
+if [ -f /etc/rc.d/init.d/functions ]; then
+ . /etc/rc.d/init.d/functions
+ DAEMON=daemon
+ SUCCESS=RHSuccess
+ FAILURE=RHFailure
+ PASSED=RHPassed
+ STATUS=status
+elif [ -f /lib/lsb/init-functions ]; then
+ . /lib/lsb/init-functions
+ DAEMON=start_daemon
+ SUCCESS=log_success_msg
+ FAILURE=log_failure_msg
+ PASSED=log_warning_msg
+ STATUS=MStatus
+else
+ echo "Error, not RedHat and not lsb, do not know how to run this platform"
+fi

# make sure conserver is installed and executable
-[ -x $DAEMON ] || exit 1
+[ -x /usr/sbin/conserver ] || exit 1


-start()
-{
- echo -n "Starting conserver: "
- daemon --user "${RUNAS-}" $DAEMON ${OPTIONS--d}
- RETVAL=$?
- [ "$RETVAL" = 0 ] && touch /var/lock/subsys/conserver
- echo
-}
-
-stop()
-{
- echo -n "Shutting down conserver: "
- killproc conserver
- RETVAL=$?
- [ "$RETVAL" = 0 ] && rm -f /var/lock/subsys/conserver
- echo
-}
-
# See how we were called.
case "$1" in
start)
- start
+ echo -n "Starting conserver: "
+ $DAEMON /usr/sbin/conserver -o -O1 -d
+ touch /var/lock/subsys/conserver
+ $STATUS conserver >& /dev/null
+ if [ "$?" != "0" ]; then
+ $FAILURE
+ exit 1
+ fi
+ $SUCCESS
;;
stop)
- stop
+ $STATUS conserver >& /dev/null
+ if [ "$?" != "0" ]; then
+ echo -n "conserver not running, not stopping "
+ $PASSED
+ exit 0
+ fi
+ echo -n "Shutting down conserver: "
+ killproc conserver
+ rm -f /var/lock/subsys/conserver
+ $STATUS conserver >& /dev/null
+ if [ "$?" == "0" ]; then
+ $FAILURE
+ exit 1
+ fi
+ $SUCCESS
;;
status)
- status conserver
+ $STATUS conserver
+ exit $?
;;
restart)
- stop
- start
- ;;
- reload)
- echo -n "Reloading conserver: "
- killproc conserver -HUP
- RETVAL=$?
- echo
+ $STATUS conserver >& /dev/null
+ if [ "$?" != "0" ]; then
+ exec $0 start
+ else
+ echo -n "Restarting conserver: "
+ killproc conserver -HUP
+ fi
+ $SUCCESS
;;
*)
- echo "Usage: conserver {start|stop|restart|reload|status}"
- RETVAL=1
+ echo "Usage: conserver {start|stop|restart|status}"
+ exit 1
esac

-exit $RETVAL
+exit 0
6 changes: 3 additions & 3 deletions conserver/make_deb.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/bash

tar xvfz conserver-8.1.16.tar.gz
cd conserver-8.1.16
tar xvfz conserver-8.2.1.tar.gz
cd conserver-8.2.1
cp -rL ../debian .
dpkg-buildpackage -uc -us
cd -
rm -rf conserver-8.1.16
rm -rf conserver-8.2.1

0 comments on commit cceacc3

Please sign in to comment.