실패 후 systemd cifs 드라이브 다시 마운트

실패 후 systemd cifs 드라이브 다시 마운트

Debian 8의 경우 systemd를 통해 마운트된 cifs 공유 드라이브가 있습니다.

$ cat /etc/systemd/system/external_dir.mount
[Unit]
Description=cifs mount script for /external_dir/
Requires=network-online.target
After=network-online.service

[Mount]
What=***
Where=***
Options=username=***,password=***
Type=cifs
Restart=on-failure

[Install]
WantedBy=multi-user.target

그러나 원격 시스템이 재부팅되면(예: 정전으로 인해) systemd상태가 실패로 표시되더라도 드라이브를 다시 마운트하지 않습니다.

$ sudo systemctl status external_dir.mount
● external_dir.mount - cifs mount script for /external_dir/
   Loaded: loaded (/etc/systemd/system/external_dir.mount; enabled)
   Active: failed (Result: exit-code) since Thu 2017-04-13 04:12:16 ACST; 6h ago
    Where: /external_dir
     What: ***
  Process: 413 ExecMount=/bin/mount -n *** /external_dir -t cifs -o username=***,password=*** (code=exited, status=32)

Apr 13 04:12:16 bob mount[413]: mount error(115): Operation now in progress
Apr 13 04:12:16 bob mount[413]: Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
Apr 13 04:12:16 bob systemd[1]: external_dir.mount mount process exited, code=exited status=32
Apr 13 04:12:16 bob systemd[1]: Failed to mount cifs mount script for /external_dir/.
Apr 13 04:12:16 bob systemd[1]: Unit external_dir.mount entered failed state.

서비스를 수동으로 다시 시작하면( sudo systemctl restart external_dir.mount) 그래도 정상적으로 다시 돌아옵니다.

cifs 드라이브를 다시 사용할 수 있게 되면 다시 마운트하도록 시스템을 어떻게 구성할 수 있습니까? 때때로 밤에 전원이 나가서 원격 기계가 몇 시간 동안 다운되고 아침까지 다시 켜지지 않는다는 점에 유의하십시오.

관련 정보