![systemd에서 init.d 스크립트를 비활성화합니다.](https://linux55.com/image/39178/systemd%EC%97%90%EC%84%9C%20init.d%20%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8%EB%A5%BC%20%EB%B9%84%ED%99%9C%EC%84%B1%ED%99%94%ED%95%A9%EB%8B%88%EB%8B%A4..png)
Raspbian 설치에서 init 시스템을 sysvinit에서 systemd로 변경했습니다. 설치가 제대로 시작되지만 이제 부팅 시 lightdm이 시작됩니다. 나는 그렇게 하고 싶지 않습니다.
lightdm.service
부팅시 시작되는 것을 확인했습니다 . 서비스 중단
systemctl stop lightdm.service
잘 작동합니다.
systemctl disable lightdm.service
비활성화했어야 했는데 나한테 줬어
Failed to issue method call: No such file or directory
systemctl status lightdm.service
나에게주세요
lightdm.service - LSB: Light Display Manager
Loaded: loaded (/etc/init.d/lightdm)
Active: inactive (dead) since Thu, 03 Jul 2014 09:33:00 +0000; 22min ago
Process: 762 ExecStop=/etc/init.d/lightdm stop (code=exited, status=0/SUCCESS)
Process: 411 ExecStart=/etc/init.d/lightdm start (code=exited, status=0/SUCCESS)
CGroup: name=systemd:/system/lightdm.service
나는 lightdm이 systemd 스크립트가 아닌 init.d 스크립트에서 시작되고 systemctl disable
소스가 init.d 스크립트인 경우 작동하지 않는다고 가정합니다. 부팅 시 lightdm이 시작되지 않도록 하려면 어떻게 해야 합니까?
편집: 추가 정보
출력 $ ls -l /etc/systemd/system
:
total 20
lrwxrwxrwx 1 root root 42 Jul 3 09:04 dbus-fi.epitest.hostap.WPASupplicant.service -> /lib/systemd/system/wpa_supplicant.service
lrwxrwxrwx 1 root root 37 Jul 3 13:03 default.target -> /lib/systemd/system/multi-user.target
drwxr-xr-x 2 root root 4096 Jul 3 09:00 getty.target.wants
drwxr-xr-x 2 root root 4096 Jul 3 09:04 graphical.target.wants
drwxr-xr-x 2 root root 4096 Oct 11 2013 local-fs.target.wants
drwxr-xr-x 2 root root 4096 Jul 3 09:04 multi-user.target.wants
drwxr-xr-x 2 root root 4096 Oct 11 2013 sysinit.target.wants
lrwxrwxrwx 1 root root 35 Mar 20 2013 syslog.service -> /lib/systemd/system/rsyslog.service
출력 systemctl --all -t target
:
UNIT LOAD ACTIVE SUB JOB DESCRIPTION
all.target error inactive dead all.target
basic.target loaded active active Basic System
cryptsetup.target loaded active active Encrypted Volumes
emergency.target loaded inactive dead Emergency Mode
final.target loaded inactive dead Final Step
getty.target loaded active active Login Prompts
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
network.target loaded inactive dead Network
nss-lookup.target loaded inactive dead Name Lookups
remote-fs.target loaded active active Remote File Systems
rescue.target loaded inactive dead Rescue Mode
shutdown.target loaded inactive dead Shutdown
sockets.target loaded active active Sockets
sound.target loaded active active Sound Card
swap.target loaded active active Swap
sysinit.target loaded active active System Initialization
syslog.target loaded active active Syslog
time-sync.target loaded inactive dead System Time Synchronized
umount.target loaded inactive dead Unmount All Filesystems
출력 ls -l /etc/systemd/system/multi-user.target.wants/
:
total 8
drwxr-xr-x 2 root root 4096 Jul 3 09:04 .
drwxr-xr-x 7 root root 4096 Jul 3 13:03 ..
lrwxrwxrwx 1 root root 36 Oct 11 2013 remote-fs.target -> /lib/systemd/system/remote-fs.target
lrwxrwxrwx 1 root root 33 Jul 3 09:04 rsync.service -> /lib/systemd/system/rsync.service
lrwxrwxrwx 1 root root 35 Mar 20 2013 rsyslog.service -> /lib/systemd/system/rsyslog.service
lrwxrwxrwx 1 root root 32 Jul 3 09:04 sudo.service -> /lib/systemd/system/sudo.service
lrwxrwxrwx 1 root root 42 Jul 3 09:04 wpa_supplicant.service -> /lib/systemd/system/wpa_supplicant.service
답변1
systemctl disable
소스가 스크립트인 경우 아무런 효과가 없습니다init.d
.lightdm
부팅 시 자동 시작을 비활성화하려면 어떻게 해야 합니까 ?
아이러니하게도 지금까지의 답변 중 어느 것도 이를 수행하는 "공식적인" 방법을 언급하지 않았습니다. 완전성을 위해 다음과 같습니다.
서비스를 "차단"합니다:
systemctl mask lightdm.service
또는 자신만의 유닛 파일을 생성하면 /etc/systemd/system/lightdm.service
명령으로 활성화 및 비활성화할 수 있는 적절한 일급 시스템 시민이 됩니다. 단위 파일은 동일한 기본 이름을 가진 파일을 대체합니다. 너는 조각할 수 있어enable
disable
init.d
lightdm.service
이것은 데비안 사람들이 쓴 것입니다. ☺
추가 읽기
- 레나트 페틀링(2011-03-02). "세 가지 수준의 "꺼짐"". 관리자 시스템.
답변2
(루트로) 시도하십시오:-
systemctl disable graphical.target
multi-user
재부팅한 후에는 대신 모드 에 있어야 합니다 graphical
.
실패하면 기본 대상을 확인하십시오.
ls -l /lib/systemd/system/default.target
# or, depending on your distro
ls -l /etc/systemd/system/default.target
경로의 유일한 차이점은 최상위 디렉터리 /lib
또는 입니다 /etc
.
위의 링크는 에 대한 소프트 링크여야 합니다 multi-user.target
. 그것이 가리키는 경우 graphical.target
(루트로)를 사용하여 변경하십시오.
ln -sf /lib/systemd/system/multi-user.target /lib/systemd/system/default.target
# or
ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target
이전 명령 ls -l
에서 소프트 링크가 발견된 위치 에 따라 다릅니다.
다시 시작하면 디스플레이 관리자가 시작되지 않기를 바랍니다.
어떤 목표가 있는지 확인하려면 다음을 실행하세요.
systemctl --all -t target
답변3
Debian에서 init 스크립트를 활성화 및 비활성화할 수 있습니다 update-rc.d
. 사용 update-rc.d lightdm disable
.
graphic.target을 비활성화해도 작동하지 않는 이유는 lightdm이 graphic.target에 대해 모르기 때문입니다. 모든 다중 사용자 실행 수준(2-5)에서 시작되는 초기화 스크립트입니다.