[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[plamo:34405] Re: incusインスタンスのautostartについて



阿部です

On Fri, 31 Jan 2025 22:29:05 +0900
KATOH Yasufumi <karma@xxxxxxxxxxxxxxxx> wrote:

> 加藤です。
> 
> incus のコンテナインスタンスの autostart が効かない問題ですが、/etc/fstab に次の行
> を追加してみてください。
> 
> cgroup2 /sys/fs/cgroup cgroup2
> rw,nosuid,nodev,noexec,relatime,nsdelegate,memory_recursiveprot 0 0
> 
> 今の Plamo-8.x では、cgroup2 のマウントは elogind に任せてるんだけど、ちゃんと確認
> してませんが、もしかしたら誰かがログインするまでは cgroup2 がマウントされないので
> はないか?という疑惑(確かめる方法がわからんけど、起動時に mount -l 出力したらいい
> かな?w)
> 
> -- 


まったくわかっていない人間なのでピント外れかもしれませんが、
Slackwareの起動時読み込みスクリプト( /ets/rc.d/rc.S )の中に cgroup に関わる行がありまして、
その部分を抜き出したのが以下です。

↓↓↓↓

--- ここから ----------------
# Mount Control Groups filesystem interface:
if [ -z "$container" ] && grep -wq cgroup2 /proc/filesystems 2> /dev/null ; then
  # Load default setting for v1 or v2:
  if [ -e /etc/default/cgroups ]; then
    . /etc/default/cgroups
  fi
  # If CGROUPS_VERSION=2 in /etc/default/cgroups, then mount as cgroup-v2:
  # See linux-*/Documentation/admin-guide/cgroup-v2.rst (section 2-1)
  if [ "$CGROUPS_VERSION" = "2" ]; then
    if [ -d /sys/fs/cgroup ]; then
      mount -t cgroup2 none /sys/fs/cgroup
    else 
      mkdir -p /dev/cgroup
      mount -t cgroup2 none /dev/cgroup
    fi
  elif [ "$CGROUPS_VERSION" = "1" ] || [ -z "$CGROUPS_VERSION"]; then # mount as cgroup-v1 (default):
    if [ -d /sys/fs/cgroup ]; then
      # See linux-*/Documentation/admin-guide/cgroup-v1/cgroups.rst (section 1.6)
      # Mount a tmpfs as the cgroup filesystem root:
      mount -t tmpfs -o mode=0755,size=8M cgroup_root /sys/fs/cgroup
      # Autodetect available controllers and mount them in subfolders:
      for i in $(/bin/cut -f 1 /proc/cgroups | /bin/tail -n +2) ; do
        mkdir /sys/fs/cgroup/$i
        mount -t cgroup -o $i $i /sys/fs/cgroup/$i
      done
      unset i
    else
      mkdir -p /dev/cgroup
      mount -t cgroup cgroup /dev/cgroup
    fi
  fi
fi
--- ここまで  ----------------


-- 
JW (ABE Shin-ichi ) <shin1.abe@xxxxxxxxx>


Follow-Ups
[plamo:34407] Re: [plamo:34405] Re: incusインスタンスのautostartについて, KATOH Yasufumi

[検索ページ] [メール一覧]
Plamo ML 公開システム