启动时启动 autofs

Fak*_*ame 5 10.04 xubuntu automount

我已经完成了autofs所有设置,并且它正确地安装了我的共享目录。

但是,现在,sudo upstart autofs start在自动挂载实际工作之前,我必须在每次启动后手动运行。

认为autofs通过突触手动安装,虽然已经有一段时间了。有问题的计算机用作轻量级服务器,很少重新启动,因此必须手动启动服务并不是什么大问题,但是我的备份在 autofs 运行之前不起作用,所以我很担心。

Pan*_*her 4

将其添加到/etc/rc.local

使用任何编辑器:

图形化

gksu gedit /etc/rc.local
Run Code Online (Sandbox Code Playgroud)

命令行

sudo -e /etc/rc.local 
Run Code Online (Sandbox Code Playgroud)

添加/编辑以下内容:

#!/bin/sh -e
#
# rc.local 
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

service autofs start &

mount -a

exit 0
Run Code Online (Sandbox Code Playgroud)

你可能可以稍微改进一下,4 60 秒的睡眠可能太多了,我会尝试一个,如果需要的话增加数量。

使其可执行

sudo chmod u+x /etc/rc.local
Run Code Online (Sandbox Code Playgroud)

重新启动,它应该可以工作。如果没有,请尝试按照下面的错误报告添加睡眠。

另请参阅错误报告