SYBASE – init Script and locale error

SYBASE 에서 다음의 init 스크립트를 사용중 stop시 locale 에러가 나타나는 것을 확인했다.

jonathan@jonathan-laptop:/opt/sybase/ASE-15_0/install$ cat /etc/init.d/sybase
#!/bin/sh
#
# Startup script for Sybase ASE
#
# description: Sybase Adaptive Server Enterprise
# is a SQL database server.
# processname: dataserver
 

SYBASE=/opt/sybase
SERVER=JONATHANLAPTOP
LANG=ko_KR.euckr
export LANG
 

# Source environment variables.
. $SYBASE/SYBASE.sh
 

# Find the name of the script
NAME=`basename $0`
 

# For SELinux we need to use ‘runuser’ not ‘su’
if [ -x /sbin/runuser ]
then
    SU=runuser
else
    SU=su
fi
 

start() {
    SYBASE_START=$”Starting ${NAME} service: “
    $SU root -c “. $SYBASE/SYBASE.sh; $SYBASE/$SYBASE_ASE/install/startserver
-f $SYBASE/$SYBASE_ASE/install/RUN_${SERVER} > /dev/null”
    ret=$?
    if [ $ret -eq 0 ]
    then
        echo “$SYBASE_START Success.”
    else
        echo “$SYBASE_START Failed!”
              exit 1
    fi
}
 

stop() {
    echo -n $”Stopping ${NAME} service: “
    $SU root -c “. $SYBASE/SYBASE.sh; isql -S $SERVER -U sa -P ” <
$SYBASE/$SYBASE_ASE/upgrade/shutdown.sql > /dev/null”
    ret=$?
    if [ $ret -eq 0 ]
    then
        echo “Success.”
    else
        echo “Failed!”
        exit 1
    fi
}
 

restart() {
    stop
    start
}
 

case “$1” in
 

    start)
        start
        ;;
    stop)
        stop
        ;;
    restart)
        restart
        ;;
    *)
        echo $”Usage: $0 {start|stop|restart}”
        exit 1
esac
exit 0

 에러메시지의 내용은 다음과 같다.

jonathan@jonathan-laptop:/opt/sybase/ASE-15_0/install$ sudo /etc/init.d/sybase stop
$Stopping sybase service:

The context allocation routine failed when it tried to load localization files!!
One or more following problems may caused the failure

Your sybase home directory is /opt/sybase. Check the environment variable SYBASE if it is not the one you want!
Using locale name “ko_KR.UTF-8” defined in environment variable LANG
Locale name “ko_KR.UTF-8” doesn’t exist in your /opt/sybase/locales/locales.dat file
Success.

 제일 마지막 메시지에는 Success 라고 나와있지만 ps -ef|grep sybase 명령어로 확인해본 결과 대부분의 프로세스들이 그대로 돌고있는 것을 확인할 수 있었다.

 무엇이 문제일까.

 에러 메시지에서 해답을 찾았다. 내가 사용하는 “ko_KR.UTF-8” locale을 정의(찾을 수)없다는 메시지였다.

 먼저 내가 사용하는 리눅스에서의 로케일을 변경하려고 했으나 생각되로 잘 되지 않았다. 왜냐하면 SYBASE에서 어떤 로케일들을 지원하는지 아직 몰랐기 때문이다.

 SYBASE에서 지원하는 locale 하는 로케일은 다음의 파일에서 찾을 수 있다.

/opt/sybase/locales/locales.dat

 방법은 두가지가 있다. SYBASE에서 지원하는 로케일에 맞추거나 위의 파일에 자신이 사용하는 로케일을 추가하거나.

 필자는 로케일을 추가하는 방법을 선택하였다.

/opt/sybase/locales/locales.dat

 파일을 열어 자신의 OS를 찾아 아래쪽에 양식에 맞게 추가하도록 하자.

[linux]
        locale = ko_KR.UTF-8, korean, eucksc
        locale = ko_KR.949, korean, cp949
        locale = korean.euc, korean, eucksc

위쪽 굵게 표시한 부분이 필자가 추가한 부분이다.

이후, 아무런 에러 메시지 없이 정상적으로 종료가 되는 것을 확인할 수 있었다.

jonathan@jonathan-laptop:/opt/sybase/ASE-15_0/install$ sudo /etc/init.d/sybase stop
$Stopping sybase service: Success.

테스트 OS : UbuntuLinux_Desktop-10.04

알수없는 에러….

 컴파일중 이상한 오류를 발견했다..

/usr/local/arm/arm-linux/sys-include/asm/fcntl.h:74: parse error before “pid_t”
/usr/local/arm/arm-linux/sys-include/asm/fcntl.h:80: parse error before “loff_t”
/usr/local/arm/arm-linux/sys-include/asm/fcntl.h:82: parse error before “l_pid”

 단순한 프로그램이었는데…이상했다.

 이렇게도 바꾸고 저렇게도 바꾸어서 원인을 찾았는데…

 답은 헤더 파일의 입력 순서에 있었다.

 원래는..

#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
#include <asm/fcntl.h>
#include <stdio.h>

였는데…

이를 다음과 같이 바꾸니 문제가 해결되었다..

#include <stdlib.h>
#include <unistd.h>
#include <sys/mman.h>
#include <asm/fcntl.h>
#include <stdio.h>

 개운하지가 않다.

 문제는 해결했는데 어찌 해결했는지를 모르겠다….

 분명 헤더파일의 입력때문에 뭔가가 엉킨것 같은데….꼭 집어내지를 못하겠다.

 

Ubuntu Amarok error “Fingerprinting of .mp3 files is not supported”

 우분투에서 Amarok 사용시 발생한 에러이다.

 Music Brainz를 사용하려 했더니 다음과 같은 에러가 발생했다.

“Fingerprinting of .mp3 files is not supported”

사용자 삽입 이미지
 이는 특정 패키지를 설치하지 않아서 생기는 에러이다.

 콘솔창에 다음과 같이 명령어를 입력하면 문제는 해결된다. : )

 sudo apt-get install libtunepimp5-mp3

 이제 Amarok를 재시작한 후, Music Braiz를 사용해보자.

 아주 잘 될것이다. : )
사용자 삽입 이미지
 관련 링크 : http://www.howtogeek.com/howto/ubuntu/fix-amarok-error-fingerprinting-of-mp3-files-is-not-supported/

error: multiple types in one declaration

 g++ 컴파일 중 다음과 같은 에러 메시지를 확인했다.

 error: multiple types in one declaration

 위와 같은 메시지가 발생하는 이유는 간단하다

 클래스나 구조체의 마지막에 세미콜론을 잊어 버려서 생기는 에러이다. 생각보다 간단하다.

 하지만 이 세미콜론을 잊어버린 곳 찾기가 가끔은 쉽지 않을 경우가 있다. (…나처럼)