snapd 无法通过 fstab 中的 sshfs 挂载启动

snapd 无法通过 fstab 中的 sshfs 挂载启动

分销商 ID:Ubuntu 描述:Ubuntu 16.04.4 LTS 版本:16.04 代号:xenial

如果 /etc/fstab 包含 sshfs 挂载,最新版本的 snapd 将无法启动。

sshfs#[email protected]:/home/jail/user/files/ /media/mediadrive fuse defaults,_netdev,uid=1000,gid=1000,allow_other,port=22,reconnect,IdentityFile=/home/user/.ssh/id_rsa_ftpUser 0 0

snapd 在 /var/log/syslog 中抛出以下错误

Apr  3 22:36:57 user-desktop snapd[9759]: 2018/04/03 22:36:57.832306 backend.go:104: cannot determine if NFS is in use: cannot parse /etc/fstab: expected between 3 and 6 fields, found 1
Apr  3 22:36:57 user-desktop snapd[9759]: 2018/04/03 22:36:57.835483 system_key.go:117: cannot determine nfs usage in generateSystemKey: cannot parse /etc/fstab: expected between 3 and 6 fields, found 1
Apr  3 22:36:57 user-desktop snapd[9759]: 2018/04/03 22:36:57.835499 helpers.go:115: error trying to compare the snap system key: cannot parse /etc/fstab: expected between 3 and 6 fields, found 1
Apr  3 22:36:58 user-desktop snapd[9759]: 2018/04/03 22:36:58.631222 system_key.go:117: cannot determine nfs usage in generateSystemKey: cannot parse /etc/fstab: expected between 3 and 6 fields, found 1
Apr  3 22:36:58 user-desktop snapd[9759]: error: cannot parse /etc/fstab: expected between 3 and 6 fields, found 1
Apr  3 22:36:58 user-desktop systemd[1]: snapd.service: Main process exited, code=exited, status=1/FAILURE
Apr  3 22:36:58 user-desktop systemd[1]: Failed to start Snappy daemon.
Apr  3 22:36:58 user-desktop systemd[1]: snapd.service: Unit entered failed state.
Apr  3 22:36:58 user-desktop systemd[1]: snapd.service: Failed with result 'exit-code'.
Apr  3 22:36:58 user-desktop systemd[1]: snapd.service: Service hold-off time over, scheduling restart.
Apr  3 22:36:58 user-desktop systemd[1]: Stopped Snappy daemon.

注释掉 sshfs 行允许 snapd 启动。如何解决这个问题?

答案1

更改 sshfs 的 fstab 条目解决了该问题。

[email protected]:/home/jail/user/files/ /media/mediadrive fuse.sshfs defaults,_netdev,uid=1000,gid=1000,allow_other,port=22,reconnect,IdentityFile=/home/user/.ssh/id_rsa_ftpUser 0 0

由于某种原因,snap 不喜欢以 sshfs# 开头的格式

相关内容