小编Lal*_*mar的帖子

从 rc.local 启动时未运行 Bash 脚本

我写了一个简单的 bash 脚本:

#!/bin/bash
echo "hi" > log
exit 0
Run Code Online (Sandbox Code Playgroud)

使其可执行并成功运行。我将 rc.local 编辑为以下内容:

#!/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.

/home/katph/test.sh 

exit 0
Run Code Online (Sandbox Code Playgroud)

rc.local 是可执行的:

/$ ls …
Run Code Online (Sandbox Code Playgroud)

startup bash

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

bash ×1

startup ×1