LXC - Scripts

最後更新: 2018-07-16

目錄

 


ckmem.sh

 

#! /bin/bash

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

MPATH=/sys/fs/cgroup/memory/lxc

for n in `ls $MPATH`
do
        PATH=$MPATH/$n
        if [ -d $PATH ]
        then
                echo -n "$n:         "
                ram=`/bin/cat "$PATH/memory.failcnt"`
                ramswap=`/bin/cat "$PATH/memory.memsw.failcnt"`
                echo "$ram / $ramswap"
        fi
done

 


mkdev.sh

 

mkdir /root/v2v/

mkdev.sh

# 必須 !!
# 多數要 rm 先, 很多時已經幔 ">"
rm -f /dev/null
mknod -m 666 /dev/null c 1 3

# pts
mkdir -m 755 /dev/pts
mknod -m 610 /dev/pts/1 c 136 1
mknod -m 610 /dev/pts/2 c 136 2
mknod -m 610 /dev/pts/3 c 136 3
mknod -m 610 /dev/pts/4 c 136 4
mknod -m 666 /dev/ptmx c 5 2
mknod -m 600 /dev/initctl p
chgrp tty /dev/pts/*
#
mknod -m 666 /dev/tty c 5 0
mknod -m 660 /dev/tty0 c 4 0
mknod -m 660 /dev/tty1 c 4 1
mknod -m 660 /dev/tty2 c 4 2
mknod -m 660 /dev/tty3 c 4 3
mknod -m 600 /dev/console c 5 1
#
mkdir -m 1777 /dev/shm
mknod -m 666 /dev/zero c 1 5
mknod -m 666 /dev/full c 1 7
mknod -m 666 /dev/random c 1 8
mknod -m 444 /dev/urandom c 1 9

 


 

Creative Commons license icon Creative Commons license icon