![systemd: poweroff.target 및 restart.target](https://linux55.com/image/150178/systemd%3A%20poweroff.target%20%EB%B0%8F%20restart.target.png)
간단히 말해서 대신 systemctl list-units
나열 poweroff.target
하거나 reboot.target
나열 하면 어떨까요 systemctl list-unit-files
? .target 파일은 /lib/systemd/system
폴더에 있으며 셀 내용을 표시합니다 systemctl cat poweroff.target
. 그것들을 설명하고 그것이 특수 단위임을 나타내십시오. 그렇다면 list-units 명령에 나타나는 것과 그렇지 않은 것의 차이점 은 무엇입니까 ?systemctl cat reboot.target
systemd.special(7)
poweroff.target
multi-user.target
답변1
간단히 말해서, 비활성 및/또는 비활성화되어 있기 때문입니다.
systemctl list-units
기본적으로 활성 장치만 나열됩니다. 시스템이 실행 중이고 poweroff
대상 reboot
이 활성 상태가 아니므로 나열되지 않습니다. 활성화된 모든 유닛을 보기 위해 추가할 수 있으며 -a
, 그러면 일부 특수 목표가 추가됩니다(반드시 전부는 아니지만 내 시스템에서는 poweroff
비활성화되었습니다).
systemctl list-unit-files
상태에 관계없이 파일 시스템에 마운트된 모든 장치를 나열합니다. 즉, 비활성화된 유닛도 나열됩니다(생성된 유닛은 제외).
(두 명령 모두 출력의 바닥글에 이에 대해 간략하게 설명되어 있습니다.)