2007년 8월 28일 화요일

Zone Configuration, Booting, Configuring IP (#Solaris)

ZONE CONFIGURATION

The following commands are basic guidelines to configure a simple zone.

1. Make a directory to accommodate a zone, changing its level to 700 is required since the global zone
should not be seen from child zone
2. Use "zonecfg" commands to create a zone
3. Network settings and File system settings are required (fs,net)
4. verify, commit, exit is required to save zone settings.
5. The information of the zone is saved under "/etc/zones" in the form of .xml files


[jemin][$PWD] # mkdir /export/sample_server
[jemin][$PWD] # chmod 700 /export/sample_server
[jemin][$PWD] # zonecfg -z sample_server
sample_server: 그런 영역은 구성되지 않음
새 영역 구성을 시작하려면 'create'을(를) 사용하십시오.
zonecfg:sample_server> create
zonecfg:sample_server> set zonepath=/export/sample_server
zonecfg:sample_server> add net
zonecfg:sample_server:net> set physical=e1000g0
zonecfg:sample_server:net> set address=192.168.40.1
zonecfg:sample_server:net> end
zonecfg:sample_server> add fs
zonecfg:sample_server:fs> set dir=/goodies -This is a directory in child zone
zonecfg:sample_server:fs> set special=/usr/local -This is a directory in global zone that will be mounted as "/goodies" in child zone. Working with this directory has direct effect on the mounted directory in child zone
zonecfg:sample_server:fs> add options [rw,nodevices]
zonecfg:sample_server:fs> set type=lofs
zonecfg:sample_server:fs> end
zonecfg:sample_server> verify
zonecfg:sample_server> commit
zonecfg:sample_server> exit
[jemin][$PWD] #

ZONE INSTALLATION

[jemin][$PWD] # zoneadm -z sample_server install


ZONE BOOTING

Booting zones require two terminals

1. On the first terminal,
[jemin][$PWD] # zlogin -C sample_server

2. On the second terminal
[jemin][$PWD] # zoneadm -z sample_server boot

3. If the booting process is successful, installing process of the zone shows up which looks similar to installing process of the solraris OS. Choosing appropriate options will successfully load zones to be active.


CONFIGURING IP of the ZONE

There is no limit in allocating IP to the zone. However, allocating IP to a zone is only possible from the global zone. This process can be implemented using "ifconfig" command

[jemin][$PWD] # ifconfig e1000g0:1 "IP address/netmask" up

2007년 8월 11일 토요일

Solaris - Gnome screen endless repitition (Eating up CPU)

I am a user of Open Solaris Nevada b64a, running it on LG Xnote R-500 series with Nvidia 8400 series on board.
Recently I have happened to come across an annoying error related to Gconfd(Gnome 2.16)

After entering the username and password, the login screen keeps on appearing. Other modes(such as failsafe modes, CDE login) works fine. However the JDS login did not work out, printing out an error message saying that it is unable to share any resources.

#sh NVIDIA....
#nvidia-xconfig ( this showed an "Segmentation fault" error, transitioning it to core dumping)

I managed to get it fixed by removing the NVIDIA pakage manually(pkgrm), then installing it again. This does not seems to be the proper way to troubleshoot however it works out fine.
I would be grateful to hear any better explanation of this phenonmenon.

2007년 8월 5일 일요일

Admin을 위한 일반 명령어 (펌)

Admin을 위한 일반 명령어

현재 시스템의 Architecture를 확인
# arch -k : Display The kernel architecture
Inode 삭제 명령어
# clrl /dev/dsk/c0t1d0s7 231 : 231 inode를 삭제

Text파일에서 특정 문자 추출해내는 명령
# cut -d":" -f1 /etc/passwd > /tmp/user : passwd file에서 유저부분만 추출해서 /tmp/user 파일로 저장
# ypcat passwd cut -d":" -f1 > /tmp/user

Disk 사용량 계산
# du -s . : 현재 및 SUB-dir까지의 전체 Disk사용량 (du:disk use)
-k . : killo byte 단위로 확인
Text file의 비교와 Directory간의 상이한 내용의 비교
# diff /a /mnt : /a, /mnt directory 를 비교
# diff /a /b : /a, /b Text file 의 비교
EEPROM의 내용을 명령행 에서 변경
# /usr/sbin/eeprom : 상태확인
# /usr/sbin/eeprom boot-device=disk3 : 값 변경
File type을 확인 할때
# file /etc/passwd /etc/passwd: 아스키 텍스트
# file core core : ELF 32-비트 MSB 코어 파일 SPARC 버전 1, 원인수행 'sleep'
: core file 이 왜 생성됬는지 보고 하고 있다.

File or Directory 을 지울때
# rm file_name ; 단일 파일을 지운다.
# rm -r /dir_name ; 디렉토리까지 전부 삭제한다.
# rm -i file_name ; "-i"옵션은 파일을 지우기 전에 한번 더 확인한다.
# rm 'file name' ; 중간에 공백이 있는 파일 지울때.
File 검색을 위한 명령어
# find ~ -name '*%' -print -exec rm {} \;
: home 디렉토리 '%'로 끝나는 화일 탐색하여 보여주면서 삭제
Option 분류(검색기능이 상당히 많다. man page로 확인)
-atime n ; accessed n days ago
-ctime n ; change n days ago
-mtime n ; midified n days ago
-perm ; 해당 되는 퍼미션 파일 검색

Key input 제대로 안될 때 Remote에서 Key mode를 바꾼다.
# kbd_mode -a

Process를 강제 종료 시킬때
# kill pid : 통상 process 종료 시킬때
# kill -9 pid : 강제 종료 시킬때
# kill -HUP pid : process를 hangup
# kill -SEGV pid : process를 강제로 segmentation fault 시킬때
Process관련 명령어
/usr/proc/bin Directory에 다수가 있다.
proc tools -
proc, pflags, pcred, pmap, pldd, psig, pstack, pfiles, pwdx, pstop, prun, pwait,
ptree, ptime
File list를 표시한다.
# ls -al : 모든 file들을 long형태로 자세히 listing
# ls -ald : directory를 확인 할 때
# ls -li : inode number를 보고자 할 때
NIS 의 기동 여부 확인
# nisls -l : 만일 서버가 다운되었다면 아래와 같은 메시지가 뿌려진다.
"NIS+ server unreachable"
특정 Disk partition 의 자세한 정보 획득
# prtvtoc /dev/rdsk/c0t0d0s0 : volume Table 의 내용 볼 때
위는 c0t0d0s0 slice에 대한 자세한 Information을 보여준다.
시스템의 상세 Configuration을 확인하는 명령어
# prtconf : System Configuration을 보여준다.
# sysdef : Current system definition을 출력
# /usr/platform/`uname -i`/sbin/prtdiag : H/W 정보 (sol 2.6)
; Display system diagnostic information
; SUN 장비에만 적용되고 Axil등에서는 안됨.
CPU를 Enable 또는 Disable
psrinfo , psradm
# psrinfo [-v] : CPU 정보확인
# psradm -f 2 3 : 2,3번 CPU를 off_line
# psradm -n 2 3 : 2,3번 CPU를 on_line
: 대형 서버 등에서 CPU 수를 제한하여 성능 test할 때 유용하다.
/etc/shadow 파일의 update
# pwconv : /etc/shadow file 생성 및 modify
실행된 명령어들 Display
lastcomm 설정방법
# touch /var/adm/pacct ; 꼭 이렇게 하지 않아도 되며, 보안유지가 필요한 곳이라면,
다른 DIR에 다른file_name으로 숨겨도 된다.
그러나 볼때는 반드시 /var/adm/pacct 로 copy하여 놓은후 사용
해야 함.
# /usr/lib/acct/accton /var/adm/pacct
# lastcomm
Sytem Reconfiguration BOOT
# reboot -- -r :
rlogin 접속
# rlogin -l hong basic : hong으로 basic시스템에 콘솔 접속
Key-in을 위한 I/O setting
# stty -a : setting된 key 들을 보여준다
# stty erase ?임의의키? : erase 단축기능을 임의의 키로 바꿀 때.
현 유저소유의 비어있는 파일을 생성 시킨다.
# touch cream
# ls -al cream
-rw-r--r-- 1 storming staff 0 10월 21일 17:02 cream
process,가상메모리,디스크,cpu Monitoring 통계치를 보여준다
# vmstat 1 100 : 1은 interval이고, 100은 count이다.

현재 접속 사용자에게 메시지를 뿌린다.
wall : write to all users --> /usr/sbin/wall [-a] [-g] [filename]
- 기능 : Broadcast Message from ...
- option : -a broadcast message to the console
and pseudo-terminals.
-g grpname broadcast to a specified group only.
# wall -a text_file : text_file의 내용이 터미널 에 뿌려진다.
접속 사용자 확인 명령어
# who -a : 접속상태 의 자세한 정보
# who -r : 현재 RUN Level 확인
프레임 버퍼의 상태 변경
# /usr/platform/'uname -i'/sbin/cg14config

시스템 log file 들
/var/adm/utmp , utmpx
/var/adm/wtmp , wtmpx
/var/log/syslog
/var/adm/pacct
설명 : last 등의 명령어로 위의 파일들의 내용을 볼수 있는데, 유저의 사용상황은
위의 파일에 계속 쌓이게 된다.
그런이유로 위 파일이 비대해지면, zero파일로 많들어 줄 필요가 있다.
#cp /dev/null utmp 이런 식으로 ...
C2 보안 레벨 이용 명령
- /etc/security/bsmconv , bsmunconv
위의파일 이용하여 특정 호스트 및 유저의 활동상황을 감시할수 있다.