Showing posts with label rhel6. Show all posts
Showing posts with label rhel6. Show all posts

Monday, May 2, 2016

TimeZone

CentOS 6


TimeZone 설정하기

$ vi /etc/sysconfig/clock

ZONE#Asia/Seoul

$ tzdata-update

TimeZone 파일들

/etc/localtime
/etc/sysconfig/clock
/usr/share/zoneinfo/Asia/Seoul

CentOS 7


TimeZone 리스트

$ timedatectl list-timezones

TimeZone 설정하기

$ timedatectl set-timezone Asia/Seoul

TimeZone 확인

$ timedatectl

      Local time: 목 2016-01-14 00:13:43 KST
  Universal time: 수 2016-01-13 15:13:43 UTC
        RTC time: 수 2016-01-13 15:13:44
        Timezone: Asia/Seoul (KST, +0900)
     NTP enabled: n/a
NTP synchronized: no
 RTC in local TZ: no
      DST active: n/a


Friday, April 29, 2016

RedHatEnterpriseLinux6

Sysctl.conf 내용 추가

부팅시에 /etc/rc.d/init.d/functions 의 apply_sysctl() 함수를 /etc/rc.d/rc.sysinit 에서 호출 하는데 아래와 같다.

# Apply sysctl settings, including files in /etc/sysctl.d
apply_sysctl() {
    sysctl -e -p /etc/sysctl.conf >/dev/null 2>&1
    for file in /etc/sysctl.d/* ; do
        is_ignored_file "$file" && continue
        test -f "$file" && sysctl -e -p "$file" >/dev/null 2>&1
    done
}

/etc/sysctl.conf 호출후 /etc/sysctl.d/* 를 읽어 들이기 때문에 /etc/sysctl.d/{name}.conf 식으로 작성해두면 된다. 재시작 시점 부터 적용된다.
$ mkdir /etc/sysctl.d
$ vi /etc/sysctl.d/00_my.conf

# listen() 함수의 backlog 가 somaxconn 보다 크면 listen() 의 backlog는 somaxconn 으로 설정 된다. 
net.core.somaxconn = 65536

Static Routes and the Default Gateway

리부팅시에도 적용 되도록 ”’/etc/sysconfig/network-scripts/route-{interface}”’ 에 추가
$ vi /etc/sysconfig/network-scripts/route-eth0

default via 10.10.10.1 dev eth0
10.0.0.0/8 via 10.10.10.1 dev eth0
192.168.0.0/24 via 10.10.10.1 dev eth0

네트워크 재시작
$ service network restart

$ netstat -nr

Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.0.0.0        10.10.10.1      255.0.0.0       U         0 0          0 eth0
192.168.0.0     10.10.10.1      255.255.255.0   U         0 0          0 eth0
0.0.0.0         10.10.10.1      0.0.0.0         UG        0 0          0 eth0

기타