-rw-r--r--  1 root root   2174 Nov 10  2015 install.sh^M


drwxr-xr-x  2 root root   4096 Jan 11 12:56 ^[[01;34mmonitor^[[0m^M


drwxr-xr-x  4 root root   4096 Nov 17 11:42 ^[[01;34mreboot^[[0m^M


-rw-r--r--  1 root root    633 Nov  1 11:13 reboot.sh^M


-rw-r--r--  1 root root    643 Nov 17 11:05 reboot.sh.1^M






위처럼




script 명령어로 파일 저장하고 vi로 열어보면 마지막 ^M 엔터표시 있다.




script 명령어 아니여도 윈도우에서 파일 저장한거 리눅스에서 연다던지 하면 저런 ^M 표시 있을수있다.




저거 지우는 명령어는




perl -p -i -e "s/\r//g" filename

root@localhost:/opt/mysql/scripts# ./mysql_install_db --base-dir=/opt/mysql --datadir=/opt/mysql/data




FATAL ERROR: Could not find ./bin/my_print_defaults




If you compiled from source, you need to run 'make install' to


copy the software into the correct location ready for operation.




If you are using a binary release, you must either be at the top


level of the extracted archive, or pass the --basedir option


pointing to that location.






FATAL ERROR: Could not find ./bin/my_print_defaults


위 에러 처럼 경로를 제대로 못찾고있다.


해결은


vi로 ./mysql_install_db 열어서


 21 basedir="/opt/mysql"

 22 builddir=""

 23 ldata="/opt/mysql/data"



위 라인에 직접 basedir ldata 에 직접 경로 넣어주고


./mysql_install_db


위에처럼 basedir 이나 datadir 옵션 주지말고 그냥 실행하면됨

~/script/xtables-addons-2.0]# make -j 8

make  all-recursive

make[1]: Entering directory `/root/script/xtables-addons-2.0'

Making all in extensions

make[2]: Entering directory `/root/script/xtables-addons-2.0/extensions'

make -f ../Makefile.iptrules all;

Xtables-addons 2.0 - Linux make[3]: Entering directory `/root/script/xtables-addons-2.0/extensions'

  CC     libxt_geoip.oo

  CCLD   libxt_geoip.so

make[3]: Leaving directory `/root/script/xtables-addons-2.0/extensions'

2.6.32-642.6.2.el6.x86_64

if [ -n "/lib/modules/2.6.32-642.6.2.el6.x86_64/build" ]; then make -C /lib/modules/2.6.32-642.6.2.el6.x86_64/build M=/root/script/xtables-addons-2.0/extensions modules; fi;

make[3]: Entering directory `/usr/src/kernels/2.6.32-642.6.2.el6.x86_64'

  CC [M]  /root/script/xtables-addons-2.0/extensions/compat_xtables.o

  CC [M]  /root/script/xtables-addons-2.0/extensions/xt_geoip.o

In file included from /root/script/xtables-addons-2.0/extensions/compat_xtables.h:7,

                 from /root/script/xtables-addons-2.0/extensions/xt_geoip.c:25:

/root/script/xtables-addons-2.0/extensions/compat_xtnu.h:21: warning: 'struct xt_action_param' declared inside parameter list

/root/script/xtables-addons-2.0/extensions/compat_xtnu.h:21: warning: its scope is only this definition or declaration, which is probably not what you want

/root/script/xtables-addons-2.0/extensions/compat_xtnu.h:36: warning: 'struct xt_action_param' declared inside parameter list

In file included from /root/script/xtables-addons-2.0/extensions/xt_geoip.c:25:

/root/script/xtables-addons-2.0/extensions/compat_xtables.h:12:3: warning: #warning Kernels below 3.7 not supported.

In file included from /root/script/xtables-addons-2.0/extensions/compat_xtables.c:26:

/root/script/xtables-addons-2.0/extensions/compat_xtnu.h:21: warning: 'struct xt_action_param' declared inside parameter list

/root/script/xtables-addons-2.0/extensions/compat_xtnu.h:21: warning: its scope is only this definition or declaration, which is probably not what you want

/root/script/xtables-addons-2.0/extensions/compat_xtnu.h:36: warning: 'struct xt_action_param' declared inside parameter list

/root/script/xtables-addons-2.0/extensions/compat_xtables.c:32: warning: 'struct xt_action_param' declared inside parameter list

/root/script/xtables-addons-2.0/extensions/compat_xtables.c: In function 'xtnu_target_run':

/root/script/xtables-addons-2.0/extensions/compat_xtables.c:34: error: dereferencing pointer to incomplete type

/root/script/xtables-addons-2.0/extensions/compat_xtables.c:36: warning: passing argument 2 of 'nt->target' from incompatible pointer type

/root/script/xtables-addons-2.0/extensions/compat_xtables.c:36: note: expected 'const struct xt_action_param *' but argument is of type 'const struct xt_action_param *'

/root/script/xtables-addons-2.0/extensions/compat_xtables.c: In function 'xtnu_register_target':

/root/script/xtables-addons-2.0/extensions/compat_xtables.c:60: warning: assignment from incompatible pointer type

/root/script/xtables-addons-2.0/extensions/compat_xtables.c:61: warning: assignment from incompatible pointer type

/root/script/xtables-addons-2.0/extensions/xt_geoip.c:190: warning: 'struct xt_action_param' declared inside parameter list

/root/script/xtables-addons-2.0/extensions/xt_geoip.c: In function 'xt_geoip_mt6':

/root/script/xtables-addons-2.0/extensions/xt_geoip.c:192: error: dereferencing pointer to incomplete type

/root/script/xtables-addons-2.0/extensions/xt_geoip.c: At top level:

/root/script/xtables-addons-2.0/extensions/xt_geoip.c:244: warning: 'struct xt_action_param' declared inside parameter list

/root/script/xtables-addons-2.0/extensions/xt_geoip.c: In function 'xt_geoip_mt4':

/root/script/xtables-addons-2.0/extensions/xt_geoip.c:246: error: dereferencing pointer to incomplete type

/root/script/xtables-addons-2.0/extensions/xt_geoip.c: At top level:

/root/script/xtables-addons-2.0/extensions/xt_geoip.c:330: warning: initialization from incompatible pointer type

/root/script/xtables-addons-2.0/extensions/xt_geoip.c:331: warning: initialization from incompatible pointer type

/root/script/xtables-addons-2.0/extensions/xt_geoip.c:340: warning: initialization from incompatible pointer type

/root/script/xtables-addons-2.0/extensions/xt_geoip.c:341: warning: initialization from incompatible pointer type

make[4]: *** [/root/script/xtables-addons-2.0/extensions/compat_xtables.o] Error 1

make[4]: *** Waiting for unfinished jobs....

make[4]: *** [/root/script/xtables-addons-2.0/extensions/xt_geoip.o] Error 1

make[3]: *** [_module_/root/script/xtables-addons-2.0/extensions] Error 2

make[3]: Leaving directory `/usr/src/kernels/2.6.32-642.6.2.el6.x86_64'

make[2]: *** [modules] Error 2

make[2]: Leaving directory `/root/script/xtables-addons-2.0/extensions'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/root/script/xtables-addons-2.0'

make: *** [all] Error 2




cent 6버전에 xtables2점대 설치시 버전 안맞아서 이런 저런 에러 나는듯....


iptables에 geoip 설정만 되면 되니까 걍 xtables1.4.7 버전 설치해도 상관없음


ps.

xtables 설치시 mconfig에 geoip 빼고 다 주석해도 상관없음

어차피 iptables geoip만 적용되면 되니까 딴건 필요없음















~/script/xtables-addons-1.47.1]# make -j 8

make  all-recursive

make[1]: Entering directory `/root/script/xtables-addons-1.47.1'

Making all in extensions

make[2]: Entering directory `/root/script/xtables-addons-1.47.1/extensions'

make -f ../Makefile.iptrules all;

Xtables-addons 1.47.1 - Linux make[3]: Entering directory `/root/script/xtables-addons-1.47.1/extensions'

  CC     libxt_geoip.oo

  CCLD   libxt_geoip.so

make[3]: Leaving directory `/root/script/xtables-addons-1.47.1/extensions'

2.6.32-642.6.2.el6.x86_64

if [ -n "/lib/modules/2.6.32-642.6.2.el6.x86_64/build" ]; then make -C /lib/modules/2.6.32-642.6.2.el6.x86_64/build M=/root/script/xtables-addons-1.47.1/extensions modules; fi;

make[3]: Entering directory `/usr/src/kernels/2.6.32-642.6.2.el6.x86_64'

  CC [M]  /root/script/xtables-addons-1.47.1/extensions/compat_xtables.o

  CC [M]  /root/script/xtables-addons-1.47.1/extensions/xt_geoip.o

/root/script/xtables-addons-1.47.1/extensions/compat_xtables.c: In function 'xtnu_ipv6_find_hdr':

/root/script/xtables-addons-1.47.1/extensions/compat_xtables.c:633: error: too few arguments to function 'ipv6_find_hdr'

make[4]: *** [/root/script/xtables-addons-1.47.1/extensions/compat_xtables.o] Error 1

make[4]: *** Waiting for unfinished jobs....

make[3]: *** [_module_/root/script/xtables-addons-1.47.1/extensions] Error 2

make[3]: Leaving directory `/usr/src/kernels/2.6.32-642.6.2.el6.x86_64'

make[2]: *** [modules] Error 2

make[2]: Leaving directory `/root/script/xtables-addons-1.47.1/extensions'

make[1]: *** [all-recursive] Error 1

make[1]: Leaving directory `/root/script/xtables-addons-1.47.1'

make: *** [all] Error 2


위에 에러는 커널 뭐 어쩌구 안맞아서 설치가 안된단다. 


vim /lib/modules/2.6.32-642.6.2.el6.x86_64/build/include/linux/autoconf.h 

열어서
1574 /*#define CONFIG_IP6_NF_IPTABLES_MODULE 1*/

위에 처럼 주석한다.  /* 내용 */ 하면 안에있는것들 주석됨



+ Recent posts