Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux Debian init.d脚本无法睡眠_Linux_Debian_Init.d - Fatal编程技术网

Linux Debian init.d脚本无法睡眠

Linux Debian init.d脚本无法睡眠,linux,debian,init.d,Linux,Debian,Init.d,此问题发生在运行Debian jessie的Pogoplug E02上 启动时,网络接口需要几秒钟才能联机。“联网”脚本完成后需要短暂延迟,以确保随后的网络操作正常进行 我编写了以下脚本并使用updaterc.d插入它。脚本正确插入,并在启动时按正确顺序执行,在联网后和修改为依赖于netdelay的网络相关脚本之前 cat /etc/init.d/netdelay #! /bin/sh ### BEGIN INIT INFO # Provides: netdelay # Req

此问题发生在运行Debian jessie的Pogoplug E02上

启动时,网络接口需要几秒钟才能联机。“联网”脚本完成后需要短暂延迟,以确保随后的网络操作正常进行

我编写了以下脚本并使用updaterc.d插入它。脚本正确插入,并在启动时按正确顺序执行,在联网后和修改为依赖于netdelay的网络相关脚本之前

cat /etc/init.d/netdelay
#! /bin/sh
### BEGIN INIT INFO
# Provides:          netdelay
# Required-Start:    networking
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Delay 5s after eth0 up for Pogoplug
# Description:
### END INIT INFO

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

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

        log_action_msg "Pausing for eth0 to come online"
        /bin/sleep 5
        log_action_msg "Continuing"

exit 0
当脚本在启动时执行时,没有延迟。我在脚本中同时使用了sleep和/bin/sleep,但都没有达到预期的延迟。下面附上显示此信息的引导日志

Thu Jan  1 00:00:25 1970: Configuring network interfaces...done.
Thu Jan  1 00:00:25 1970: INIT: Entering runlevel: 2
Thu Jan  1 00:00:25 1970: Using makefile-style concurrent boot in runlevel 2.
Thu Jan  1 00:00:26 1970: Starting SASL Authentication Daemon: saslauthd.
Thu Jan  1 00:00:29 1970: Pausing for eth0 to come online.
Thu Jan  1 00:00:30 1970: Continuing.
Thu Jan  1 00:00:33 1970: ntpdate updating system time.
Wed Feb  1 05:33:40 2017: Starting enhanced syslogd: rsyslogd.
(Pogoplug没有硬件时钟,在运行ntpdate之前不知道它是什么时间。)


有人能看出问题出在哪里吗

这不是因为在运行级别2中使用makefile样式的并发引导的配置吗?我不确定这会如何影响睡眠操作。从/etc/init.d中的initscripts调用的每个其他可执行文件都正常运行。你能详细介绍一下吗?