linux – 当接口出现时,每个脚本都位于/etc/network/if-up.d中吗?

是否在网络接口启动时运行/etc/network/if-up.d中的所有脚本?

如果是这样,interfaces文件中的post-up命令是什么?

解决方法

是的,通常会运行任何标记为可执行文件并放在该文件夹中的脚本.由于使用了运行部件,因此文件仅限于一组特定的名称.

post-up与up up相同.将脚本放在if-up.d中就像使用指向其他地方的脚本或命令的post-up一样.通常,当您只需要为单个界面运行单个命令时,您将使用up | post-up.当你有更复杂的东西时,你会创建一个脚本.

男人接口

...
up command

post-up command
      Run  command  after  bringing the interface up.  If this command
      fails then ifup aborts,refraining from marking the interface as
      configured  (even  though it has really been configured),prints
      an error message,and exits with status 0.   This  behavior  may
      change in the future.
...
There  exists  for  each  of  the  above  mentioned options a directory
/etc/network/if-<option>.d/ the scripts in which are run (with no argu-
ments) using run-parts(8) after the option itself has been processed.

男子跑步部位

run-parts  runs  all  the  executable  files  named  within constraints
described below,If  the  --lsbsysinit  option  is not given then the names must consist
entirely of upper and lower  case  letters,digits,underscores,and
hyphens.
...
Files are run in the lexical sort  order  of  their  names  unless  the
--reverse  option  is given,in which case they are run in the opposite
order.

相关文章

linux常用进程通信方式包括管道(pipe)、有名管道(FIFO)、...
Linux性能观测工具按类别可分为系统级别和进程级别,系统级别...
本文详细介绍了curl命令基础和高级用法,包括跳过https的证书...
本文包含作者工作中常用到的一些命令,用于诊断网络、磁盘占满...
linux的平均负载表示运行态和就绪态及不可中断状态(正在io)的...
CPU上下文频繁切换会导致系统性能下降,切换分为进程切换、线...