システムパラメータを設定するsysctlオプションの違い

システムパラメータを設定するsysctlオプションの違い

sysctlカスタムパラメータをロードする2つの異なるコマンドをオンラインで表示しました。

  • sysctl --system
  • sysctl -p

これら2つのコマンド間に違いはありますか?私が投稿した2番目のエントリは、ロードするファイルのパスを使用できることを知っていますが、ファイルが指定されていない場合はすべてがロードされます。

ベストアンサー1

sysctl --systemすべての構成ファイルから設定をロードします。

設定はデフォルト値からsysctl -pロードされます/etc/sysctl.conf

man sysctl:

   -p[FILE], --load[=FILE]
          Load in sysctl settings from the file specified or /etc/sysctl.conf if none given.  Specifying - as  filename  means
          reading  data from standard input.  Using this option will mean arguments to sysctl are files, which are read in the
          order they are specified.  The file argument may be specified as regular expression.

   --system
          Load settings from all system configuration files. Files are read from directories in the following  list  in  given
          order from top to bottom.  Once a file of a given filename is loaded, any file of the same name in subsequent direc‐
          tories is ignored.
          /etc/sysctl.d/*.conf
          /run/sysctl.d/*.conf
          /usr/local/lib/sysctl.d/*.conf
          /usr/lib/sysctl.d/*.conf
          /lib/sysctl.d/*.conf
          /etc/sysctl.conf

おすすめ記事