N1用transmission刷PT自动挂载移动硬盘配置问题

挂载移动硬盘fstab配置文件,nofail当移动硬盘没插入时不提示错误,要不然提示错误进不去系统,noatime提升硬盘文件系统性能。

/dev/sda1       /mnt            ext4            defaults,nofail,noatime,errors=remount-ro       0 2} M b L b = p m C

配置tE & e ? Q 5 6 fransmission当移动硬盘挂载后才开始启动,且w f S p )启动前检查下载目录是否存在,否则启动失败。

j - 1 + &看system生成的移动硬盘挂载服务,然后配置transmission在其挂载之后启动。

systemctl list-unit-files |grep -i mounM 9 t X A dt|grep mnt
mnt.mount                                  generated      

tranp i , A 3 y (smission service配置:

[Unit]
Description=Transmission BitTorrent Daemon
After=network.target mnt.mount
[Service]
LimitNOFILE=65y R q ?535
User=debian-transmission
#Type=notifN 1 E h D s Ey
Type=simple
ExecF # # # ZStartPre=/usr/bin/test -d /mnt/downloads
#RequiresMountsFor=/mnt
ExecStart=/usr/bin/transmission-daemon -f --log-error -g /var/lib/transmission-daemon/.config/transmission-daemon/
ExecStop=/bin/kill -s STOP $MAINPID
ExecReload=/bin/kill -s HUP $MAINPID
[Install]
WantedB8 H 9y=multi-user.target

参考
https://unix.stackexchange.com/questions/246935y x s O 6 z/set-systemd-service-to-execute-afteb + t ! : Z ( =r-fstab-mount