2010. 12. 19. 22:27

포트 설치시 ftp.kr.freebsd.org 부터 찾아서 설치하기.

/etc/make.conf

아래 내용 추가

MASTER_SITE_OVERRIDE=ftp://ftp.kr.FreeBSD.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/

2008. 8. 5. 17:14

Problem building p5-Locale-gettext

6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #0: Tue Feb 7 15:47:26 CET 2006

[hunter] /usr/ports/devel/p5-Locale-gettext# make
===> Vulnerability check disabled, database not found
===> Extracting for p5-gettext-1.05_1
=> MD5 Checksum OK for gettext-1.05.tar.gz.
=> SHA256 Checksum OK for gettext-1.05.tar.gz.
===> p5-gettext-1.05_1 depends on file: /usr/local/bin/perl5.8.7 - found
===> Patching for p5-gettext-1.05_1
===> p5-gettext-1.05_1 depends on file: /usr/local/bin/perl5.8.7 - found
===> Applying FreeBSD patches for p5-gettext-1.05_1
===> p5-gettext-1.05_1 depends on file: /usr/local/bin/perl5.8.7 - found
===> p5-gettext-1.05_1 depends on shared library: intl - found
===> Configuring for p5-gettext-1.05_1
checking for gettext… no
checking for gettext in -L/usr/local/lib -lintl -I/usr/local/include… yes
checking for dgettext in -L/usr/local/lib -lintl -I/usr/local/include… yes
checking for ngettext in -L/usr/local/lib -lintl -I/usr/local/include… yes
checking for bind_textdomain_codeset in -L/usr/local/lib -lintl
-I/usr/local/include… yes
Writing Makefile for Locale::gettext
===> Building for p5-gettext-1.05_1
Makefile out-of-date with respect to
/usr/local/lib/perl5/5.8.7/mach/Config.pm
/usr/local/lib/perl5/5.8.7/mach/CORE/config.h
Cleaning current config before rebuilding Makefile…
make -f Makefile.old clean > /dev/null 2>&1 || /bin/sh -c true
/usr/local/bin/perl5.8.7 Makefile.PL “INSTALLDIRS=site” “CC=cc”
“CCFLAGS=-O2 -fno-strict-aliasing -pipe ” “PREFIX=/usr/local”
“INSTALLPRIVLIB=/usr/local/lib” “INSTALLARCHLIB=/usr/local/lib”
checking for gettext… no
checking for gettext in -L/usr/local/lib -lintl -I/usr/local/include… yes
checking for dgettext in -L/usr/local/lib -lintl -I/usr/local/include… yes
checking for ngettext in -L/usr/local/lib -lintl -I/usr/local/include… yes
checking for bind_textdomain_codeset in -L/usr/local/lib -lintl
-I/usr/local/include… yes
Writing Makefile for Locale::gettext
==> Your Makefile has been rebuilt. <==
==> Please rerun the make command. <==
false
*** Error code 1

Stop in /usr/ports/devel/p5-Locale-gettext/work/gettext-1.05.
*** Error code 1

Stop in /usr/ports/devel/p5-Locale-gettext.

Solved.

Hello,

I have got the same error. ” Your Makefile has been rebuilt.”

This is the way I solved it ..

The error:

Makefile out-of-date with respect to /usr/local/lib/perl5/5.8.8/mach/Config.pm /usr/local/lib/perl5/5.8.8/mach/CORE/config.h
Cleaning current config before rebuilding Makefile…
……………………..

Writing Makefile for Locale::gettext
==> Your Makefile has been rebuilt. <==
==> Please rerun the make command. <==
false
*** Error code 1

After searching forums I found it was due to time error ( changing server time after cvsup…)

I checked the time of creation of the files in error.

ls -l /usr/local/lib/perl5/5.8.8/mach/Config.pm
-r–r–r– 1 root wheel 2572 Apr 6 02:59 Config.pm

ls -l /usr/local/lib/perl5/5.8.8/mach/CORE/config.h

-r–r–r– 1 root wheel 135964 Apr 6 02:59 config.h

ls -l /usr/ports/devel/p5-Locale-gettext/Makefile
-rw-r–r– 1 root wheel 575 Apr 6 02:17 Makefile

from the out put we can clearly find out that the Makefile(02:17) for gettext was created before Config.pm( 02:59) and config.h(02:59)

What I did was :

cd /usr/ports/devel/p5-Locale-gettext

mv Makefile Makefile.bak

cat Makefile.bak > Makefile

so the make file got latest creation timestamp.

Then gone back to php extensions port directory and run make install clean again…

Everything worked smoothly….

Cheers Anish

2008. 8. 5. 17:12

FreeBSD에서 MySQL 4.x 설치시 기본 문자셋 지정.

http://database.sarang.net/?inc=read&aid=25048&criteria=mysql&subcrit=&id=&limit=&keyword=&page=

FreeBSD 에서 mysql41-server 포트설치 하실때 기본 문자셋 설정법 입니다.

#cd /usr/ports/databases/mysql41-server

# make WITH_CHARSET=euckr WITH_COLLATION=euckr_korean_ci install clean

이렇게 한줄만 쳐주시면 my.cnf 만들것도 없이 설정 끝납니다.

WITH_CHARSET=euckr 만 주고 컴파일 할경우 euckr 바이너리 화일 없다는 에러만뜨면서

mysql 이 구동되지 않습니다..


상기 두가지 옵션 모두 주고 설치하실경우 mysql 에 접속해서

status 명령치시면

Server characterset: euckr
Db characterset: euckr
Client characterset: euckr
Conn. characterset: euckr
이라고 나오는거 보실수 있을겁니다.


기존 디폴트값으로 (라틴1) 설치하신분들중 pkg_delete 로 삭제시 의존성때문에

클라이언트가 삭제되지 않으실경우

서버및 클라이언트 포트 디렉토리에서 make deinstall 로 서버버전과 클라이언트를 모두 제거하시면 되고 재설치시 install 이 아닌 reinstall 로 설치하시면 잘 작동합니다.

참고로 재설치후 mysql-server.sh 가 아무런 메세지도 없이 실행되지 않는 상태가 될경우

에러로그 보시면 대부분 답이 나오구요 (제경우엔 /etc/rc.subr 화일의 퍼미션과

실행 스크립트의 my.cnf 위치옵션이 업는 디렉토리를 참조하게 되어서 구동이 안되었었습니다.)


작업전 포트 업그레이드 해두시는게 좋겠죠? (현재 4.1.15로 설치됩니다.)


Mysql 4.1 에서

my.cnf 에 디폴트 캐릭터셋 설정은

[mysqld] 섹션이 아니라

[mysql] 섹션이며

default-character-set=euckr

이라는 옵션을 추가하면 적용이 된다라고 하지만

문자셋 바이너리 화일이 컴파일 되지 않고 기본 설치된경우엔 이옵션을 줘도 바이너리 화일없으니

배째라고 해버립니다.. 이 에러메세지를 보시면

euckr_korean_ci 라는 화일이 없다 라는 말이죠..

위에서 WITH_CHARSET=euckr 만 넣어주면 바이너리 화일이 없기때문에 구동불가며

WITH_COLLATION=euckr_korean_ci 만 넣어주면 euckr 문자셋의 바이너리화일은

설치되지만 기본값은 라틴1이며 my.cnf 화일에 저 옵션을 적어줘야 하게되는겁니다.


도움 되시기를..

mysql_install_db
chown -R mysql /var/db/mysql/
chgrp -R mysql /var/db/mysql/
/usr/local/bin/mysqld_safe -user=mysql &

  1. Note: If you encounter Command not found error, use command rehash to update OS path environment variables.
  2. The port installation will put a script file mysql-server.sh in /usr/local/etc/rc.d which will has capability to start MySQL server. To enable MySQL server to start automatically after every FreeBSD server reboot, enter the following command in CLI:echo ‘mysql_enable=”YES”‘ >> /etc/ rc.conf
  3. By default, MySQL default super user account - root - has no password (blank password). So it’s important to assign the administrator account password. To change the password to root user, enter the following command:mysqladmin -u root password newpasswordReplace newpassword with your own desired password.
  4. Optionally, copy either my-huge.cnf, my-large.cnf, my-medim.cnf, my-small.cnf or my-innodb-heavy-4G.cnf (depending on the usage and utilization of MySQL server) as my.cnf to /var/db/mysql which will enable you to tweak and change the configuration of server-specific MySQL server options by editing the file.
  5. MySQL 4.x installation done.

http://www.mydigitallife.info/2006/04/13/installing-web-server-in-freebsd-60-with-apache-22-mysql-50-and-php-5-part-3/


2007. 7. 3. 15:24

Cvsup 소스 업데이트와 커널 빌드하기(STABLE).

cvsup 소스 업데이트와 커널 빌드하기..
cvsup 소스 업데이트 하기.
# cd /usr/ports/net/cvsup && make install
# cvsup -v
CVSup client, non-GUI version
Copyright 1996-2001 John D. Polstra
Software version: SNAP_16_1d
Protocol version: 16.1
Operating system: FreeBSD4
http://www.polstra.com/projects/freeware/CVSup/
Report problems to cvsup-bugs@polstra.com

이제 업그레이드를 해 보자. 4-STABLE로 업그레이드하려면 다음의 명령 하나로 할 수 있다.

# cvsup -g -L2 -h cvsup.kr.FreeBSD.org /usr/share/examples/cvsup/stable-supfile
(# cvsup -g -L2 -h cvsup2.kr.FreeBSD.org /usr/share/examples/cvsup/stable-supfile)

커널(Kernel) 컴파일(Compile)하기  
 글쓴이: 실이아빠 [홈페이지]  글쓴시간: 02/03/18 16:56  읽은수: 1361
‘팁’ 이라기에는 너무 초라하군요. 다들 아시겠지만 말입니다.
저는 사운드 카드를 추가 하면서 커널을 컴파일 해 보았습니다.
사운드 카드는 사운드 블러스트의 Vibra 128 (ES1370/ES1371)를 사용했습니다.
또한 FreeBSD Release 4.5를 사용했습니다.
1. 항상 GENERIC Kernel config 파일을 복사해서 사용합니다.
바꾼 내용을 잃어 버렸을 때에는 GNEERIC Kernel config 파일로 복원을 해야 하거든요.
# cd /usr/src/sys/i386/conf
# cp GENERIC MyKernel
2. 새로 추가된 하드웨어가 있으면 MyKernel을 수정합니다.
* 저는 사운드 카드를 인식하기 위해 아래 줄을 추가 했습니다.
device pcm #pcm0 (ES1370/ES1371)
3. 두가지 방법으로 컴파일을 할 수 있습니다.
※ 첫번째 방법
# cd /usr/src/sys/i386/conf
# usr/sbin/config MyKernel
# cd ../../compile/MyKernel
# make clean
# make depend
# make
# make install
※ 두번째 방법
# cd /usr/src
# make buildkernel KERNCONF=MyKernel
# make installkernel KERNCONF=MyKernel
4. 이렇게 하면 root 디렉토리에(/) 에 처음의 커널은 kernel.GENERIC로 백업이 되며,
방금 MyKernel Kernel Configure 파일로 컴파일 된 것이 kernel로 된다.
5. 시스템을 리부팅한다.
# sync
# shutdown -r now (or reboot)

2007. 7. 3. 15:22

Clockspeed를 이용한 시간 동기화.

Clockspeed를 이용한 시간 동기화.


D. J. Bernstein 이 만든 clockspeed는 NTP 프로토콜을 사용해 믿을만한 소스와의 시간 동기화에 쓰이는 sntpclock,
로컬 네트워크상의 컴퓨터들의 시간을 동기화 시키는데 쓰이는 데몬과 클라이언트 (taiclockd, taiclock)등을 포함하고 있다.


1. 컴파일/설치
2. 시간 조정
3. 정확한 시간으로 유지하기
4. 로컬 네트워크의 시간 동기화
5. daemontools로 clockspeed 구동하기


1. 컴파일 / 설치
?ClockSpeed 소스를 다운로드 한다.
http://cr.yp.to/clockspeed.html 사이트 참고


다운로드
http://cr.yp.to/clockspeed/clockspeed-0.62.tar.gz



# tar xzf clockspeed-0.62.tar.gz# cd clockspeed-0.62# make# make setup check


파일들은 /usr/local/clockspeed/ 에 설치되며 /etc/leapsecs.dat도 생긴다.
실행파일들은 /usr/local/clockspeed/bin 에 설치되므로 $PATH에 추가해준다.
(아래 와 같이 make시에 에러가 발생된다면 패치를 적용한후 컴파일 한다.

http://qmail.kldp.org/src/patches/glibc-2.3.1/clockspeed-0.62.errno.patch => glibc 2.3.1. 이상에서는 컴파일 에러가 됨.

make시 에러 문구 내용.


*** clockview.c:46: warning: return type of `main’ is not `int’


직접 에러패치 파일을 만들수도 있다.
# wget http://www.bsdian.com/~master/clockspeed-0.62.errno.patch혹은, 아래 처럼 만들자..# vi clockspeed-0.62.errno.patch
diff -u clockspeed-0.62.old/clockview.c clockspeed-0.62/clockview.c— clockspeed-0.62.old/clockview.c 1998-10-13 12:37:49.000000000 -0500+++ clockspeed-0.62/clockview.c 2003-05-08 09:59:26.000000000 -0500@@ -1,5 +1,6 @@ #include #include +#include #include “substdio.h” #include “readwrite.h” #include “strerr.h”diff -u clockspeed-0.62.old/error.h clockspeed-0.62/error.h— clockspeed-0.62.old/error.h 1998-10-13 12:37:49.000000000 -0500+++ clockspeed-0.62/error.h 2003-05-08 09:07:13.000000000 -0500@@ -1,7 +1,7 @@ #ifndef ERROR_H #define ERROR_H -extern int errno;+#include extern int error_intr; extern int error_nomem;diff -u clockspeed-0.62.old/leapsecs_read.c clockspeed-0.62/leapsecs_read.c— clockspeed-0.62.old/leapsecs_read.c 1998-10-13 12:37:49.000000000 -0500+++ clockspeed-0.62/leapsecs_read.c 2003-05-08 09:07:13.000000000 -0500@@ -2,7 +2,6 @@ #include #include #include -extern int errno; #include “tai.h” #include “leapsecs.h”
패치 적용하는 방법 아래 참고.
If you have glibc-2.3.1 then none of the software written by djb willcompile because of an incompatible declaration of errno.Here you can find patches correcting this problem, and source rpmswhich use these patches.To use the patches==================From the top distribution directory, apply the appropriate errno patchwith -p1. So, for example, for djbdns, you would dotar zxvf djbdns-1.05.tar.gzcd djbdns-1.05patch -p1 < /path/to/djbdns-1.05.errno.patch참고 : http://qmail.org/moni.csi.hu/pub/glibc-2.3.1/패치를 하였으니 컴파엘에 들어간다…


#make#make setup check컴파일 성공적으로 되었다면, 시간 조정에 들어간다.
2. 시간조정


일단 정확한 시간 소스를 제공할 믿을 만한 ?NTp 서버를 사용해야 하는데, ntp.nasa.gov 를 사용하자….
ntp.nasa.gov의 ip 주소는 198.123.30.132 이다.
NTP 서버의 ip를 이용하여, 자신의 시스템과 NTP 서버간의 시간 차이를 알아보자.
www:~# sntpclock 198.123.30.132 | clockviewbefore: 2004-10-04 08:34:03.420452000000000000after: 2004-10-04 11:21:28.786438787944868206위에서 본것 같이 꽤 차이가 나고 있다… 다음을 실행하여 시간을 맞춘다.


www:~# sntpclock 198.123.30.132 | clockadd다시 얼마나 차이가 나는지 재확인..


www:~# sntpclock 198.123.30.132 | clockviewbefore: 2004-10-04 11:22:02.452292000000000000after: 2004-10-04 11:22:02.452249708414793014거의 시간차이가 없음을 알수 있다.
3. 정확한 시간으로 유지하기
RTC 자체의 부정확함 때문에 한번 시간을 정확히 맞추었다 하더라도 얼마간의 시간이
지나면 다시 오차가 생기기에, 이것을 막기 위해 clockspeed를 다음과 같은 방법으로 실행해줌.


1. clockspeed를 실행하고 NTP 서버와의 오차를 기록한다…
$ clockspeed &$ sntpclock 198.123.30.132 > /usr/local/clockspeed/adjust &


2. 몇시간 뒤에 다시 오차를 clockspeed에게 알려준다.
 $ sntpclock 198.123.30.132 > /usr/local/clockspeed/adjust &


3. 몇일 후에 오차를 확인해보고 위 과정을 반복한다.
$ sntpclock 198.123.30.132 | clockview$ sntpclock 198.123.30.132 > /usr/local/clockspeed/adjust &


4. 3번과정을 몇주후, 몇개월 후에 한번 실행해주면 NTP 서버와 거의 오차가 없는 완벽한 동기화가 이뤄짐…
5. daemontools로 clockspeed 구동하기.
다음 내용은 홍덕기 님의 자료를 인용.

◦ daemontools에 clockspeed 서비스 디렉토리를 생성.

#mkdir /var/service/clockspeed

◦ 서비스의 실행 스크립트를 생성

#vi /var/service/clockspeed/run#!/bin/shexec 2>&1PATH=”/usr/local/clockspeed/bin:/sbin:/usr/sbin:/bin:/usr/bin:$PATH”exec clockspeed
◦ run 스크립트를 샐행 모드로 설정해준다.

$ chmod 755 /var/service/clockspeed/run

◦ daemontools 서비스로 실행

#ln -s /var/service/clockspeed /service 위와 같이 하면 항상 백그라운드로 clockspeed를 띄워 둘 수 있다.
아래와 같이 백그라운드에 항상 실행되어 있는 것을 알수 있다.
# ps ax 975 pts/0 Ss 0:00 -bash 976 pts/0 S 0:00 -su 996 pts/0 S 0:00 clockspeed 1080 ? S 0:00 supervise clockspeed 1081 ? S 0:00 clockspeed 1088 pts/0 R+ 0:00 ps ax


출처: http://people.kldp.org/~eunjea/clockspeed.php#install