태그 보관물: runlevel

runlevel

systemd에서 런레벨을 어떻게 변경합니까? 2 였지만 의미가 없었습니다). 어쨌든 내 컴퓨터는

매우 간단합니다. 런레벨을 변경하려고합니다. 온라인에서 찾은 모든 내용은 다음 위치의 파일을 가리 킵니다.

/etc/init/rc-sysinit.conf

여기서 나는 “DEFAULT_RUNLEVEL”을 3 또는 다른 것으로 변경하려고 시도했지만 아무런 차이가 없습니다 (원래 값은 2 였지만 의미가 없었습니다). 어쨌든 내 컴퓨터는 완전히 부팅되고 runlevel 명령을 확인할 때마다 “N 5″가 결과로 표시됩니다.

런레벨을 어떻게 변경합니까? 나는 grub이나 다른 해결 방법을 통해 그것을 재정의하지 않을 것입니다. 그리고 X를 구체적으로 비활성화하는 방법을 찾고 있지 않습니다.

온라인에서 찾은 모든 지침이 약간 오래되었습니다. 16.04에서 무언가 변경 되었습니까?



답변

Ubuntu 16.04는 init 대신 systemd를 사용하므로 개념은 runlevels용어로 대체됩니다 targets. 따라서 초기화 기반 실행 수준과 시스템 기반 대상간에 매핑이 실제로 있습니다.

   Mapping between runlevels and systemd targets
   ┌─────────┬───────────────────┐
   │Runlevel │ Target            │
   ├─────────┼───────────────────┤
   │0        │ poweroff.target   │
   ├─────────┼───────────────────┤
   │1        │ rescue.target     │
   ├─────────┼───────────────────┤
   │2, 3, 4  │ multi-user.target │
   ├─────────┼───────────────────┤
   │5        │ graphical.target  │
   ├─────────┼───────────────────┤
   │6        │ reboot.target     │
   └─────────┴───────────────────┘

이제 16.04의 “런레벨”을 변경하려면 다음과 같이 사용할 수 있습니다.

sudo systemctl isolate multi-user.target

이것을 기본 “런레벨”로 만들려면 다음을 사용할 수 있습니다.

sudo systemctl enable multi-user.target
sudo systemctl set-default multi-user.target

에서 man systemctl

   isolate NAME
       Start the unit specified on the command line and its dependencies and stop all others. If
       a unit name with no extension is given, an extension of ".target" will be assumed.

       This is similar to changing the runlevel in a traditional init system. The isolate command
       will immediately stop processes that are not enabled in the new unit, possibly including
       the graphical environment or terminal you are currently using

또한 man systemd.specialsystemd의 대상에 대해 자세히 알아보십시오.


답변