使用 systemd 启动 bindfs

使用 systemd 启动 bindfs

我的 systemd 启动脚本通常工作得很好,包括挂载命令等。现在我使用 bindfs 添加了一行

bindfs --map=1000/1001 /mnt/WrongPermissions/MyBook /mnt/share/MyBook

我的启动系统脚本“mystartup”的定义是

[Unit]
Description=My own startup skript

[Service]
Type=oneshot
ExecStart=/usr/bin/mystartup

[Install]
WantedBy=multi-user.target

使用时

sudo systemctl start mystartup

没有安装任何东西。服务的状态由下式给出

May 17 20:56:43 raspberrypi systemd[1]: Starting My own startup skript...
May 17 20:56:43 raspberrypi systemd[1]: mystartup.service: Child 8679 belongs to mystartup.service.
May 17 20:56:43 raspberrypi systemd[1]: mystartup.service: Main process exited, code=exited, status=0/SUCCESS
May 17 20:56:43 raspberrypi systemd[1]: mystartup.service: Changed start -> stop-sigterm
May 17 20:56:43 raspberrypi systemd[1]: mystartup.service: Child 8681 belongs to mystartup.service.
May 17 20:56:43 raspberrypi systemd[1]: mystartup.service: cgroup is empty
May 17 20:56:43 raspberrypi systemd[1]: mystartup.service: Succeeded.
May 17 20:56:43 raspberrypi systemd[1]: mystartup.service: Changed stop-sigterm -> dead
May 17 20:56:43 raspberrypi systemd[1]: mystartup.service: Job 1185 mystartup.service/start finished, result=done
May 17 20:56:43 raspberrypi systemd[1]: Started My own startup skript.

但是,当直接在命令行中使用bindfs命令时,挂载工作正常。知道我缺少什么吗?

相关内容