Sysctl

sysctl은 버전 번호나 보안 설정 같은 시스템 커널의 속성들을 읽고 수정하는 몇몇 유닉스 계열 운영 체제의 기능이다. 이것은 컴파일된 프로그램에서 시스템 호출로서 그리고 스크립트로도 사용될 수 있는 관리 명령어로서도 사용 가능하다. 리눅스는 추가적으로 sysctl을 가상 파일 시스템로서 사용 가능하게 한다.

BSD

BSD에서 이러한 매개변수들은 일반적으로 공유 메모리 세그먼트의 크기, 운영 체제가 NFS 클라이언트로서 사용할 스레드의 수, 시스템에서의 최대 프로세스의 개수 같은 조정 가능한 제한을 명시하거나 IP 포워딩이나 보안 제한 또는 디버깅 출력 등을 명시하는 관리 정보 베이스(MIB)의 객체들이다.

BSD에서 시스템 호출 또는 시스템 호출 래퍼는 일반적으로 프로그램에서 사용 가능하며 또한 관리 프로그램과 설정 파일에서도 사용할 수 있게 제공된다.

리눅스

리눅스에서 sysctl 인터페이스 메커니즘은 또한 /proc/sys 디렉토리 아래에서 procfs의 한 부분으로서 사용될 수 있다(/sys 디렉토리와 헷갈리면 안된다). 이 차이는 어떤 매개변수의 값을 검사하려면 가상 파일 시스템에서 파일을 오픈하고 내용을 읽고 파싱한 후에 파일을 닫을 필요가 있다는 것이다. sysctl 시스템 호출은 리눅스에서 존재하지만 glibc에서 래핑 함수로 존재하지 않으며 사용하는 것이 추천되지는 않는다.[1]

예시

IP 포워딩이 활성화되면 운영 체제는 라우터처럼 행동할 것이다. FreeBSD, NetBSD, OpenBSD, DragonFly BSD, 그리고 Darwin/Mac OS X에서 매개변수 net.inet.ip.forwarding 는 이 행위를 활성화하기 위해 1로 설정될 수 있다. 리눅스의 sysctl 에뮬레이션에서 매개변수는 net.ipv4.ip_forward 로 불린다.

대부분의 시스템에서 명령어 sysctl -w parameter=1 은 특정한 행위를 활성화할 것이다. 이것은 리부팅될 때까지 유지된다. 만약 특정 행위가 시스템 부팅 시마다 활성화되어야 한다면 parameter=1 이 파일 /etc/sysctl.conf에 추가될 수 있다. 추가적으로 어떤 sysctl 변수들은 시스템이 부팅된 이후에는 수정되지 않는다. 이러한 변수들은 커널 컴파일 시간에 정적으로 설정되거나 /boot/loader.conf에서 설정한다.

같이 보기

각주

  1. “sysctl(2): read/write system parameters - Linux man page”. Linux.die.net. 2013년 10월 4일에 확인함. 

외부 링크

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.