Background Image
조회 수 1341 추천 수 6 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄 첨부

10.1 버전 부터 linux 용 버전인 CUBRID-10.x.x.xxxx-d56a158-Linux.x86_64.sh를 설치하면

기본 설치 디렉터리가 예전과 다르게 엄청 길어진다.

 

아래의 그림과 같이 보이게 된다.

sh_install.png

 

 

유지관리나 해당 콘솔에서 작업을 할 때 디렉터리명이 길어지면 상당히 불편하다. 이전 버전과 같이 CUBRID로 설치 되게 설치 패키지를 수정해 보자.

 

일단 linux용 버전의 패키지.sh 파일의 구조는 다음과 같다.

 

vi로 열어보면 상단 shell script + 하단 tar with gzip 으로 구성 되어 있다.

sh_install2.png

 

 

그래서 일단 스크립트 부분과 tar+gz 부분을 분리해 보자.

스크립트 소스 네에는 다음과 같은 힌트가 있다.

 

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
cs

 

위에서 526번 라인이 스크립트와 tar+gz의 분리 하는 부분이다. 이 부분을 이용해서 shell script 와 tar+gz을 우선 분리하자.

분리하는 이유는 shell script 소스를 수정하면 라인 수가 변경될 것이기 때문이다.

분리하는 방법은 간단하게 head 명령과 tail명령으로 손쉽게 분리 할 수 있다.

 

[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
cs

 

이제 분리 하였으니 설치용 shell script를 수정 해 보자.

 

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
cs

 

71번 라인으로 가서 보라색 부분을 추가 하도록 한다.(필수)

일단 추가된 라인 수는 2라인이다. 이점을 기억해 두자.

 

추가로 화면에 출력되는 설치 디렉터리 부분을 수정한다.(필수는 아니다)

483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
  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
 
cs

 

486번 라인으로 가면 디폴트 디렉터리를 상단에서 바꾸었지만 스크립트 내에 상수 값으로 디렉터리명이 되어 있으므로 이를 바꾸도록하자.

또한 원본도 유지하기 위해서 원본 라인에는 #를 붙여서 주석으로 변경하고 echo "  \"${toplevel}/\"" 으로 바꾼다.

이로 인하여 추가된 라인 수는 1라인이다. 이점을 기억해 주자.

 

이번에는 실제 디렉터리를 생성하는 구문을 수정해야한다.

방금 위에서 설명한 바로 아래의 if절 부분이다. 라인번호도 표시 해 두었으니 참고하자.

 

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 -"${toplevel}"
fi
cs

 

위의 디렉터리 생성하는 구문인 mkdir를 할때 상수 값으로 지정되어 디렉터리명이 고정 되어 있다. 이를 바꾸도록하자.

 

이제 마지막으로  shell script 내부에서 tar+gz을 발췌하는 부분을 수정한다.

 

520
521
522
523
524
525
526
527
528
529
530
531
# 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"
 
cs

 

위의 613으로 되어 있는 부분을 616으로 수정한다.

위의 설치용 shell script에서 소스 수정으로 추가된 라인 수는 3라인 이므로 추가된 라인수 만큼만 조정하면 된다.

위에서 화면 출력용 부분을 수정하지 않았다면 615이다.

 

이제 해당 부분을 실제 패키지 처럼 합쳐보자. 합치는 방법은 매우 간단하다.

 

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

 

이제 sh instal.sh로 실행하면

다음과 같이 CUBRID 디렉터리로 설치된다.

 

sh_install3.png

 

 


List of Articles
번호 분류 제목 글쓴이 날짜 조회 수 추천 수
124 제품 여행 데이터 베이스 접근 제어와 CUBRID file 윤준수 2020.08.23 2333 0
123 제품 여행 가벼운 웹 프레임워크 Flask위에 CUBRID 얹기 file 윤준수 2020.08.12 2909 1
122 제품 여행 DBeaver Database Tool 큐브리드 사용하기 file 정만영 2020.07.09 8830 0
121 제품 여행 named pipe를 활용한 압축 백업하기. 1 file HiCLASS 2020.05.25 1298 0
120 제품 여행 CUBRID Internal: 큐브리드의 저장공간관리 (DIsk Manager, File Manager) file 김재은 2020.03.31 1596 1
» 제품 여행 linux버전 CUBRID 기본 설치 디렉터리 바꾸기 file HiCLASS 2020.01.21 1341 6
118 제품 여행 LOB 데이터 경로 변경하기 허서진 2020.01.16 2004 0
117 나머지... SSH 공개키 인증을 사용하여 암호 없이 편리하게 원격 호스트에 접속하기-! 허서진 2020.01.03 17263 0
116 제품 여행 LINUX 설정 값 nproc, nofile 과 큐브리드의 관계 강주원 2020.01.03 18801 0
115 나머지... 큐브리드에서의 신입사원 1 김주호 2019.12.31 579 0
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 16 Next
/ 16

Contact Cubrid

대표전화 070-4077-2110 / 기술문의 070-4077-2113 / 영업문의 070-4077-2112 / Email. contact_at_cubrid.com
Contact Sales