Show Table of Contents
付録G busybox コマンドの代替コマンド
これまでのリリースの Red Hat Enterprise Linux とは異なり、Red Hat Enterprise Linux 6 には、プレインストールおよびポストインストールの環境内にシェルコマンドを提供する busybox のバージョンが含まれていません。表G.1「busybox コマンドの代替コマンド」 には、busybox コマンドの一覧、bash 内で同じ機能を実装するための同等の方法、および %pre と %post 環境におけるこれら代替コマンドの利用可能性が記載されています。さらに、この表はコマンドへの正確なパスを示しますが、
PATH
環境変数がインストール環境で設定されているため、一般的にはこのパスを指定する必要はありません。
あるコマンドが %post でのみ利用できる場合、そのコマンドはターゲットシステム上で実行していることから、それが利用できるかどうかは、そのコマンドを提供するパッケージがインストールされているかどうかに左右されます。表G.1「busybox コマンドの代替コマンド」の「新規のコマンドまたは代替コマンド」の列に表示されるすべてのコマンドは Red Hat Enterprise Linux 6 で利用できますが、それらすべてがどのインストール済みシステム上でも利用できるとは限りません。
利用不可と記載されているコマンドについては、Python スクリプトを使用して同等の機能を作成できる場合があります。Python 言語は %pre および %post スクリプト開発者が利用でき、すぐに使用できる Python モジュール一式も揃っています。そのため、インストール環境で特定のコマンドが利用できない場合には、スクリプト言語として Python を使用することをお勧めします。
表G.1 busybox コマンドの代替コマンド
Busybox コマンド | %pre | %post | 新規のコマンドまたは代替コマンド |
---|---|---|---|
addgroup | no | yes | /usr/sbin/groupadd |
adduser | no | yes | /usr/sbin/useradd |
adjtimex | no | no | なし |
ar | no | yes | /usr/bin/ar |
arping | yes | yes | /sbin/arping または /usr/sbin/arping |
ash | yes | yes | /bin/bash |
awk | yes | yes | /sbin/awk 、/sbin/gawk 、または /usr/bin/gawk [a] |
basename | yes | yes | /bin/bash [b] /usr/bin/basename |
bbconfig | no | no | なし — このコマンドは Busybox に固有のものです。 |
bunzip2 | yes | yes | /usr/bin/bunzip2 、/usr/bin/bzip2 -d |
busybox | no | no | なし |
bzcat | yes | yes | /usr/bin/bzcat 、/usr/bin/bzip2 -dc |
cal | no | yes | /usr/bin/cal |
cat | yes | yes | /usr/bin/cat |
catv | no | no | cat -vET または cat -A |
chattr | yes | yes | /usr/bin/chattr |
chgrp | yes | yes | /usr/bin/chgrp |
chmod | yes | yes | /usr/bin/chmod |
chown | yes | yes | /usr/bin/chown |
chroot | yes | yes | /usr/sbin/chroot |
chvt | yes | yes | /usr/bin/chvt |
cksum | no | yes | /usr/bin/cksum |
clear | yes | yes | /usr/bin/clear |
cmp | no | yes | /usr/bin/cmp |
comm | no | yes | /usr/bin/comm |
cp | yes | yes | /usr/bin/cp |
cpio | yes | yes | /usr/bin/cpio |
crond | no | no | なし — スクリプト部分にデーモンは使用できません。 |
crontab | no | yes | /usr/bin/crontab |
cut | yes | yes | /usr/bin/cut |
date | yes | yes | /usr/bin/date |
dc | no | yes | /usr/bin/dc |
dd | yes | yes | /usr/bin/dd |
deallocvt | no | yes | /usr/bin/deallocvt |
delgroup | no | yes | /usr/sbin/groupdel |
deluser | no | yes | /usr/sbin/userdel |
devfsd | no | no | なし — Red Hat Enterprise Linux は devfs を使用しません。 |
df | yes | yes | /usr/bin/df |
diff | no | yes | /usr/bin/diff |
dirname | yes | yes | /bin/bash [c], /usr/bin/dirname |
dmesg | yes | yes | /usr/bin/dmesg |
dnsd | no | no | なし — スクリプト部分にデーモンは使用できません。 |
dos2unix | no | no | sed 's/.$//' |
dpkg | no | no | なし — Debian パッケージのサポートはありません |
dpkg-deb | no | no | なし — Debian パッケージのサポートはありません |
du | yes | yes | /usr/bin/du |
dumpkmap | no | no | なし |
dumpleases | no | no | なし |
e2fsck | yes | yes | /usr/sbin/e2fsck |
e2label | yes | yes | /usr/sbin/e2label |
echo | yes | yes | /usr/bin/echo |
ed | no | no | /sbin/sed 、/usr/bin/sed |
egrep | yes | yes | /sbin/egrep 、/usr/bin/egrep |
eject | yes | yes | /usr/bin/eject |
env | yes | yes | /usr/bin/env |
ether-wake | no | no | なし |
expr | yes | yes | /usr/bin/expr |
fakeidentd | no | no | なし — スクリプト部分にデーモンは使用できません。 |
false | yes | yes | /usr/bin/false |
fbset | no | yes | /usr/sbin/fbset |
fdflush | no | no | なし |
fdformat | no | yes | /usr/bin/fdformat |
fdisk | yes | yes | /usr/sbin/fdisk |
fgrep | yes | yes | /sbin/fgrep 、/usr/bin/fgrep |
find | yes | yes | /usr/bin/find |
findfs | no | no | なし |
fold | no | yes | /usr/bin/fold |
free | no | yes | /usr/bin/free |
freeramdisk | no | no | なし |
fsck | yes | yes | /usr/sbin/fsck |
fsck.ext2 | yes | yes | /usr/sbin/fsck.ext2 、/usr/sbin/e2fsck |
fsck.ext3 | yes | yes | /usr/sbin/fsck.ext3 、/usr/sbin/e2fsck |
fsck.minix | no | no | なし — Minix ファイルシステムのサポートがありません |
ftpget | yes | yes | /usr/bin/ftp または Python ftplib モジュール |
ftpput | yes | yes | /usr/bin/ftp または Python ftplib モジュール |
fuser | no | yes | /sbin/fuser |
getopt | no | yes | /usr/bin/getopt |
getty | no | no | なし |
grep | yes | yes | /sbin/grep 、/usr/bin/grep |
gunzip | yes | yes | /usr/bin/gunzip 、/usr/bin/gzip -d |
gzip | yes | yes | /usr/bin/gzip |
hdparm | yes | yes | /usr/sbin/hdparm |
head | yes | yes | /usr/bin/head |
hexdump | no | yes | /usr/bin/hexdump |
hostid | no | yes | /usr/bin/hostid または Python |
hostname | yes | yes | /sbin/hostname 、/usr/bin/hostname |
httpd | no | no | なし — スクリプト部分にデーモンは使用できません。 |
hush | no | no | なし |
hwclock | yes | yes | /usr/sbin/hwclock |
id | no | yes | /usr/bin/id または Python |
ifconfig | yes | yes | /sbin/ifconfig 、/usr/sbin/ifconfig |
ifdown | no | no | ifconfig device down |
ifup | no | no | ifconfig device up |
inetd | no | no | なし — スクリプト部分にデーモンは使用できません。 |
insmod | yes | yes | /sbin/insmod 、/usr/sbin/insmod |
install | no | yes | /usr/bin/install または mkdir/cp/chmod/chown/chgrp |
ip | yes | yes | /sbin/ip 、/usr/sbin/ip |
ipaddr | no | no | ifconfig または ip |
ipcalc | yes | yes | /sbin/ipcalc 、/usr/bin/ipcalc |
ipcrm | no | yes | /usr/bin/ipcrm |
ipcs | no | yes | /usr/bin/ipcs |
iplink | no | no | ip |
iproute | no | no | ip |
iptunnel | no | yes | /sbin/iptunnel |
kill | yes | yes | /sbin/kill 、/usr/bin/kill |
killall | yes | yes | /usr/bin/killall |
lash | no | no | なし |
last | no | yes | /usr/bin/last |
length | no | no | Python または bash |
less | yes | yes | /usr/bin/less |
linux32 | no | no | なし |
linux64 | no | no | なし |
ln | yes | yes | /sbin/ln 、/usr/bin/ln |
load_policy | yes | yes | /sbin/load_policy 、/usr/sbin/load_policy |
loadfont | no | no | なし |
loadkmap | no | no | なし |
login | yes | yes | /usr/bin/login |
logname | no | yes | /usr/bin/logname |
losetup | yes | yes | /usr/bin/losetup |
ls | yes | yes | /usr/bin/ls |
lsattr | yes | yes | /usr/bin/lsattr |
lsmod | yes | yes | /usr/bin/lsmod |
lzmacat | no | yes | /usr/bin/lzmadec |
makedevs | no | no | /usr/bin/mknod |
md5sum | yes | yes | /usr/bin/md5sum |
mdev | no | no | なし |
mesg | no | yes | /usr/bin/mesg |
mkdir | yes | yes | /sbin/mkdir 、/usr/bin/mkdir |
mke2fs | yes | yes | /usr/sbin/mke2fs |
mkfifo | no | yes | /usr/bin/mkfifo |
mkfs.ext2 | yes | yes | /usr/sbin/mkfs.ext2 |
mkfs.ext3 | yes | yes | /usr/sbin/mkfs.ext3 |
mkfs.minix | no | no | なし — Minix ファイルシステムのサポートがありません |
mknod | yes | yes | /usr/bin/mknod |
mkswap | yes | yes | /usr/sbin/mkswap |
mktemp | yes | yes | /usr/bin/mktemp |
modprobe | yes | yes | /sbin/modprobe 、/usr/sbin/modprobe |
more | yes | yes | /usr/bin/more |
mount | yes | yes | /sbin/mount 、/usr/bin/mount |
mountpoint | no | no | mount コマンドの出力を確認してください |
msh | no | no | なし |
mt | yes | yes | /usr/bin/mt |
mv | yes | yes | /usr/bin/mv |
nameif | no | no | なし |
nc | no | yes | /usr/bin/nc |
netstat | no | yes | /bin/netstat |
nice | no | yes | /bin/nice |
nohup | no | yes | /usr/bin/nohup |
nslookup | yes | yes | /usr/bin/nslookup |
od | no | yes | /usr/bin/od |
openvt | yes | yes | /usr/bin/openvt |
passwd | no | yes | /usr/bin/passwd |
patch | no | yes | /usr/bin/patch |
pidof | yes | yes | /usr/sbin/pidof |
ping | yes | yes | /usr/bin/ping |
ping6 | no | yes | /bin/ping6 |
pipe_progress | no | no | なし |
pivot_root | no | yes | /sbin/pivot_root |
printenv | no | yes | /usr/bin/printenv |
printf | no | yes | /usr/bin/printf |
ps | yes | yes | /usr/bin/ps |
pwd | yes | yes | /usr/bin/pwd |
rdate | no | yes | /usr/bin/rdate |
readlink | yes | yes | /sbin/readlink 、/usr/bin/readlink |
readprofile | no | yes | /usr/sbin/readprofile |
realpath | no | no | Python os.path.realpath() |
renice | no | yes | /usr/bin/renice |
reset | no | yes | /usr/bin/reset |
rm | yes | yes | /sbin/rm 、/usr/bin/rm |
rmdir | yes | yes | /sbin/rmdir 、/usr/bin/rmdir |
rmmod | yes | yes | /sbin/rmmod 、/usr/bin/rmmod |
route | yes | yes | /sbin/route 、/usr/sbin/route |
rpm | yes | yes | /usr/bin/rpm |
rpm2cpio | no | yes | /usr/bin/rpm2cpio |
run-parts | no | no | なし |
runlevel | no | no | なし |
rx | no | no | なし |
sed | yes | yes | /sbin/sed 、/usr/bin/sed |
seq | no | yes | /usr/bin/seq |
setarch | no | yes | /usr/bin/setarch |
setconsole | no | no | なし |
setkeycodes | no | yes | /usr/bin/setkeycodes |
setlogcons | no | no | なし |
setsid | no | yes | /usr/bin/setsid |
sh | yes | yes | /sbin/sh 、/usr/bin/sh |
sha1sum | yes | yes | /usr/bin/sha1sum |
sleep | yes | yes | /sbin/sleep 、/usr/bin/sleep |
sort | yes | yes | /usr/bin/sort |
start-stop-daemon | no | no | なし |
stat | no | yes | /usr/bin/stat または Python os.stat() |
strings | no | yes | /usr/bin/strings |
stty | no | yes | /bin/stty |
su | no | yes | /bin/su |
sulogin | no | yes | /sbin/sulogin |
sum | no | yes | /usr/bin/sum |
swapoff | yes | yes | /usr/sbin/swapoff |
swapon | yes | yes | /usr/sbin/swapon |
switch_root | no | yes | /sbin/switch_root |
sync | yes | yes | /usr/bin/sync |
sysctl | no | yes | /sbin/sysctl |
tail | yes | yes | /usr/bin/tail |
tar | yes | yes | /usr/bin/tar |
tee | yes | yes | /usr/bin/tee |
telnet | yes | yes | /usr/bin/telnet |
telnetd | no | no | なし — スクリプト部分にデーモンは使用できません。 |
test | no | yes | /usr/bin/test または bash 内の [ |
tftp | no | yes | /usr/bin/tftp |
time | no | yes | /usr/bin/time または Python |
top | yes | yes | /usr/bin/top |
touch | yes | yes | /sbin/touch 、/usr/bin/touch |
tr | no | yes | /usr/bin/tr または Python |
traceroute | no | yes | /bin/traceroute |
true | yes | yes | /usr/bin/true |
tty | no | yes | /usr/bin/tty |
tune2fs | yes | yes | /usr/sbin/tune2fs |
udhcpc | no | no | /sbin/dhclient |
udhcpd | no | no | なし — スクリプト部分にデーモンは使用できません。 |
umount | yes | yes | /sbin/umount 、/usr/bin/umount |
uname | no | yes | /bin/uname または Python os.uname() |
uncompress | no | no | なし |
uniq | yes | yes | /usr/bin/uniq |
unix2dos | no | no | sed 's/$//' |
unlzma | no | yes | /usr/bin/unlzma |
unzip | no | yes | /usr/bin/unzip |
uptime | no | yes | /usr/bin/uptime または Python の /proc/uptime の読み込み |
usleep | no | yes | /bin/usleep または Python |
uudecode | no | yes | /usr/bin/uudecode または Python |
uuencode | no | yes | /usr/bin/uuencode または Python |
vconfig | yes | yes | /usr/sbin/vconfig |
vi | yes | yes | /usr/bin/vi |
vlock | no | no | なし |
watch | no | yes | /usr/bin/watch |
watchdog | no | no | なし |
wc | yes | yes | /usr/bin/wc |
wget | yes | yes | /sbin/wget 、/usr/bin/wget |
which | no | yes | /usr/bin/which |
who | no | yes | /usr/bin/who |
whoami | no | yes | /usr/bin/whoami |
xargs | yes | yes | /usr/bin/xargs |
yes | no | yes | /usr/bin/yes |
zcat | yes | yes | /usr/bin/zcat |
zcip | no | no | NetworkManager がこれを処理するはずです。 |
[b]
GNU bash により文字列操作を使用した basename の機能性を利用できます。 var="/usr/bin/command" の場合は、echo ${var##*/} は command を書き出します。
[c]
GNU bash により文字列操作を使用した dirname の機能を利用できます。 var="/usr/bin/command" の場合は、echo ${var%/*} は /usr/bin を書き出します。
|