Linux/centos2020. 12. 14. 14:36

/etc/inittab이 안되서 찾아보니

systemctl set-default 명령을 통해서 바꾸면 된다.

 

# systemctl get-default
graphical.target

# systemctl set-default multi-user.target
Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/multi-user.target.

# systemctl get-default
multi-user.target

# systemctl list-units -t target -a
  UNIT                      LOAD      ACTIVE   SUB    DESCRIPTION
  basic.target              loaded    active   active Basic System
  cryptsetup.target         loaded    active   active Local Encrypted Volumes
  emergency.target          loaded    inactive dead   Emergency Mode
  getty-pre.target          loaded    inactive dead   Login Prompts (Pre)
  getty.target              loaded    active   active Login Prompts
  graphical.target          loaded    inactive dead   Graphical Interface
  initrd-fs.target          loaded    inactive dead   Initrd File Systems
  initrd-root-device.target loaded    inactive dead   Initrd Root Device
  initrd-root-fs.target     loaded    inactive dead   Initrd Root File System
  initrd-switch-root.target loaded    inactive dead   Switch Root
  initrd.target             loaded    inactive dead   Initrd Default Target
  local-fs-pre.target       loaded    active   active Local File Systems (Pre)
  local-fs.target           loaded    active   active Local File Systems
  multi-user.target         loaded    active   active Multi-User System
  network-online.target     loaded    active   active Network is Online
  network-pre.target        loaded    active   active Network (Pre)
  network.target            loaded    active   active Network
  nfs-client.target         loaded    active   active NFS client services
  nss-lookup.target         loaded    inactive dead   Host and Network Name Lookups
  nss-user-lookup.target    loaded    active   active User and Group Name Lookups
  paths.target              loaded    active   active Paths
  remote-fs-pre.target      loaded    active   active Remote File Systems (Pre)
  remote-fs.target          loaded    active   active Remote File Systems
  rescue.target             loaded    inactive dead   Rescue Mode
  rpc_pipefs.target         loaded    active   active rpc_pipefs.target
  rpcbind.target            loaded    active   active RPC Port Mapper
  shutdown.target           loaded    inactive dead   Shutdown
  slices.target             loaded    active   active Slices
  sockets.target            loaded    active   active Sockets
  sound.target              loaded    active   active Sound Card
  sshd-keygen.target        loaded    active   active sshd-keygen.target
  swap.target               loaded    active   active Swap
  sysinit.target            loaded    active   active System Initialization
● syslog.target             not-found inactive dead   syslog.target
  time-sync.target          loaded    inactive dead   System Time Synchronized
  timers.target             loaded    active   active Timers
  umount.target             loaded    inactive dead   Unmount All Filesystems

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

37 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.

[링크 : https://www.linuxfork.com/how-to-change-the-run-level-on-rhel-centos-7-8/]

 

+

아래는 안되는 왜 한지 모르겠는 뻘짓

 

--force를 주고도 한번에 안되서 여러번을 하고 나서야 되네..

stop 하고 나서 된건진 잘 모르겠다.

그리고 여전히 gui로 켜지는건 달라지지 않았다 ㅠㅠ

]# systemctl list-units -t target -a
  UNIT                      LOAD      ACTIVE   SUB    DESCRIPTION
  basic.target              loaded    active   active Basic System
  cryptsetup.target         loaded    active   active Local Encrypted Volumes
  emergency.target          loaded    inactive dead   Emergency Mode
  getty-pre.target          loaded    inactive dead   Login Prompts (Pre)
  getty.target              loaded    active   active Login Prompts
  graphical.target          loaded    active   active Graphical Interface
  initrd-fs.target          loaded    inactive dead   Initrd File Systems
  initrd-root-device.target loaded    inactive dead   Initrd Root Device
  initrd-root-fs.target     loaded    inactive dead   Initrd Root File System
  initrd-switch-root.target loaded    inactive dead   Switch Root
  initrd.target             loaded    inactive dead   Initrd Default Target
  local-fs-pre.target       loaded    active   active Local File Systems (Pre)
  local-fs.target           loaded    active   active Local File Systems
  multi-user.target         loaded    active   active Multi-User System
  network-online.target     loaded    active   active Network is Online
  network-pre.target        loaded    active   active Network (Pre)
  network.target            loaded    active   active Network
  nfs-client.target         loaded    active   active NFS client services
  nss-lookup.target         loaded    inactive dead   Host and Network Name Lookups
  nss-user-lookup.target    loaded    active   active User and Group Name Lookups
  paths.target              loaded    active   active Paths
  remote-fs-pre.target      loaded    active   active Remote File Systems (Pre)
  remote-fs.target          loaded    active   active Remote File Systems
  rescue.target             loaded    inactive dead   Rescue Mode
  rpc_pipefs.target         loaded    active   active rpc_pipefs.target
  rpcbind.target            loaded    active   active RPC Port Mapper
  shutdown.target           loaded    inactive dead   Shutdown
  slices.target             loaded    active   active Slices
  sockets.target            loaded    active   active Sockets
  sound.target              loaded    active   active Sound Card
  sshd-keygen.target        loaded    active   active sshd-keygen.target
  swap.target               loaded    active   active Swap
  sysinit.target            loaded    active   active System Initialization
● syslog.target             not-found inactive dead   syslog.target
  time-sync.target          loaded    inactive dead   System Time Synchronized
  timers.target             loaded    active   active Timers
  umount.target             loaded    inactive dead   Unmount All Filesystems

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

37 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.


# systemctl status graphical.target
● graphical.target - Graphical Interface
   Loaded: loaded (/usr/lib/systemd/system/graphical.target; indirect; vendor preset: disabled)
   Active: active since Mon 2020-12-14 00:20:24 EST; 7min ago
     Docs: man:systemd.special(7)

12월 14 00:20:24 localhost.localdomain systemd[1]: Reached target Graphical Interface.

# systemctl disable  graphical.target
Removed /etc/systemd/system/default.target.

# systemctl disable graphical.target --force

# systemctl status graphical.target
● graphical.target - Graphical Interface
   Loaded: loaded (/usr/lib/systemd/system/graphical.target; static; vendor preset: disabled)
   Active: inactive (dead) since Mon 2020-12-14 00:33:58 EST; 8s ago
     Docs: man:systemd.special(7)

12월 14 00:29:09 localhost.localdomain systemd[1]: Reached target Graphical Interface.
12월 14 00:33:58 localhost.localdomain systemd[1]: Stopped target Graphical Interface.

]# systemctl list-units -t target -a
  UNIT                      LOAD      ACTIVE   SUB    DESCRIPTION
  basic.target              loaded    active   active Basic System
  cryptsetup.target         loaded    active   active Local Encrypted Volumes
  emergency.target          loaded    inactive dead   Emergency Mode
  getty-pre.target          loaded    inactive dead   Login Prompts (Pre)
  getty.target              loaded    active   active Login Prompts
  graphical.target          loaded    inactive dead   Graphical Interface
  initrd-fs.target          loaded    inactive dead   Initrd File Systems
  initrd-root-device.target loaded    inactive dead   Initrd Root Device
  initrd-root-fs.target     loaded    inactive dead   Initrd Root File System
  initrd-switch-root.target loaded    inactive dead   Switch Root
  initrd.target             loaded    inactive dead   Initrd Default Target
  local-fs-pre.target       loaded    active   active Local File Systems (Pre)
  local-fs.target           loaded    active   active Local File Systems
  multi-user.target         loaded    active   active Multi-User System
  network-online.target     loaded    active   active Network is Online
  network-pre.target        loaded    active   active Network (Pre)
  network.target            loaded    active   active Network
  nfs-client.target         loaded    active   active NFS client services
  nss-lookup.target         loaded    inactive dead   Host and Network Name Lookups
  nss-user-lookup.target    loaded    active   active User and Group Name Lookups
  paths.target              loaded    active   active Paths
  remote-fs-pre.target      loaded    active   active Remote File Systems (Pre)
  remote-fs.target          loaded    active   active Remote File Systems
  rescue.target             loaded    inactive dead   Rescue Mode
  rpc_pipefs.target         loaded    active   active rpc_pipefs.target
  rpcbind.target            loaded    active   active RPC Port Mapper
  shutdown.target           loaded    inactive dead   Shutdown
  slices.target             loaded    active   active Slices
  sockets.target            loaded    active   active Sockets
  sound.target              loaded    active   active Sound Card
  sshd-keygen.target        loaded    active   active sshd-keygen.target
  swap.target               loaded    active   active Swap
  sysinit.target            loaded    active   active System Initialization
● syslog.target             not-found inactive dead   syslog.target
  time-sync.target          loaded    inactive dead   System Time Synchronized
  timers.target             loaded    active   active Timers
  umount.target             loaded    inactive dead   Unmount All Filesystems

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

37 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.

 

[링크 : https://linuxconfig.org/how-to-change-a-runlevel-on-rhel-7-linux-system]

'Linux > centos' 카테고리의 다른 글

centos8 virbr0?  (0) 2020.12.14
centos 8.3-2011 용량이 많이 늘었나?  (0) 2020.12.14
centos stream?  (0) 2020.12.10
centos 8.2 네트워크 설정  (0) 2020.12.02
ls 퍼미션에 .의 의미  (0) 2020.04.01
Posted by 구차니