systemd는 실패 후 cifs 드라이브를 다시 마운트합니다.

systemd는 실패 후 cifs 드라이브를 다시 마운트합니다.

데비안 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 드라이브를 다시 사용할 수 있게 되면 다시 마운트하도록 시스템을 어떻게 구성합니까? 밤에 전원이 나가서 아침이 될 때까지 다시 켜지 않기 때문에 원격 컴퓨터가 몇 시간 동안 다운되는 경우가 있다는 점을 참고하시기 바랍니다.

관련 정보