rc.local, не названный при запуске системы

Вот полный 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.

touch /home/jack/test.txt
bash /home/jack/Scripts/select_wallpaper.sh

exit 0

Не выполняя сценарий вручную без проблем не происходит, и все хорошо работает. Я попытался поместить тестовую команду touch в rc.local, но ничего не происходит!? Я проверил sysv-rc-conf и это включено! Что я пропускаю??

Вот содержание моего /etc/init.d/rc.local:

 #! /bin/sh
### BEGIN INIT INFO
# Provides:          rc.local
# Required-Start:    $all
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:
# Short-Description: Run /etc/rc.local if it exist
### END INIT INFO

PATH=/sbin:/usr/sbin:/bin:/usr/bin

. /lib/init/vars.sh
. /lib/lsb/init-functions

do_start() {
    if [ -x /etc/rc.local ]; then
        [ "$VERBOSE" != no ] && log_begin_msg "Running local boot scripts (/etc/rc.local)"
    /etc/rc.local
    ES=$?
    [ "$VERBOSE" != no ] && log_end_msg $ES
    return $ES
fi
}

echo $1 > /home/jack/test.txt

case "$1" in
start)
do_start
    ;;
restart|reload|force-reload)
    echo "Error: argument '$1' not supported" >&2
    exit 3
    ;;
stop)
    ;;
*)
    echo "Usage: $0 start|stop" >&2
    exit 3
    ;;
esac

Я вставил строку echo $1 > /home/dan/test.txt самостоятельно, но ничто не записано там!? Когда я выполняю его как sudo /etc/init.d/rc.local start все хорошо работает просто не при начальной загрузке системы!?

0
задан 15 October 2014 в 05:34

1 ответ

Я поместил сценарий в Приложения Запуска, и он работает теперь прекрасный

1
ответ дан 6 October 2019 в 13:36

Другие вопросы по тегам:

Похожие вопросы: