Systemd-analyze는 실행 횟수에 따라 다음 Systemd-analyze verify mnt-HDDs.mount
과 같은 결과를 얻습니다.
local-fs.target: Found ordering cycle on HDDs-unlock.service/start
local-fs.target: Found dependency on sysinit.target/start
local-fs.target: Found dependency on systemd-update-done.service/start
local-fs.target: Found dependency on local-fs.target/start
local-fs.target: Job systemd-update-done.service/start deleted to break ordering cycle starting with local-fs.target/start
local-fs.target: Found ordering cycle on HDDs-unlock.service/start
local-fs.target: Found dependency on sysinit.target/start
local-fs.target: Found dependency on systemd-journal-catalog-update.service/start
local-fs.target: Found dependency on local-fs.target/start
local-fs.target: Job systemd-journal-catalog-update.service/start deleted to break ordering cycle starting with local-fs.target/start
local-fs.target: Found ordering cycle on HDDs-unlock.service/start
local-fs.target: Found dependency on sysinit.target/start
local-fs.target: Found dependency on systemd-machine-id-commit.service/start
local-fs.target: Found dependency on local-fs.target/start
local-fs.target: Job systemd-machine-id-commit.service/start deleted to break ordering cycle starting with local-fs.target/start
local-fs.target: Found ordering cycle on HDDs-unlock.service/start
local-fs.target: Found dependency on sysinit.target/start
local-fs.target: Found dependency on local-fs.target/start
local-fs.target: Job local-fs.target/start deleted to break ordering cycle starting with local-fs.target/start
sysinit.target: Found ordering cycle on plymouth-read-write.service/start
sysinit.target: Found dependency on local-fs.target/start
sysinit.target: Found dependency on mnt-HDDs.mount/start
sysinit.target: Found dependency on HDDs-unlock.service/start
sysinit.target: Found dependency on sysinit.target/start
sysinit.target: Job plymouth-read-write.service/start deleted to break ordering cycle starting with sysinit.target/start
sysinit.target: Found ordering cycle on local-fs.target/start
sysinit.target: Found dependency on mnt-HDDs.mount/start
sysinit.target: Found dependency on HDDs-unlock.service/start
sysinit.target: Found dependency on sysinit.target/start
sysinit.target: Job local-fs.target/start deleted to break ordering cycle starting with sysinit.target/start
sysinit.target: Found ordering cycle on systemd-update-done.service/start
sysinit.target: Found dependency on local-fs.target/start
sysinit.target: Found dependency on HDDs-unlock.service/start
sysinit.target: Found dependency on sysinit.target/start
sysinit.target: Job systemd-update-done.service/start deleted to break ordering cycle starting with sysinit.target/start
sysinit.target: Found ordering cycle on systemd-machine-id-commit.service/start
sysinit.target: Found dependency on local-fs.target/start
sysinit.target: Found dependency on HDDs-unlock.service/start
sysinit.target: Found dependency on sysinit.target/start
sysinit.target: Job systemd-machine-id-commit.service/start deleted to break ordering cycle starting with sysinit.target/start
sysinit.target: Found ordering cycle on systemd-tmpfiles-setup.service/start
sysinit.target: Found dependency on local-fs.target/start
sysinit.target: Found dependency on HDDs-unlock.service/start
sysinit.target: Found dependency on sysinit.target/start
sysinit.target: Job systemd-tmpfiles-setup.service/start deleted to break ordering cycle starting with sysinit.target/start
sysinit.target: Found ordering cycle on plymouth-read-write.service/start
sysinit.target: Found dependency on local-fs.target/start
sysinit.target: Found dependency on HDDs-unlock.service/start
sysinit.target: Found dependency on sysinit.target/start
sysinit.target: Job plymouth-read-write.service/start deleted to break ordering cycle starting with sysinit.target/start
sysinit.target: Found ordering cycle on local-fs.target/start
sysinit.target: Found dependency on HDDs-unlock.service/start
sysinit.target: Found dependency on sysinit.target/start
sysinit.target: Job local-fs.target/start deleted to break ordering cycle starting with sysinit.target/start
mnt-HDDs.mount는 생성된 장치와 직접 관련됩니다.
mnt-HDD.마운트:
[Unit]
Description=Mount unit for encripted device /mnt/HDDs
After=HDDs-unlock.service
[Mount]
Where=/mnt/HDDs
What=/dev/mapper/cryptHDDB
Type=btrfs
Options=noatime,compress-force=zstd,autodefrag,flushoncommit
HDD 잠금 해제.서비스
[Unit]
Description=HDDB and HDDC unlock
After=media-key.mount umount.target local-fs-pre.target
Before=local-fs.target
Conflicts=umount.target
[Service]
Type=oneshot
RemainAfterExit=yes
KillMode=none
ExecStart=/usr/bin/HDDs-unlock.sh
ExecStop=/usr/bin/HDDs-lock.sh
[Install]
RequiredBy=mnt-HDDs.mount
미디어키.마운트
[Unit]
Description=HDDs key
StopWhenUnneeded=true
[Mount]
Where=/media/key
What=/dev/disk/by-id/usb-SMI_USB_DISK_AA00000000065845-0:0
Options=ro,offset=952320
DirectoryMode=0400
[Install]
RequiredBy=HDDs-unlock.service
솔루션을 찾기 위해 다시 시작할 때 때때로 시작이 특정 서비스를 건너뛰고 때로는 네트워크 없이 시작되게 만드는 자동 종속성 호출을 통해 설치되는 fstab
항목이 있습니다 . 이 주문 주기를 수정하는 데 대한 생각이 있습니까?/mnt/HDDs/@
mnt-HDDs.mount
답변1
좋습니다. 많은 검색을 거쳐(여러 번 다시 방문한 후)이것StackExchange의 답변)은 제가 직면한 동일한 문제에 대한 답변으로 생각됩니다.
기본적으로 마운트 단위는 local-fs-pre.targe와 local-fs.target 사이에서 암시적으로 발생하며, basic.target 이전에 서비스가 암시적으로 Requires=basic.target 및 After=basic.target이라는 문제가 있습니다. 해결책은 기본 종속성을 비활성화하는 것입니다.
[Unit]
....
DefaultDependencies=no
....