KEYWORD:Solaris,ulimit
ulimit ユーティリティは、シェルとその子プロセスに課せられる書き込み時のファイルサイズの制限値を、設定または報告 。
-a オプションは制限値すべてを表示
(Tue Jun 26 16:51:59) root@blade1000:etc: ulimit -a
core file size (blocks) unlimited
data seg size (kbytes) unlimited
file size (blocks) unlimited
open files 256
pipe size (512 bytes) 10
stack size (kbytes) 8192
cpu time (seconds) unlimited
max user processes 29995
virtual memory (kbytes) unlimited
2007年6月30日土曜日
Solaris 9で、/etc/systemへの変更
KEYWORD:/etc/system,Solaris,sysdef
Solais 9
/etc/systemに変更を加えて、shutdown -i6 -g0 -y しても、sysdefの出力に反映されない
(Wed Jun 27 12:04:47) root@blade1000:etc: /usr/sbin/sysdef | grep SEM
10 semaphore identifiers (SEMMNI)
60 semaphores in system (SEMMNS)
30 undo structures in system (SEMMNU)
25 max semaphores per id (SEMMSL)
10 max operations per semop call (SEMOPM)
10 max undo entries per process (SEMUME)
32767 semaphore maximum value (SEMVMX)
16384 adjust on exit max value (SEMAEM)
(Wed Jun 27 12:05:00) root@blade1000:etc: /usr/sbin/sysdef | grep SHM
8388608 max shared memory segment size (SHMMAX)
100 shared memory identifiers (SHMMNI)
(Wed Jun 27 12:05:10) root@blade1000:etc:
{1} ok boot -r
SC Alert: Host System has Reset
Probing system devices
Probing memory
Probing I/O buses
screen not found.
keyboard not found.
Keyboard not present. Using ttya for input and output.
Probing system devices
Probing memory
Probing I/O buses
|
|
starting rpc services: rpcbind done.
Setting netmask of bge0 to 255.255.255.0
Setting default IPv4 interface for multicast: add net 224.0/4: gateway blade1000
syslog service starting.
volume management starting.
The system is ready.
blade1000 console login: root
Password:
Jun 27 13:15:17 blade1000 login: ROOT LOGIN /dev/console
Last login: Wed Jun 27 13:11:20 on console
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
# sysdef | grep SHM
# sysdef | grep SEM
# exit
blade1000 console login:
$
ところが
(Wed Jun 27 15:20:12) root@blade1000:etc: diff -w system.20070627 system
93a94,106
>
> * ts:20070627 add
> * Oracle 10g + JP1/AJS2
> set noexec_user_stack=1
> set semsys:seminfo_semmni=110
> set semsys:seminfo_semmns=1034
> set semsys:seminfo_semmsl=256
> set semsys:seminfo_semvmx=32767
> set shmsys:shminfo_shmmax=4294967295
> set shmsys:shminfo_shmmni=110
> forceload: sys/shmsys
> forceload: sys/semsys
> forceload: sys/msgsys
(Wed Jun 27 15:20:19) root@blade1000:etc:
(Wed Jun 27 15:21:04) root@blade1000:etc: sysdef | grep SEM
110 semaphore identifiers (SEMMNI)
1034 semaphores in system (SEMMNS)
30 undo structures in system (SEMMNU)
256 max semaphores per id (SEMMSL)
10 max operations per semop call (SEMOPM)
10 max undo entries per process (SEMUME)
32767 semaphore maximum value (SEMVMX)
16384 adjust on exit max value (SEMAEM)
(Wed Jun 27 15:21:28) root@blade1000:etc: sysdef | grep SHM
4294967295 max shared memory segment size (SHMMAX)
110 shared memory identifiers (SHMMNI)
(Wed Jun 27 15:21:31) root@blade1000:etc:
カーネルモジュールは必要に応じてロードされるので、利用されない場合はロードされない。
sysdefの結果の意味は、まだロードされてないよーだった。
* IPC Messages module is not loaded
* IPC Semaphores module is not loaded
* IPC Shared Memory module is not loaded
手動でモジュールをロードするには、
# modload /kernel/sys/shmsys
# modload /kernel/sys/semsys
# modload /kernel/sys/msgsys
起動時に読み込んでしまうには、
/etc/systemに、
forceload: sys/shmsys
forceload: sys/semsys
forceload: sys/msgsys
する。
Solais 9
/etc/systemに変更を加えて、shutdown -i6 -g0 -y しても、sysdefの出力に反映されない
(Wed Jun 27 12:04:47) root@blade1000:etc: /usr/sbin/sysdef | grep SEM
10 semaphore identifiers (SEMMNI)
60 semaphores in system (SEMMNS)
30 undo structures in system (SEMMNU)
25 max semaphores per id (SEMMSL)
10 max operations per semop call (SEMOPM)
10 max undo entries per process (SEMUME)
32767 semaphore maximum value (SEMVMX)
16384 adjust on exit max value (SEMAEM)
(Wed Jun 27 12:05:00) root@blade1000:etc: /usr/sbin/sysdef | grep SHM
8388608 max shared memory segment size (SHMMAX)
100 shared memory identifiers (SHMMNI)
(Wed Jun 27 12:05:10) root@blade1000:etc:
{1} ok boot -r
SC Alert: Host System has Reset
Probing system devices
Probing memory
Probing I/O buses
screen not found.
keyboard not found.
Keyboard not present. Using ttya for input and output.
Probing system devices
Probing memory
Probing I/O buses
|
|
starting rpc services: rpcbind done.
Setting netmask of bge0 to 255.255.255.0
Setting default IPv4 interface for multicast: add net 224.0/4: gateway blade1000
syslog service starting.
volume management starting.
The system is ready.
blade1000 console login: root
Password:
Jun 27 13:15:17 blade1000 login: ROOT LOGIN /dev/console
Last login: Wed Jun 27 13:11:20 on console
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
# sysdef | grep SHM
# sysdef | grep SEM
# exit
blade1000 console login:
$
ところが
(Wed Jun 27 15:20:12) root@blade1000:etc: diff -w system.20070627 system
93a94,106
>
> * ts:20070627 add
> * Oracle 10g + JP1/AJS2
> set noexec_user_stack=1
> set semsys:seminfo_semmni=110
> set semsys:seminfo_semmns=1034
> set semsys:seminfo_semmsl=256
> set semsys:seminfo_semvmx=32767
> set shmsys:shminfo_shmmax=4294967295
> set shmsys:shminfo_shmmni=110
> forceload: sys/shmsys
> forceload: sys/semsys
> forceload: sys/msgsys
(Wed Jun 27 15:20:19) root@blade1000:etc:
(Wed Jun 27 15:21:04) root@blade1000:etc: sysdef | grep SEM
110 semaphore identifiers (SEMMNI)
1034 semaphores in system (SEMMNS)
30 undo structures in system (SEMMNU)
256 max semaphores per id (SEMMSL)
10 max operations per semop call (SEMOPM)
10 max undo entries per process (SEMUME)
32767 semaphore maximum value (SEMVMX)
16384 adjust on exit max value (SEMAEM)
(Wed Jun 27 15:21:28) root@blade1000:etc: sysdef | grep SHM
4294967295 max shared memory segment size (SHMMAX)
110 shared memory identifiers (SHMMNI)
(Wed Jun 27 15:21:31) root@blade1000:etc:
カーネルモジュールは必要に応じてロードされるので、利用されない場合はロードされない。
sysdefの結果の意味は、まだロードされてないよーだった。
* IPC Messages module is not loaded
* IPC Semaphores module is not loaded
* IPC Shared Memory module is not loaded
手動でモジュールをロードするには、
# modload /kernel/sys/shmsys
# modload /kernel/sys/semsys
# modload /kernel/sys/msgsys
起動時に読み込んでしまうには、
/etc/systemに、
forceload: sys/shmsys
forceload: sys/semsys
forceload: sys/msgsys
する。
2007年6月24日日曜日
Solaris 8に、swapを追加
KEYWORD:Solaris,swap
(Sun Jun 24 11:09:20)root@Ultra30:Studio11: mkfile 1024m /export/swap
(Sun Jun 24 11:09:20)root@Ultra30:Studio11: swap -a /export/swap
(Sun Jun 24 11:09:20)root@Ultra30:Studio11: diff /etc/vfstab.20070624 /etc/vfstab
10a11
> /export/swap - - swap - no -
(Sun Jun 24 11:09:29)root@Ultra30:Studio11:
(Sun Jun 24 11:10:25)root@Ultra30:init.d: chmod 755 swapadd
(Sun Jun 24 11:10:30)root@Ultra30:init.d: ls -l swapadd
-rwxr-xr-x 1 root other 31 Jun 24 11:10 swapadd
(Sun Jun 24 11:10:37)root@Ultra30:init.d: cat swapadd
#!/bin/sh
/sbin/swapadd
exit 0
(Sun Jun 24 11:10:40)root@Ultra30:init.d:
(Sun Jun 24 11:10:40)root@Ultra30:init.d: cd ../rc2.d
(Sun Jun 24 11:10:56)root@Ultra30:rc2.d: ln -s ../init.d/swapadd S99swap.add
(Sun Jun 24 11:11:06)root@Ultra30:rc2.d: ls -l S99swap.add
lrwxrwxrwx 1 root other 17 Jun 24 11:11 S99swap.add -> ../init.d/swapadd
(Sun Jun 24 11:11:10)root@Ultra30:rc2.d:
(Sun Jun 24 11:59:33)root@Ultra30:/tmp: swap -l
swapfile dev swaplo blocks free
/dev/dsk/c0t0d0s1 32,1 16 1052144 1044416
/export/swap - 16 2097136 2091840
(Sun Jun 24 11:59:41)root@Ultra30:/tmp:
(Sun Jun 24 11:09:20)root@Ultra30:Studio11: mkfile 1024m /export/swap
(Sun Jun 24 11:09:20)root@Ultra30:Studio11: swap -a /export/swap
(Sun Jun 24 11:09:20)root@Ultra30:Studio11: diff /etc/vfstab.20070624 /etc/vfstab
10a11
> /export/swap - - swap - no -
(Sun Jun 24 11:09:29)root@Ultra30:Studio11:
(Sun Jun 24 11:10:25)root@Ultra30:init.d: chmod 755 swapadd
(Sun Jun 24 11:10:30)root@Ultra30:init.d: ls -l swapadd
-rwxr-xr-x 1 root other 31 Jun 24 11:10 swapadd
(Sun Jun 24 11:10:37)root@Ultra30:init.d: cat swapadd
#!/bin/sh
/sbin/swapadd
exit 0
(Sun Jun 24 11:10:40)root@Ultra30:init.d:
(Sun Jun 24 11:10:40)root@Ultra30:init.d: cd ../rc2.d
(Sun Jun 24 11:10:56)root@Ultra30:rc2.d: ln -s ../init.d/swapadd S99swap.add
(Sun Jun 24 11:11:06)root@Ultra30:rc2.d: ls -l S99swap.add
lrwxrwxrwx 1 root other 17 Jun 24 11:11 S99swap.add -> ../init.d/swapadd
(Sun Jun 24 11:11:10)root@Ultra30:rc2.d:
(Sun Jun 24 11:59:33)root@Ultra30:/tmp: swap -l
swapfile dev swaplo blocks free
/dev/dsk/c0t0d0s1 32,1 16 1052144 1044416
/export/swap - 16 2097136 2091840
(Sun Jun 24 11:59:41)root@Ultra30:/tmp:
2007年6月19日火曜日
Solaris 9で、ネットワークインターフェイス名を知りたい
KEYWORD:Solaris,/etc/hostname.,ネットワークインターフェイス
新規でインストールする時、ネットワークを設定しないと、/etc/hostname.ネットワークインターフェイス名ファイルが作成されないため、ネットワークインターフェイス名がわからない。
Jun 19 06:31:19 blade1000 genunix: [ID 678236 kern.info] Ethernet address = 0:3:ba:2:a5:72
root@blade1000:/: dmesg | grep -i Net
Jun 18 06:48:27 blade1000 pcisch: [ID 370704 kern.info] PCI-device: network@5,1, eri0
Jun 18 06:48:27 blade1000 genunix: [ID 936769 kern.info] eri0 is /pci@8,700000/network@5,1
Jun 19 06:31:19 blade1000 genunix: [ID 678236 kern.info] Ethernet address = 0:3:ba:2:a5:72
Jun 19 06:31:28 blade1000 pcisch: [ID 370704 kern.info] PCI-device: network@5,1, eri0
Jun 19 06:31:28 blade1000 genunix: [ID 936769 kern.info] eri0 is /pci@8,700000/network@5,1
root@blade1000:/:
root@blade1000:/:
root@blade1000:/: LANG=C ls -l /etc/hostname.eri0
-rw-r--r-- 1 root root 10 May 26 00:42 /etc/hostname.eri0
root@blade1000:/:
Password:
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
# dmesg | grep Ether
Jun 16 17:28:22 Ultra60 hme: [ID 786680 kern.notice] SUNW,hme0 : No response from Ethernet network : Link down -- cable problem?
Jun 16 17:31:05 Ultra60 genunix: [ID 678236 kern.info] Ethernet address = 8:0:20:9b:cb:de
Jun 19 06:32:09 Ultra60 genunix: [ID 678236 kern.info] Ethernet address = 8:0:20:9b:cb:de
Jun 19 06:32:26 Ultra60 hme: [ID 786680 kern.notice] SUNW,hme0 : No response from Ethernet network : Link down -- cable problem?
Jun 19 06:32:37 Ultra60 hme: [ID 786680 kern.notice] SUNW,hme0 : No response from Ethernet network : Link down -- cable problem?
Jun 19 06:32:48 Ultra60 hme: [ID 786680 kern.notice] SUNW,hme0 : No response from Ethernet network : Link down -- cable problem?
# dmesg | grep Net
#
# LANG=C ls -l /etc/hostname.hme0
-rw-r--r-- 1 root root 8 Jun 8 23:52 /etc/hostname.hme0
#
Jun 17 12:24:09 T21 genunix: [ID 678236 kern.info] Ethernet address = 0:3:47:f:f0:64
Jun 18 05:20:46 T21 genunix: [ID 678236 kern.info] Ethernet address = 0:3:47:f:f0:64
Jun 19 06:26:33 T21 genunix: [ID 678236 kern.info] Ethernet address = 0:3:47:f:f0:64
root@T21:/: dmesg | grep -i ether
Jun 17 12:24:09 T21 genunix: [ID 678236 kern.info] Ethernet address = 0:3:47:f:f0:64
Jun 17 12:24:09 T21 gld: [ID 944156 kern.info] iprb0: Intel 82558/82559 Ver 0.010.6 Driver: type "ether" mac address 00:03:47:0f:f0:64
Jun 18 05:20:46 T21 genunix: [ID 678236 kern.info] Ethernet address = 0:3:47:f:f0:64
Jun 18 05:20:46 T21 gld: [ID 944156 kern.info] iprb0: Intel 82558/82559 Ver 0.010.6 Driver: type "ether" mac address 00:03:47:0f:f0:64
Jun 19 06:26:33 T21 genunix: [ID 678236 kern.info] Ethernet address = 0:3:47:f:f0:64
Jun 19 06:26:33 T21 gld: [ID 944156 kern.info] iprb0: Intel 82558/82559 Ver 0.010.6 Driver: type "ether" mac address 00:03:47:0f:f0:64
root@T21:/:root@T21:/: LANG=C ls -l /etc/hostname.iprb0
-rw-r--r-- 1 root root 4 Jun 2 13:58 /etc/hostname.iprb0
root@T21:/:
Jun 19 06:52:57 sol9 genunix: [ID 678236 kern.info] Ethernet address = 0:c:29:4f:5b:e
Jun 19 06:52:57 sol9 gld: [ID 944156 kern.info] pcn0: PC-Net (Generic): type "ether" mac address 00:0c:29:4f:5b:0e
# dmesg | grep -i Ether
Jun 19 06:52:57 sol9 genunix: [ID 678236 kern.info] Ethernet address = 0:c:29:4f:5b:e
Jun 19 06:52:57 sol9 gld: [ID 944156 kern.info] pcn0: PC-Net (Generic): type "ether" mac address 00:0c:29:4f:5b:0e
# LANG=C ls -l /etc/hostname.pcn0
-rw-r--r-- 1 root root 5 Jun 4 01:55 /etc/hostname.pcn0
#
#
# dmesg | grep Eth
Jun 18 18:38:46 V125 genunix: [ID 678236 kern.info] Ethernet address = 0:14:4f:65:6b:52
Jun 18 18:39:11 V125 gld: [ID 944156 kern.info] bge0: Broadcom Gb Ethernet v0.52: type "ether" mac address
00:14:4f:65:6b:52
Jun 18 18:39:12 V125 gld: [ID 944156 kern.info] bge1: Broadcom Gb Ethernet v0.52: type "ether" mac address
00:14:4f:65:6b:53
#
新規でインストールする時、ネットワークを設定しないと、/etc/hostname.ネットワークインターフェイス名ファイルが作成されないため、ネットワークインターフェイス名がわからない。
- blade1000の場合
Jun 19 06:31:19 blade1000 genunix: [ID 678236 kern.info] Ethernet address = 0:3:ba:2:a5:72
root@blade1000:/: dmesg | grep -i Net
Jun 18 06:48:27 blade1000 pcisch: [ID 370704 kern.info] PCI-device: network@5,1, eri0
Jun 18 06:48:27 blade1000 genunix: [ID 936769 kern.info] eri0 is /pci@8,700000/network@5,1
Jun 19 06:31:19 blade1000 genunix: [ID 678236 kern.info] Ethernet address = 0:3:ba:2:a5:72
Jun 19 06:31:28 blade1000 pcisch: [ID 370704 kern.info] PCI-device: network@5,1, eri0
Jun 19 06:31:28 blade1000 genunix: [ID 936769 kern.info] eri0 is /pci@8,700000/network@5,1
root@blade1000:/:
root@blade1000:/:
root@blade1000:/: LANG=C ls -l /etc/hostname.eri0
-rw-r--r-- 1 root root 10 May 26 00:42 /etc/hostname.eri0
root@blade1000:/:
- Ultra60の場合
Password:
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
# dmesg | grep Ether
Jun 16 17:28:22 Ultra60 hme: [ID 786680 kern.notice] SUNW,hme0 : No response from Ethernet network : Link down -- cable problem?
Jun 16 17:31:05 Ultra60 genunix: [ID 678236 kern.info] Ethernet address = 8:0:20:9b:cb:de
Jun 19 06:32:09 Ultra60 genunix: [ID 678236 kern.info] Ethernet address = 8:0:20:9b:cb:de
Jun 19 06:32:26 Ultra60 hme: [ID 786680 kern.notice] SUNW,hme0 : No response from Ethernet network : Link down -- cable problem?
Jun 19 06:32:37 Ultra60 hme: [ID 786680 kern.notice] SUNW,hme0 : No response from Ethernet network : Link down -- cable problem?
Jun 19 06:32:48 Ultra60 hme: [ID 786680 kern.notice] SUNW,hme0 : No response from Ethernet network : Link down -- cable problem?
# dmesg | grep Net
#
# LANG=C ls -l /etc/hostname.hme0
-rw-r--r-- 1 root root 8 Jun 8 23:52 /etc/hostname.hme0
#
- T21(Think Pad T21)の場合
Jun 17 12:24:09 T21 genunix: [ID 678236 kern.info] Ethernet address = 0:3:47:f:f0:64
Jun 18 05:20:46 T21 genunix: [ID 678236 kern.info] Ethernet address = 0:3:47:f:f0:64
Jun 19 06:26:33 T21 genunix: [ID 678236 kern.info] Ethernet address = 0:3:47:f:f0:64
root@T21:/: dmesg | grep -i ether
Jun 17 12:24:09 T21 genunix: [ID 678236 kern.info] Ethernet address = 0:3:47:f:f0:64
Jun 17 12:24:09 T21 gld: [ID 944156 kern.info] iprb0: Intel 82558/82559 Ver 0.010.6 Driver: type "ether" mac address 00:03:47:0f:f0:64
Jun 18 05:20:46 T21 genunix: [ID 678236 kern.info] Ethernet address = 0:3:47:f:f0:64
Jun 18 05:20:46 T21 gld: [ID 944156 kern.info] iprb0: Intel 82558/82559 Ver 0.010.6 Driver: type "ether" mac address 00:03:47:0f:f0:64
Jun 19 06:26:33 T21 genunix: [ID 678236 kern.info] Ethernet address = 0:3:47:f:f0:64
Jun 19 06:26:33 T21 gld: [ID 944156 kern.info] iprb0: Intel 82558/82559 Ver 0.010.6 Driver: type "ether" mac address 00:03:47:0f:f0:64
root@T21:/:root@T21:/: LANG=C ls -l /etc/hostname.iprb0
-rw-r--r-- 1 root root 4 Jun 2 13:58 /etc/hostname.iprb0
root@T21:/:
- sol9(VMWare 5.5.4 build-44386)
Jun 19 06:52:57 sol9 genunix: [ID 678236 kern.info] Ethernet address = 0:c:29:4f:5b:e
Jun 19 06:52:57 sol9 gld: [ID 944156 kern.info] pcn0: PC-Net (Generic): type "ether" mac address 00:0c:29:4f:5b:0e
# dmesg | grep -i Ether
Jun 19 06:52:57 sol9 genunix: [ID 678236 kern.info] Ethernet address = 0:c:29:4f:5b:e
Jun 19 06:52:57 sol9 gld: [ID 944156 kern.info] pcn0: PC-Net (Generic): type "ether" mac address 00:0c:29:4f:5b:0e
# LANG=C ls -l /etc/hostname.pcn0
-rw-r--r-- 1 root root 5 Jun 4 01:55 /etc/hostname.pcn0
#
- V125
#
# dmesg | grep Eth
Jun 18 18:38:46 V125 genunix: [ID 678236 kern.info] Ethernet address = 0:14:4f:65:6b:52
Jun 18 18:39:11 V125 gld: [ID 944156 kern.info] bge0: Broadcom Gb Ethernet v0.52: type "ether" mac address
00:14:4f:65:6b:52
Jun 18 18:39:12 V125 gld: [ID 944156 kern.info] bge1: Broadcom Gb Ethernet v0.52: type "ether" mac address
00:14:4f:65:6b:53
#
2007年6月18日月曜日
Solarisで、QEMU
やっぱり Sun がスキ!っていうサイトhttp://blogs.sun.com/yappri/date/20060829に
オープンソースソフトウェアをSolaris向けにコンパイルして配布しているBlastwave というコミュニティが存在しており、そのコミュニティで、QEMUのコンパイル済みパッ ケージも配布されています。
って書いてありました。
オープンソースソフトウェアをSolaris向けにコンパイルして配布しているBlastwave というコミュニティが存在しており、そのコミュニティで、QEMUのコンパイル済みパッ ケージも配布されています。
って書いてありました。
Solaris 9のpatchaddの戻り値
Solaris 9 patchaddの戻り値
2:既に当っている
4:バックアップ用に使用するディスクスペースが不十分
8:当てる先のソフトがインストールされていない
25:先に当るべきパッチがあたっていない
35:より新しいのが既にあたってる。
2:既に当っている
4:バックアップ用に使用するディスクスペースが不十分
8:当てる先のソフトがインストールされていない
25:先に当るべきパッチがあたっていない
35:より新しいのが既にあたってる。
Solaris 9で、Sun Studio 11
Sun Studio 11のコンパイラを使用
# cd /usr/ucb
# mv cc cc.YYYYMMDD
# ln -s /opt/SUNWspro/bin/cc cc
または、/usr/ucbより、/opt/SUNWspro/binへのパスを先に通す
2007年6月5日火曜日
Solaris 9のlogのrotateは
Solaris 9で、/var/adm/messageは、どうやってローテイトしているのだろう。
indou@blade1000:~: su -
Password:
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
# bash
root@blade1000:/: crontab -l
#ident "@(#)root 1.20 01/11/06 SMI"
#
# The root crontab should be used to perform accounting data collection.
#
# The rtc command is run to adjust the real time clock if and when
# daylight savings time changes.
#
10 3 * * * /usr/sbin/logadm
15 3 * * 0 /usr/lib/fs/nfs/nfsfind
1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1
30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
#10 3 * * * /usr/lib/krb5/kprop_script ___slave_kdcs___
root@blade1000:/: cat /etc/logadm.conf
# Copyright 2001-2002 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#ident "@(#)logadm.conf 1.2 02/02/13 SMI"
#
# logadm.conf
#
# Default settings for system log file management.
# The -w option to logadm(1M) is the preferred way to write to this file,
# but if you do edit it by hand, use "logadm -V" to check it for errors.
#
# The format of lines in this file is:
#
# For each logname listed here, the default options to logadm
# are given. Options given on the logadm command line override
# the defaults contained in this file.
#
# logadm typically runs early every morning via an entry in
# root's crontab (see crontab(1)).
#
/var/log/syslog -C 8 -P 'Fri Jun 1 18:14:01 2007' -a 'kill -HUP `cat /var/run/syslog.pid`'
/var/adm/messages -C 4 -P 'Fri Jun 1 18:14:01 2007' -a 'kill -HUP `cat /var/run/syslog.pid`'
/var/cron/log -c -s 512k -t /var/cron/olog
/var/lp/logs/lpsched -C 2 -N -t '$file.$N'
#
# The entry below is used by turnacct(1M)
#
/var/adm/pacct -C 0 -N -a '/usr/lib/acct/accton pacct' -g adm -m 664 -o adm -p never
root@blade1000:/:
root@blade1000:/: uname -a
SunOS blade1000 5.9 Generic_122300-07 sun4u sparc SUNW,Sun-Blade-1000
root@blade1000:/:
root@blade1000:/: man logadm
マニュアルを清書中です。しばらくお待ちください... 終了
System Administration Commands logadm(1M)
NAME
logadm - manage endlessly growing log files
SYNOPSIS
logadm
logadm [-options] logname...
DESCRIPTION
logadm is a general log rotation tool that is suitable for
running from cron(1M).
Without arguments, logadm reads the /etc/logadm.conf file,
and for every entry found in that file checks the
corresponding log file to see if it should be rotated. Typi-
cally this check is done each morning by an entry in the
root's crontab.
If the logname argument is specified, logadm renames the
corresponding log file by adding a suffix so that the most
recent log file ends with .0 (that is, logfile.0), the next
most recent ends with .1 (that is, logfile.1), and so forth.
By default, ten versions of old log files are kept (that is,
logfile.0 through logfile.9) and logadm automatically
deletes the oldest version when appropriate to keep the
count of files at ten.
logadm takes a number of options. You can specify these
options on the command line or in the /etc/logadm.conffile .
The logadm command searches /etc/logadm.conf for lines of
the form logname options
logname
Identifies the name of the entry in /etc/logadm.conf,
but if no log file name is given in that entry it is
assumed that the logname is the same as the actual log
file name.
options
Identifies command line options exactly as they would
be entered on the command line. This allows commonly
used log rotation policies to be stored in the
/etc/logadm.conf file. See EXAMPLES.
If options are specified both in /etc/logadm.conf and
on the command line, those in the /etc/logadm.conf
file are applied first. Therefore, the command line
options override those in /etc/logadm.conf.
Log file names specified in /etc/logadm.conf may con-
tain filename substitution characters such as * and ?
that are supported by csh(1).
SunOS 5.9 Last change: 6 Dec 2001 1
System Administration Commands logadm(1M)
Two options control when a log file is rotated. They are: -s
size -p period.
When using more than one of these options at a time, there
is an implied and between them. This means that all condi-
tions must be met before the log is rotated.
If neither of these two options are specified, the default
conditions for rotating a log file are: -s 1b -p 1w, which
means the log file is only rotated if the size is non-zero
and if at least 1 week has passed since the last time it was
rotated.
By specifying -p never as a rotation condition, any other
rotation conditions are ignored and logadm moves on to the
expiration of old log files. By specifying -p now as a rota-
tion condition, a log rotation is forced.
Unless specified by the -o, -g, or -m options, logadm
replaces the log file (after renaming it) by creating an
empty file whose owner, group ID, and permissions match the
original file.
Three options control when old log files are expired: -A age
-C count -S size. These options expire the oldest log files
until a particular condition or conditions are met. For
example, the combination -C 5 and the -S 10m options expires
old log files until there are no more than 5 of the and
their combined disk usage is no more than 10 megabytes. If
none of these options are specified, the default expiration
is -C 10 which keeps ten old log files. If no files are to
be expired, use -C 0 to prevent expiration by default.
OPTIONS
The following options are supported:
-a post_command
Execute the post_command after renaming the log file.
post_command is passed to sh -c.
Specify post_command as a valid shell command. Use
quotes to protect spaces or shell metacharacters in
post_command.
This option can be used to restart a daemon that is
writing to the file. When rotating multiple logs with
one logadm command, post_command is executed only once
after all the logs are rotated, not once per rotated
log.
-A age
Delete any versions that have not been modified for
SunOS 5.9 Last change: 6 Dec 2001 2
System Administration Commands logadm(1M)
the amount of time specified by age.
Specify age as a number followed by an h (hours), d
(days), w(weeks), m (months), or y (years).
-b pre_command
Execute pre_command before renaming the log file.
pre_command is passed to sh -c.
Specify pre_command as a valid shell command. Use
quotes to protect spaces or shell metacharacters in
the pre_command.
This option can be used to stop a daemon that is writ-
ing to the file. When rotating multiple logs with one
logadm command, pre_command is executed only once
before all the logs are rotated, not once per rotated
log.
-c Rotate the log file by copying it and truncating the
original logfile to zero length, rather than renaming
the file.
-C count
Delete the oldest versions until there are not more
than count files left.
If no expire options (-A, -C, or -S) are specified, -C
10 is the default. To prevent the default expire rule
from being added automatically, specify -C 0 .
-e mail_addr
Send error messages by email to mail_addr.
As logadm is typically run from cron(1M), error mes-
sages are captured by cron and mailed to the owner of
the crontab.
This option is useful you want the mail regarding
error messages to go to another address instead. If no
errors are encountered, no mail message is generated.
-E cmd
Execute cmd to expire the file, rather than deleting
the old log file to expire it.
cmd is passed it to sh -c. The file is considered
expired after cmd completes. If the old log file is
not removed or renamed by the cmd, logadm considers it
for expiration the next time that it runs on the
specified log file. If present, the keyword $file is
expanded in the specified cmd to the name of the file
SunOS 5.9 Last change: 6 Dec 2001 3
System Administration Commands logadm(1M)
being expired.
This option is useful for tasks such as mailing old
log files to administrators, or copying old log files
to long term storage.
-f conf_file
Use conf_file instead of /etc/logadm.conf.
This option allows non-root users to keep their own
logadm configuration files.
-g group
Create a new empty file with the ID specified by
group, instead of preserving the group ID of the log
file.
Specify group by name or by numeric group ID, as
accepted by chgrp(1).
This option requires the ability to change file group
ownership using the chgrp(1) command.
-h Print a help message that describes logadm's options.
-m mode
Create a new empty file with the mode specified by
mode, instead of preserving the mode of the log file.
Specify mode in any form that is accepted by the
chmod(1) command.
-n Print the actions that the logadm command will perform
without actually performing them.
This option is useful for checking arguments before
making any changes to the system.
It is important to remember, however, that since log
rotating actions are only printed with this option,
logadm might not find files that need expiring, but if
run without the -n logadm might create a file that
needs expiring by performing the log rotating actions.
Therefore, if you see no files being expired with the
-n option, files still might be expired without it.
-N Prevent an error message if the specified logfile does
not exist. Normally, logadm produces an error message
if the log file is not found. With -N, if the log file
doesn't exist logadm moves on to the expire rules (if
any) and then to the next log file (if any), without
SunOS 5.9 Last change: 6 Dec 2001 4
System Administration Commands logadm(1M)
creating the empty replacement log file.
-o owner
Create the new empty file with owner, instead of
preserving the owner of the log file.
Specify owner in any form that is accepted by the
chown(1) command.
-p period
Rotate a log file after the specified time period
(period) .
Specify period as a number followed by d for days, w
for weeks, m for months (really 30 days) or y for
years. There are also two special values for period:
now and never. -p now forces log rotation. -p never
forces no log rotation.
-P timestamp
Used by logadm to record the last time the log was
rotated in /etc/logadm.conf.
This option uses timestamp to determine if the log
rotation period has passed. The format of timestamp
matches the format generated by ctime(3C), with quotes
around it to protect embedded spaces.
-r Remove any entries corresponding to the specified log-
name from the /etc/logadm.conf.
-R cmd
Run the cmd when an old log file is created by a log
rotation. If the keyword $file is embedded in the
specified command, it is expanded to the name of the
old log file just created by log rotation.
This option is useful for processing log file contents
after rotating the log. cmd is executed by passing it
to sh -c. When rotating multiple logs with one logadm
command, the command supplied with -R is executed once
every time a log is rotated. This is useful for post-
processing a log file (that is, sorting it, removing
uninteresting lines, etc.). The -a option is a better
choice for restarting daemons after log rotation.
-s size
Rotate the log file only if its size is greater than
or equal to size.
Specify size as a number followed by the letter b for
bytes, k for kilobytes, m for megabytes, or g for
SunOS 5.9 Last change: 6 Dec 2001 5
System Administration Commands logadm(1M)
gigabytes.
-S size
Delete the oldest versions until the total disk space
used by the old log files is less than the specified
size.
Specify size as a number followed by the letter b for
bytes, k for kilobytes, m for megabytes, or g for
gigabytes.
-t template
Specify the template to use when renaming log files.
template can be a simple name, such as
/var/adm/oldfile, or it can contain special keywords
which are expanded by logadm and are in the form
$word. Allowed sequences are:
$file The full path name of the file to be rotated
$dirname
The directory of the file to be rotated
$basename
The log file name, without the directory name
$n The version number, 0 is most recent, 1 is next
most recent, and so forth
$N The same as $n, but starts at 1 instead of zero
$secs The number of seconds since 00:00:00 UTC, Janu-
ary 1,1970
$nodename
Expands to the output of uname -n
$platform
Expands to the output of uname -i
$isa Expands to the output of uname -p
$release
Expands to the output of uname -r
$machine
Expands to the output of uname -m
$domain
Expands to the output of domainname
SunOS 5.9 Last change: 6 Dec 2001 6
System Administration Commands logadm(1M)
To actually have the dollar sign character in the file name,
use $$. Any percent sequences allowed by strftime(3C) are
also allowed, for example, %d expands to the day of the
month. To actually have a percent sign character in the file
name, use %%. Both dollar-sign keywords and percent
sequences can appear anywhere in the template. If the tem-
plate results in a pathname with non-existent directories,
they are created as necessary when rotating the log file.
If no -t option is specified, the default template is
$file.$n. Actual rotation of log files, where each
version is shifted up until it expires is done using
the $n keyword. If the template does not contain the
$n keyword, the log file is simply renamed to the new
name and then the expire rules, if any, are applied.
-T pattern
Normally logadm looks for a list of old log files by
turning the template (specified with the -t option)
into a pattern and finding existing files whose names
match that pattern. The -T option causes the given
pattern to be used instead.
This option is useful if another program fiddles with
the old log file names, like a cron job to compress
them over time. The pattern is in the form of a path-
name with special characters such as * and ? as sup-
ported by csh(1) filename substitution.
-v Print information about the actions being executed in
verbose mode.
-V Validate the configuration file.
This option validates that an entry for the specified
logname exists in the /etc/logadm.conf file and is
syntactically correct. If logname is not specified,
all entries in the configuration file are validated.
If a logname argument is specified, the command vali-
dates the syntax of that entry. If the entry is found,
it is printed and the exit value of the command is
true. Otherwise the exit value is false.
-w entryname
Write an entry into the config file (that is,
/etc/logadm.conf) which corresponds to the current
command line arguments. If an entry already existed
for the specified entryname, it is removed first. This
is the preferred method for updating /etc/logadm.conf
since using it prevents syntax errors in that file.
The entryname is the name of the entry in
/etc/logadm.conf, and that name can be used as the
SunOS 5.9 Last change: 6 Dec 2001 7
System Administration Commands logadm(1M)
"logname" argument to future calls to logadm to take
advantage of that entry. The entryname can be chosen
to be something that is easy to specify, or it can be
the actual log file name. If no log file name is pro-
vided on the command line, the entry name is assumed
to be the same as the log file name. For example, the
following two lines achieve the same thing, keeping
two copies of rotated log files, but the first example
names the entry something easier to enter on the com-
mand line:
example% logadm -C2 -w mylog /my/really/long/log/file/name
example% logadm -C2 -w /my/really/long/log/file/name
-z count
Compress old log files as they are created. count of
the most recent log files are left uncompressed,
therefore making the count most recent files easier to
peruse. Use count of zero to compress all old logs.
The compression is done with gzip(1) and the resulting
log file has the suffix of .gz.
OPERANDS
The following operands are supported:
logname
Identifies the name of the entry in /etc/logadm.conf.
If the log file name is specified in the logname
field, it is assumed that logname is the same as the
actual log file name.
EXAMPLES
Example 1: Rotating a File and Keeping Previous Versions
The following example rotates the /var/adm/exacct/proc file,
keeping ten previous versions in /var/adm/exacct/proc.0
through /var/adm/exacct/proc.9.
Tell logadm to copy the file and truncate it.
example% logadm -c /var/adm/exacct/proc
Example 2: Rotating syslog
The following example rotates syslog and keeps eight log
files. Old log files are put in the directory /var/oldlogs
instead of /var/log:
example% logadm -C8 -t'/var/oldlogs/syslog.$n' /var/log/syslog
SunOS 5.9 Last change: 6 Dec 2001 8
System Administration Commands logadm(1M)
Example 3: Rotating /var/adm/sulog and Expiring Based on Age
The following entry in the /etc/logadm.conf file rotates the
/var/adm/sulog file and expires any copies older than 30
days.
/var/adm/sulog -A 30d
Example 4: Rotating Files and Expiring Based on Disk Usage
The following entry in the /etc/logadm.conf file rotates the
/var/adm/sulog file and expires old log files when more than
100 megabytes are used by the sum of all the rotated log
files.
/var/adm/sulog -S 100m
Example 5: Creating an Entry that Stores the Logfile Name
This example creates an entry storing the log file name and
the fact that we want to keep 20 copies in /etc/logadm.conf,
but the -p never means the entry is ignored by the normal
logadm run from root's crontab every morning.
example% logadm -w locallog /usr/local/logfile -C20 -p never
Use the following entry on the command line to override the
-p never option:
example% logadm -p now locallog
Example 6: Rotating the apache Error and Access Logs
The following example rotates the apache error and access
logs monthly to filenames based on current year and month.
It keeps the 24 most recent copies and tells apache to res-
tart after renaming the logs.
This command is run once, and since the -w option is speci-
fied, an entry is made in /etc/logadm.conf so the apache
logs are rotated from now on.
example% logadm -w apache -p 1m -C 24\
-t '/var/apache/old-logs/$basename.%Y-%m'\
-a '/usr/apache/bin/apachectl graceful'\
'/var/apache/logs/*{access,error}_log'
This example also illustrates that the entry name supplied
with the -w option doesn't have to match the log file name.
In this example, the entry name is apache and once the line
SunOS 5.9 Last change: 6 Dec 2001 9
System Administration Commands logadm(1M)
has been run, the entry in /etc/logadm.conf can be forced to
run by executing the following command:
example% logadm -p now apache
Because the expression matching the apache log file names
was enclosed in quotes, the expression is stored in
/etc/logadm.conf, rather than the list of files that it
expands to. This means that each time logadm runs from cron
it expands that expression and checks all the log files in
the resulting list to see if they need rotating.
The following command is an example without the quotes
around the log name expression. The shell expands the last
argument into a list of log files that exist at the time the
command is entered, and writes an entry to /etc/logadm.conf
that rotates the files.
example% logadm -w apache /var/apache/logs/*_log
FILES
/etc/logadm.conf
configuration file for logadm command
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | SUNWcsu |
|_____________________________|_____________________________|
SEE ALSO
chgrp(1), chmod(1), chown(1), csh(1), gzip(1), cron(1M),
ctime(3C), strftime(3C), logadm.conf(4), attributes(5)
NOTES
When logadm applies expire conditions (supplied by the -A,
-C, and -S options), it deletes files, the oldest first,
until the conditions are satisfied. If the template used for
naming the old logs contained $n or $N, logadm picks the
highest value of $n or $N found in the old log file names
first. If the template used is something else, logadm uses
the modification time to determine which files to expire
first. This may not be the expected behavior if an old log
file has been modified since it was rotated.
SunOS 5.9 Last change: 6 Dec 2001 10
root@blade1000:/:
indou@blade1000:~: su -
Password:
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
# bash
root@blade1000:/: crontab -l
#ident "@(#)root 1.20 01/11/06 SMI"
#
# The root crontab should be used to perform accounting data collection.
#
# The rtc command is run to adjust the real time clock if and when
# daylight savings time changes.
#
10 3 * * * /usr/sbin/logadm
15 3 * * 0 /usr/lib/fs/nfs/nfsfind
1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1
30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
#10 3 * * * /usr/lib/krb5/kprop_script ___slave_kdcs___
root@blade1000:/: cat /etc/logadm.conf
# Copyright 2001-2002 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#ident "@(#)logadm.conf 1.2 02/02/13 SMI"
#
# logadm.conf
#
# Default settings for system log file management.
# The -w option to logadm(1M) is the preferred way to write to this file,
# but if you do edit it by hand, use "logadm -V" to check it for errors.
#
# The format of lines in this file is:
#
# For each logname listed here, the default options to logadm
# are given. Options given on the logadm command line override
# the defaults contained in this file.
#
# logadm typically runs early every morning via an entry in
# root's crontab (see crontab(1)).
#
/var/log/syslog -C 8 -P 'Fri Jun 1 18:14:01 2007' -a 'kill -HUP `cat /var/run/syslog.pid`'
/var/adm/messages -C 4 -P 'Fri Jun 1 18:14:01 2007' -a 'kill -HUP `cat /var/run/syslog.pid`'
/var/cron/log -c -s 512k -t /var/cron/olog
/var/lp/logs/lpsched -C 2 -N -t '$file.$N'
#
# The entry below is used by turnacct(1M)
#
/var/adm/pacct -C 0 -N -a '/usr/lib/acct/accton pacct' -g adm -m 664 -o adm -p never
root@blade1000:/:
root@blade1000:/: uname -a
SunOS blade1000 5.9 Generic_122300-07 sun4u sparc SUNW,Sun-Blade-1000
root@blade1000:/:
root@blade1000:/: man logadm
マニュアルを清書中です。しばらくお待ちください... 終了
System Administration Commands logadm(1M)
NAME
logadm - manage endlessly growing log files
SYNOPSIS
logadm
logadm [-options] logname...
DESCRIPTION
logadm is a general log rotation tool that is suitable for
running from cron(1M).
Without arguments, logadm reads the /etc/logadm.conf file,
and for every entry found in that file checks the
corresponding log file to see if it should be rotated. Typi-
cally this check is done each morning by an entry in the
root's crontab.
If the logname argument is specified, logadm renames the
corresponding log file by adding a suffix so that the most
recent log file ends with .0 (that is, logfile.0), the next
most recent ends with .1 (that is, logfile.1), and so forth.
By default, ten versions of old log files are kept (that is,
logfile.0 through logfile.9) and logadm automatically
deletes the oldest version when appropriate to keep the
count of files at ten.
logadm takes a number of options. You can specify these
options on the command line or in the /etc/logadm.conffile .
The logadm command searches /etc/logadm.conf for lines of
the form logname options
logname
Identifies the name of the entry in /etc/logadm.conf,
but if no log file name is given in that entry it is
assumed that the logname is the same as the actual log
file name.
options
Identifies command line options exactly as they would
be entered on the command line. This allows commonly
used log rotation policies to be stored in the
/etc/logadm.conf file. See EXAMPLES.
If options are specified both in /etc/logadm.conf and
on the command line, those in the /etc/logadm.conf
file are applied first. Therefore, the command line
options override those in /etc/logadm.conf.
Log file names specified in /etc/logadm.conf may con-
tain filename substitution characters such as * and ?
that are supported by csh(1).
SunOS 5.9 Last change: 6 Dec 2001 1
System Administration Commands logadm(1M)
Two options control when a log file is rotated. They are: -s
size -p period.
When using more than one of these options at a time, there
is an implied and between them. This means that all condi-
tions must be met before the log is rotated.
If neither of these two options are specified, the default
conditions for rotating a log file are: -s 1b -p 1w, which
means the log file is only rotated if the size is non-zero
and if at least 1 week has passed since the last time it was
rotated.
By specifying -p never as a rotation condition, any other
rotation conditions are ignored and logadm moves on to the
expiration of old log files. By specifying -p now as a rota-
tion condition, a log rotation is forced.
Unless specified by the -o, -g, or -m options, logadm
replaces the log file (after renaming it) by creating an
empty file whose owner, group ID, and permissions match the
original file.
Three options control when old log files are expired: -A age
-C count -S size. These options expire the oldest log files
until a particular condition or conditions are met. For
example, the combination -C 5 and the -S 10m options expires
old log files until there are no more than 5 of the and
their combined disk usage is no more than 10 megabytes. If
none of these options are specified, the default expiration
is -C 10 which keeps ten old log files. If no files are to
be expired, use -C 0 to prevent expiration by default.
OPTIONS
The following options are supported:
-a post_command
Execute the post_command after renaming the log file.
post_command is passed to sh -c.
Specify post_command as a valid shell command. Use
quotes to protect spaces or shell metacharacters in
post_command.
This option can be used to restart a daemon that is
writing to the file. When rotating multiple logs with
one logadm command, post_command is executed only once
after all the logs are rotated, not once per rotated
log.
-A age
Delete any versions that have not been modified for
SunOS 5.9 Last change: 6 Dec 2001 2
System Administration Commands logadm(1M)
the amount of time specified by age.
Specify age as a number followed by an h (hours), d
(days), w(weeks), m (months), or y (years).
-b pre_command
Execute pre_command before renaming the log file.
pre_command is passed to sh -c.
Specify pre_command as a valid shell command. Use
quotes to protect spaces or shell metacharacters in
the pre_command.
This option can be used to stop a daemon that is writ-
ing to the file. When rotating multiple logs with one
logadm command, pre_command is executed only once
before all the logs are rotated, not once per rotated
log.
-c Rotate the log file by copying it and truncating the
original logfile to zero length, rather than renaming
the file.
-C count
Delete the oldest versions until there are not more
than count files left.
If no expire options (-A, -C, or -S) are specified, -C
10 is the default. To prevent the default expire rule
from being added automatically, specify -C 0 .
-e mail_addr
Send error messages by email to mail_addr.
As logadm is typically run from cron(1M), error mes-
sages are captured by cron and mailed to the owner of
the crontab.
This option is useful you want the mail regarding
error messages to go to another address instead. If no
errors are encountered, no mail message is generated.
-E cmd
Execute cmd to expire the file, rather than deleting
the old log file to expire it.
cmd is passed it to sh -c. The file is considered
expired after cmd completes. If the old log file is
not removed or renamed by the cmd, logadm considers it
for expiration the next time that it runs on the
specified log file. If present, the keyword $file is
expanded in the specified cmd to the name of the file
SunOS 5.9 Last change: 6 Dec 2001 3
System Administration Commands logadm(1M)
being expired.
This option is useful for tasks such as mailing old
log files to administrators, or copying old log files
to long term storage.
-f conf_file
Use conf_file instead of /etc/logadm.conf.
This option allows non-root users to keep their own
logadm configuration files.
-g group
Create a new empty file with the ID specified by
group, instead of preserving the group ID of the log
file.
Specify group by name or by numeric group ID, as
accepted by chgrp(1).
This option requires the ability to change file group
ownership using the chgrp(1) command.
-h Print a help message that describes logadm's options.
-m mode
Create a new empty file with the mode specified by
mode, instead of preserving the mode of the log file.
Specify mode in any form that is accepted by the
chmod(1) command.
-n Print the actions that the logadm command will perform
without actually performing them.
This option is useful for checking arguments before
making any changes to the system.
It is important to remember, however, that since log
rotating actions are only printed with this option,
logadm might not find files that need expiring, but if
run without the -n logadm might create a file that
needs expiring by performing the log rotating actions.
Therefore, if you see no files being expired with the
-n option, files still might be expired without it.
-N Prevent an error message if the specified logfile does
not exist. Normally, logadm produces an error message
if the log file is not found. With -N, if the log file
doesn't exist logadm moves on to the expire rules (if
any) and then to the next log file (if any), without
SunOS 5.9 Last change: 6 Dec 2001 4
System Administration Commands logadm(1M)
creating the empty replacement log file.
-o owner
Create the new empty file with owner, instead of
preserving the owner of the log file.
Specify owner in any form that is accepted by the
chown(1) command.
-p period
Rotate a log file after the specified time period
(period) .
Specify period as a number followed by d for days, w
for weeks, m for months (really 30 days) or y for
years. There are also two special values for period:
now and never. -p now forces log rotation. -p never
forces no log rotation.
-P timestamp
Used by logadm to record the last time the log was
rotated in /etc/logadm.conf.
This option uses timestamp to determine if the log
rotation period has passed. The format of timestamp
matches the format generated by ctime(3C), with quotes
around it to protect embedded spaces.
-r Remove any entries corresponding to the specified log-
name from the /etc/logadm.conf.
-R cmd
Run the cmd when an old log file is created by a log
rotation. If the keyword $file is embedded in the
specified command, it is expanded to the name of the
old log file just created by log rotation.
This option is useful for processing log file contents
after rotating the log. cmd is executed by passing it
to sh -c. When rotating multiple logs with one logadm
command, the command supplied with -R is executed once
every time a log is rotated. This is useful for post-
processing a log file (that is, sorting it, removing
uninteresting lines, etc.). The -a option is a better
choice for restarting daemons after log rotation.
-s size
Rotate the log file only if its size is greater than
or equal to size.
Specify size as a number followed by the letter b for
bytes, k for kilobytes, m for megabytes, or g for
SunOS 5.9 Last change: 6 Dec 2001 5
System Administration Commands logadm(1M)
gigabytes.
-S size
Delete the oldest versions until the total disk space
used by the old log files is less than the specified
size.
Specify size as a number followed by the letter b for
bytes, k for kilobytes, m for megabytes, or g for
gigabytes.
-t template
Specify the template to use when renaming log files.
template can be a simple name, such as
/var/adm/oldfile, or it can contain special keywords
which are expanded by logadm and are in the form
$word. Allowed sequences are:
$file The full path name of the file to be rotated
$dirname
The directory of the file to be rotated
$basename
The log file name, without the directory name
$n The version number, 0 is most recent, 1 is next
most recent, and so forth
$N The same as $n, but starts at 1 instead of zero
$secs The number of seconds since 00:00:00 UTC, Janu-
ary 1,1970
$nodename
Expands to the output of uname -n
$platform
Expands to the output of uname -i
$isa Expands to the output of uname -p
$release
Expands to the output of uname -r
$machine
Expands to the output of uname -m
$domain
Expands to the output of domainname
SunOS 5.9 Last change: 6 Dec 2001 6
System Administration Commands logadm(1M)
To actually have the dollar sign character in the file name,
use $$. Any percent sequences allowed by strftime(3C) are
also allowed, for example, %d expands to the day of the
month. To actually have a percent sign character in the file
name, use %%. Both dollar-sign keywords and percent
sequences can appear anywhere in the template. If the tem-
plate results in a pathname with non-existent directories,
they are created as necessary when rotating the log file.
If no -t option is specified, the default template is
$file.$n. Actual rotation of log files, where each
version is shifted up until it expires is done using
the $n keyword. If the template does not contain the
$n keyword, the log file is simply renamed to the new
name and then the expire rules, if any, are applied.
-T pattern
Normally logadm looks for a list of old log files by
turning the template (specified with the -t option)
into a pattern and finding existing files whose names
match that pattern. The -T option causes the given
pattern to be used instead.
This option is useful if another program fiddles with
the old log file names, like a cron job to compress
them over time. The pattern is in the form of a path-
name with special characters such as * and ? as sup-
ported by csh(1) filename substitution.
-v Print information about the actions being executed in
verbose mode.
-V Validate the configuration file.
This option validates that an entry for the specified
logname exists in the /etc/logadm.conf file and is
syntactically correct. If logname is not specified,
all entries in the configuration file are validated.
If a logname argument is specified, the command vali-
dates the syntax of that entry. If the entry is found,
it is printed and the exit value of the command is
true. Otherwise the exit value is false.
-w entryname
Write an entry into the config file (that is,
/etc/logadm.conf) which corresponds to the current
command line arguments. If an entry already existed
for the specified entryname, it is removed first. This
is the preferred method for updating /etc/logadm.conf
since using it prevents syntax errors in that file.
The entryname is the name of the entry in
/etc/logadm.conf, and that name can be used as the
SunOS 5.9 Last change: 6 Dec 2001 7
System Administration Commands logadm(1M)
"logname" argument to future calls to logadm to take
advantage of that entry. The entryname can be chosen
to be something that is easy to specify, or it can be
the actual log file name. If no log file name is pro-
vided on the command line, the entry name is assumed
to be the same as the log file name. For example, the
following two lines achieve the same thing, keeping
two copies of rotated log files, but the first example
names the entry something easier to enter on the com-
mand line:
example% logadm -C2 -w mylog /my/really/long/log/file/name
example% logadm -C2 -w /my/really/long/log/file/name
-z count
Compress old log files as they are created. count of
the most recent log files are left uncompressed,
therefore making the count most recent files easier to
peruse. Use count of zero to compress all old logs.
The compression is done with gzip(1) and the resulting
log file has the suffix of .gz.
OPERANDS
The following operands are supported:
logname
Identifies the name of the entry in /etc/logadm.conf.
If the log file name is specified in the logname
field, it is assumed that logname is the same as the
actual log file name.
EXAMPLES
Example 1: Rotating a File and Keeping Previous Versions
The following example rotates the /var/adm/exacct/proc file,
keeping ten previous versions in /var/adm/exacct/proc.0
through /var/adm/exacct/proc.9.
Tell logadm to copy the file and truncate it.
example% logadm -c /var/adm/exacct/proc
Example 2: Rotating syslog
The following example rotates syslog and keeps eight log
files. Old log files are put in the directory /var/oldlogs
instead of /var/log:
example% logadm -C8 -t'/var/oldlogs/syslog.$n' /var/log/syslog
SunOS 5.9 Last change: 6 Dec 2001 8
System Administration Commands logadm(1M)
Example 3: Rotating /var/adm/sulog and Expiring Based on Age
The following entry in the /etc/logadm.conf file rotates the
/var/adm/sulog file and expires any copies older than 30
days.
/var/adm/sulog -A 30d
Example 4: Rotating Files and Expiring Based on Disk Usage
The following entry in the /etc/logadm.conf file rotates the
/var/adm/sulog file and expires old log files when more than
100 megabytes are used by the sum of all the rotated log
files.
/var/adm/sulog -S 100m
Example 5: Creating an Entry that Stores the Logfile Name
This example creates an entry storing the log file name and
the fact that we want to keep 20 copies in /etc/logadm.conf,
but the -p never means the entry is ignored by the normal
logadm run from root's crontab every morning.
example% logadm -w locallog /usr/local/logfile -C20 -p never
Use the following entry on the command line to override the
-p never option:
example% logadm -p now locallog
Example 6: Rotating the apache Error and Access Logs
The following example rotates the apache error and access
logs monthly to filenames based on current year and month.
It keeps the 24 most recent copies and tells apache to res-
tart after renaming the logs.
This command is run once, and since the -w option is speci-
fied, an entry is made in /etc/logadm.conf so the apache
logs are rotated from now on.
example% logadm -w apache -p 1m -C 24\
-t '/var/apache/old-logs/$basename.%Y-%m'\
-a '/usr/apache/bin/apachectl graceful'\
'/var/apache/logs/*{access,error}_log'
This example also illustrates that the entry name supplied
with the -w option doesn't have to match the log file name.
In this example, the entry name is apache and once the line
SunOS 5.9 Last change: 6 Dec 2001 9
System Administration Commands logadm(1M)
has been run, the entry in /etc/logadm.conf can be forced to
run by executing the following command:
example% logadm -p now apache
Because the expression matching the apache log file names
was enclosed in quotes, the expression is stored in
/etc/logadm.conf, rather than the list of files that it
expands to. This means that each time logadm runs from cron
it expands that expression and checks all the log files in
the resulting list to see if they need rotating.
The following command is an example without the quotes
around the log name expression. The shell expands the last
argument into a list of log files that exist at the time the
command is entered, and writes an entry to /etc/logadm.conf
that rotates the files.
example% logadm -w apache /var/apache/logs/*_log
FILES
/etc/logadm.conf
configuration file for logadm command
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | SUNWcsu |
|_____________________________|_____________________________|
SEE ALSO
chgrp(1), chmod(1), chown(1), csh(1), gzip(1), cron(1M),
ctime(3C), strftime(3C), logadm.conf(4), attributes(5)
NOTES
When logadm applies expire conditions (supplied by the -A,
-C, and -S options), it deletes files, the oldest first,
until the conditions are satisfied. If the template used for
naming the old logs contained $n or $N, logadm picks the
highest value of $n or $N found in the old log file names
first. If the template used is something else, logadm uses
the modification time to determine which files to expire
first. This may not be the expected behavior if an old log
file has been modified since it was rotated.
SunOS 5.9 Last change: 6 Dec 2001 10
root@blade1000:/:
Solaris 8のlog rotateは
bash-2.03# ls -l /usr/lib/newsyslog
-r-xr-xr-x 1 root sys 773 Jan 6 2000 /usr/lib/newsyslog
bash-2.03# crontab -l
#ident "@(#)root 1.19 98/07/06 SMI" /* SVr4.0 1.1.3.1 */
#
# The root crontab should be used to perform accounting data collection.
#
# The rtc command is run to adjust the real time clock if and when
# daylight savings time changes.
#
10 3 * * 0,4 /etc/cron.d/logchecker
10 3 * * 0 /usr/lib/newsyslog
15 3 * * 0 /usr/lib/fs/nfs/nfsfind
1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1
30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
bash-2.03#
日曜日の、3時10分に/usr/lib/newsyslogは動作する。
bash-2.03# man newsyslog
No manual entry for newsyslog.
bash-2.03# uname -a
SunOS Ultra60 5.8 Generic_108528-11 sun4u sparc SUNW,Ultra-60
bash-2.03#
bash-2.03# cat /usr/lib/newsyslog
#! /bin/sh
#
# Copyright(c) 1997, by Sun Microsystems, Inc.
# All rights reserved.
#
#ident @Z%newsyslog 1.3 97/03/31 SMI
#
LOG=messages
cd /var/adm
test -f $LOG.2 && mv $LOG.2 $LOG.3
test -f $LOG.1 && mv $LOG.1 $LOG.2
test -f $LOG.0 && mv $LOG.0 $LOG.1
mv $LOG $LOG.0
cp /dev/null $LOG
chmod 644 $LOG
#
LOGDIR=/var/log
LOG=syslog
if test -d $LOGDIR
then
cd $LOGDIR
if test -s $LOG
then
test -f $LOG.6 && mv $LOG.6 $LOG.7
test -f $LOG.5 && mv $LOG.5 $LOG.6
test -f $LOG.4 && mv $LOG.4 $LOG.5
test -f $LOG.3 && mv $LOG.3 $LOG.4
test -f $LOG.2 && mv $LOG.2 $LOG.3
test -f $LOG.1 && mv $LOG.1 $LOG.2
test -f $LOG.0 && mv $LOG.0 $LOG.1
mv $LOG $LOG.0
cp /dev/null $LOG
chmod 644 $LOG
sleep 40
fi
fi
#
kill -HUP `cat /etc/syslog.pid`
bash-2.03#
-r-xr-xr-x 1 root sys 773 Jan 6 2000 /usr/lib/newsyslog
bash-2.03# crontab -l
#ident "@(#)root 1.19 98/07/06 SMI" /* SVr4.0 1.1.3.1 */
#
# The root crontab should be used to perform accounting data collection.
#
# The rtc command is run to adjust the real time clock if and when
# daylight savings time changes.
#
10 3 * * 0,4 /etc/cron.d/logchecker
10 3 * * 0 /usr/lib/newsyslog
15 3 * * 0 /usr/lib/fs/nfs/nfsfind
1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1
30 3 * * * [ -x /usr/lib/gss/gsscred_clean ] && /usr/lib/gss/gsscred_clean
bash-2.03#
日曜日の、3時10分に/usr/lib/newsyslogは動作する。
bash-2.03# man newsyslog
No manual entry for newsyslog.
bash-2.03# uname -a
SunOS Ultra60 5.8 Generic_108528-11 sun4u sparc SUNW,Ultra-60
bash-2.03#
bash-2.03# cat /usr/lib/newsyslog
#! /bin/sh
#
# Copyright(c) 1997, by Sun Microsystems, Inc.
# All rights reserved.
#
#ident @Z%newsyslog 1.3 97/03/31 SMI
#
LOG=messages
cd /var/adm
test -f $LOG.2 && mv $LOG.2 $LOG.3
test -f $LOG.1 && mv $LOG.1 $LOG.2
test -f $LOG.0 && mv $LOG.0 $LOG.1
mv $LOG $LOG.0
cp /dev/null $LOG
chmod 644 $LOG
#
LOGDIR=/var/log
LOG=syslog
if test -d $LOGDIR
then
cd $LOGDIR
if test -s $LOG
then
test -f $LOG.6 && mv $LOG.6 $LOG.7
test -f $LOG.5 && mv $LOG.5 $LOG.6
test -f $LOG.4 && mv $LOG.4 $LOG.5
test -f $LOG.3 && mv $LOG.3 $LOG.4
test -f $LOG.2 && mv $LOG.2 $LOG.3
test -f $LOG.1 && mv $LOG.1 $LOG.2
test -f $LOG.0 && mv $LOG.0 $LOG.1
mv $LOG $LOG.0
cp /dev/null $LOG
chmod 644 $LOG
sleep 40
fi
fi
#
kill -HUP `cat /etc/syslog.pid`
bash-2.03#
2007年6月4日月曜日
Windows XP SP2で、Xサーバエミュレータがつながらない
REFERENCE:http://www.hitachi.co.jp/Prod/comp/soft1/xserv/faq/inst.html#Q6
・Windowsファイアウォール
製品の性質上,Windowsファイアウォールの既定値である,ネットワーク保護機能によるフィルタリングがON(有効)となっている状態ですと,Xサーバエミュレータのプログラムを,フィルタリング対象から除外するための例外リストに登録する必要があります。
(注)<インストールフォルダ>には本製品をインストールしているフォルダを指定してください。 デフォルトでは C:\XSVW となります。
Windowsファイアーウォールの[プログラムおよびサービスの一覧]に上記登録内容が表示され,チェックがオンになっていれば登録は完了しております。
登録情報を削除する場合は,[プログラムおよびサービスの一覧]に表示されている,上記登録の情報を選択し, [削除]を選択してリストから削除してください。
一時的に登録情報を無効化したい場合は,チェックをオフにしてください。
・データ実行防止機能(ハードウェアDEP機能)
Xサーバエミュレータのプログラムを,データ実行防止機能(ハードウェアDEP機能)の例外リストに登録する必要があります。
<例外リストの登録作業>
本製品をインストールしたあと,以下の手順に従って,例外リストの 登録作業を行ってください。
1.[コントロールパネル]-[システム]プロパティを開く。
2.[詳細設定]タブの[パフォーマンス]-「設定(S)」ボタンをクリックし,[パフォーマンスオプション]-[データ実行防止]タブを選択。
3.[追加(D)]ボタンをクリックし,XSVW32.EXEを選択・追加する。
例:<インストールフォルダ>\XSVW32.EXE
(注)<インストールフォルダ>は本製品をインストールしているフォルダを指します。 デフォルトでは C:\XSVW となります。
[パフォーマンスオプション]-[データ実行防止]タブの例外リストに上記登録内容が表示され,チェックがオンになっていれば登録は完了です。
C:\Documents and Settings\indou.YCC804>netsh firewall add allowedprogram program=C:\XSVW\XSVW32.EXE
name="Xサーバエミュレータ" mode=ENABLE
OK
C:\Documents and Settings\indou.YCC804>netsh firewall add allowedprogram program=C:\XSVW\XSVFTP.EXE
name="Xサーバエミュレータ" mode=ENABLE
OK
C:\Documents and Settings\indou.YCC804>
・Windowsファイアウォール
製品の性質上,Windowsファイアウォールの既定値である,ネットワーク保護機能によるフィルタリングがON(有効)となっている状態ですと,Xサーバエミュレータのプログラムを,フィルタリング対象から除外するための例外リストに登録する必要があります。
(注)<インストールフォルダ>には本製品をインストールしているフォルダを指定してください。 デフォルトでは C:\XSVW となります。
Windowsファイアーウォールの[プログラムおよびサービスの一覧]に上記登録内容が表示され,チェックがオンになっていれば登録は完了しております。
登録情報を削除する場合は,[プログラムおよびサービスの一覧]に表示されている,上記登録の情報を選択し, [削除]を選択してリストから削除してください。
一時的に登録情報を無効化したい場合は,チェックをオフにしてください。
・データ実行防止機能(ハードウェアDEP機能)
Xサーバエミュレータのプログラムを,データ実行防止機能(ハードウェアDEP機能)の例外リストに登録する必要があります。
<例外リストの登録作業>
本製品をインストールしたあと,以下の手順に従って,例外リストの 登録作業を行ってください。
1.[コントロールパネル]-[システム]プロパティを開く。
2.[詳細設定]タブの[パフォーマンス]-「設定(S)」ボタンをクリックし,[パフォーマンスオプション]-[データ実行防止]タブを選択。
3.[追加(D)]ボタンをクリックし,XSVW32.EXEを選択・追加する。
例:<インストールフォルダ>\XSVW32.EXE
(注)<インストールフォルダ>は本製品をインストールしているフォルダを指します。 デフォルトでは C:\XSVW となります。
[パフォーマンスオプション]-[データ実行防止]タブの例外リストに上記登録内容が表示され,チェックがオンになっていれば登録は完了です。
C:\Documents and Settings\indou.YCC804>netsh firewall add allowedprogram program=C:\XSVW\XSVW32.EXE
name="Xサーバエミュレータ" mode=ENABLE
OK
C:\Documents and Settings\indou.YCC804>netsh firewall add allowedprogram program=C:\XSVW\XSVFTP.EXE
name="Xサーバエミュレータ" mode=ENABLE
OK
C:\Documents and Settings\indou.YCC804>
Solaris 9で、Caps LockとControlキーを交換する。
~/.xmodmaprc
remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L
~/.dtprofile
# swap ctrl and caps lock key
if [ -f $HOME/.xmodmaprc ] ; then
/usr/openwin/bin/xmodmap $HOME/.xmodmaprc
fi
remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L
~/.dtprofile
# swap ctrl and caps lock key
if [ -f $HOME/.xmodmaprc ] ; then
/usr/openwin/bin/xmodmap $HOME/.xmodmaprc
fi
Solarisの最新版
仕事で、Soalris 10ではなく、Solaris 9を使用することになりました。
最新版を、http://www.sun.com/software/solaris/9/ より取得。
最新版って、自由にダウンロードしていいのかな。
ちなみに、Solaris8の最新版は、http://www.sun.com/software/solaris/8/
最新版を、http://www.sun.com/software/solaris/9/ より取得。
最新版って、自由にダウンロードしていいのかな。
ちなみに、Solaris8の最新版は、http://www.sun.com/software/solaris/8/
登録:
投稿 (Atom)