DOCUMENTATION

?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print

Author: Sungjin Kim

 

If you install CUBRID-10.x.x.xxxx-d56a158-Linux.x86_64.sh which is the version for Linux from 10.1 version. The default installation directory is very long, and it will look like the picture below.

sh_install.png

It is quite inconvenient if the directory name is long when performing maintenance or the corresponding console. Therefore, let's modify the installation package to be installed with CUBRID as in the previous version.

 

First of all, the structure of the package.sh file for the Linux version is as follows; and if you open it with vi, it consists of the top shell script + the bottom tar with gzip.

sh_install2.png

 

So, let's separate the script part and the tar+gz part.

There are following hints in the script:

518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
# take the archive portion of this file and pipe it to tar
# the NUMERIC parameter in this command should be one more
# than the number of lines in this header file
# there are tails which don't understand the "-n" argument, e.g. on SunOS
# OTOH there are tails which complain when not using the "-n" argument (e.g. GNU)
# so at first try to tail some file to see if tail fails if used with "-n"
# if so, don't use "-n"
use_new_tail_syntax="-n"
tail $use_new_tail_syntax +1 "$0" > /dev/null 2> /dev/null || use_new_tail_syntax=""
  
tail $use_new_tail_syntax +613 "$0" | gunzip | (cd "${toplevel}" && tar xf - 2> /dev/null) || cpack_echo_exit "Problem unpacking the CUBRID-10.2.0.8797-d56a158-Linux.x86_64"
  
echo "Unpacking finished successfully"
  
#
# post-setup for CUBRID

Line 526 is the separation between the script and tar+gz. Let's use this part to separate the shell script and tar+gz first. The reason for separation is that modifying the shell script source will change the number of lines. The separation method can be easily separated with a head command and a tail command.

[root@ ~]# head -612 CUBRID-10.2.0.8797-d56a158-Linux.x86_64.sh > install.sh
[root@ ~]# tail -n +613 CUBRID-10.2.0.8797-d56a158-Linux.x86_64.sh > cubrid.tgz

 

Now that we've separated it, let's modify the shell script for installation.

66
67
68
69
70
71
72
73
74
cpack_version
echo "This is a self-extracting archive."
toplevel="`pwd`"
if [ "x${cpack_prefix_dir}x" != "xx" ]
then
  toplevel="${cpack_prefix_dir}"
else
  toplevel="${toplevel}/CUBRID"
fi

Required: Adding the part as shown in line 71.  (please keep in mind that once added, the number of lines added is 2 lines.)

 

Not required: In addition, modify the part of the installation directory displayed on the screen.

483
484
485
486
487
488
489
490
491
492
493
494
495
496
if [ "x${cpack_include_subdir}x" = "xx" ]
 then
   echo "By default the CUBRID will be installed in:"
   #echo "  \"${toplevel}/CUBRID-10.2.0.8797-d56a158-Linux.x86_64\""
   echo "  \"${toplevel}/\""
   echo "Do you want to include the subdirectory CUBRID-10.2.0.8797-d56a158-Linux.x86_64?"
   echo "Saying no will install in: \"${toplevel}\" [Yn]: "
   read line leftover
   cpack_include_subdir=TRUE
   case ${line} in
     n* | N*)
       cpack_include_subdir=FALSE
   esac
 fi

If you go to line 486, the default directory path has been changed at the top, but let's change it because the directory name is a constant value in the script.

Also, to keep the original, add # to the original line, change it to a comment, and replace it with echo "\"${toplevel}/\"". Due to this, the number of added lines is one line. Let's remember this!

 

Next, we need to modify the syntax for creating the actual directory.

This is the if clause just below, just described above. The line number is also displayed for reference.

499
500
501
502
503
if [ "x${cpack_include_subdir}x" = "xTRUEx" ]
then
  #toplevel="${toplevel}/CUBRID-10.2.0.8797-d56a158-Linux.x86_64"
  mkdir -p "${toplevel}"
fi

When mkdir, the syntax for creating the above directory, is specified as a constant value, the directory name is fixed. Let's change this.

 

 

Now, finally, edit the extract of tar+gz inside the shell script.

520
521
522
523
524
525
526
527
528
529
530
# take the archive portion of this file and pipe it to tar
# the NUMERIC parameter in this command should be one more
# than the number of lines in this header file
# there are tails which don't understand the "-n" argument, e.g. on SunOS
# OTOH there are tails which complain when not using the "-n" argument (e.g. GNU)
# so at first try to tail some file to see if tail fails if used with "-n"
# if so, don't use "-n"
use_new_tail_syntax="-n"
tail $use_new_tail_syntax +1 "$0" > /dev/null 2> /dev/null || use_new_tail_syntax=""
  
tail $use_new_tail_syntax +616 "$0" | gunzip | (cd "${toplevel}" && tar xf - 2> /dev/null) || cpack_echo_exit "Problem unpacking the CUBRID-10.2.0.8797-d56a158-Linux.x86_64"

The above section 613 is modified to 616. In the above installation shell script, the number of lines added by source modification is 3 lines, so you only need to adjust the number of lines added. If you haven't edited the screen output part above, it's 615.

 

Now let's put that part together like a real package. The merge is very simple.

[root@ ~]# cat cubrid.tgz >> install.sh

 

Now if we execute sh instal.sh, the CUBRID directory is installed as follows:

sh_install3.png


  1. Compressing Backup by Named Pipe

    Date2020.07.17 CategoryServer
    Read More
  2. The CUBRID’s Access_control (ACL) Feature

    Date2020.07.15 CategoryServer
    Read More
  3. Replace the Linux Version CUBRID Default Installation Directory

    Date2020.07.14 CategoryServer
    Read More
  4. Checking the Port Open Status with the CUBRID port and OS Command

    Date2020.07.14 CategoryServer
    Read More
  5. Forward Engineering a Data Model with ERwin

    Date2020.07.14 CategoryTools
    Read More
  6. Reverse Engineering CUBRID Database with ERwin

    Date2020.07.14 CategoryTools
    Read More
  7. The Types of Error and Log Generated by CUBRID

    Date2020.07.13 CategoryServer
    Read More
  8. [CUBRID Utility] Let’s learn about restoreslave!

    Date2020.07.13 CategoryServer
    Read More
  9. Exploring CUBRID’s Useful Commands

    Date2020.07.13 CategoryServer
    Read More
  10. Introduction to CUBRID Security – Part II

    Date2020.06.26 CategoryServer
    Read More
Board Pagination Prev 1 2 3 4 Next
/ 4

Join the CUBRID Project on

 

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

나눔고딕 사이트로 가기

Sketchbook5, 스케치북5

Sketchbook5, 스케치북5