1. Process Accounting
Process accounting is performed by the system kernel. Upon termination of a process, one record per process is written to a file (normally /var/adm/pacct). The accounting information is initiated when creating one new process using fork(2). exec(2) will not create accounting information, even though it will change the program name in accounting structure.
- accton(1M): specify on/off the accounting file which will be written process accounting information.
- acctcom(1): search and print process accounting files. It reports only on processes that have terminated; use ps(1) for active processes.
2. User Accounting
- /var/adm/utmpx: this database file contains user access and accounting information for commands such as who(1), write(1) and login(1). It contains current user and accounting information.
- /var/adm/wtmpx: this database contains the history of user access and accounting information for the utmpx database. last(1) command use this file to report user login/logout activity. (last reboot can give a record of when the OS was shutdown and when it rebooted.
3.Extended accounting
Extended accounting perform accounting not only on process but also on task and flow(IPQos)
- acctadm: Run acctadm with no arguments will display the current accounting status.
- acctadm -r: display available resource groups.
- -d resource_list/-D/-e resouce list/-E/-x: disable/enable accounting.
- lastcomm(1) displays the last commands executed, in reverse order. If extended process accounting is active and is recording the appropriate data items, lastcomm attempts to take data from the current extended process accounting file(normally /var/adm/exacct/proc). If standard process accounting is active, last comm takes data from the current standard accounting file (normally /var/adm/pacct).
由于 Solaris 默认不安装 vim 而使用老古董级的 vi,因此如果想使用vim的强大功能,需要自己安装,有几个安装方式:
值得一提的是 Solaris 已经注意到了类似的问题,因此建立了一个称为 Indiana 的项目,该项目将使 Solaris 包含更多的开源软件,详细信息请参见
http://mail.opensolaris.org/pipermail/opensolaris-discuss/2007-May/028871.html 和
http://mail.opensolaris.org/pipermail/opensolaris-discuss/2007-May/028845.html下面介绍一下如何使用编译源代码方式来安装 vim。
0。安装 SunStudio 11 和 cbe 环境
1。安装 ncurses
由于 vim 需要使用 ncurses 来实现丰富多彩的字符颜色显示,因此首先需要安装 ncurses 库。
- 下载 ftp://ftp.keystealth.org/pub/gnu/gnu/ncurses/ncurses-5.6.tar.gz
- gzcat ncurses-5.6.tar.gz |tar -xvf -
- cd ncurses-5.6.tar.gz
- ./configure --prefix=$HOME; make ; make install
2。如果需要ruby编辑支持,需要安装ruby
参见 http://blogs.sun.com/yydzero/entry/%E5%9C%A8_solaris_express_%E4%B8%8A%E7%BC%96%E8%AF%91_ruby
3。安装 vim
- 下载 vim 源代码:http://www.vim.org/download.php#unix
- cd vim/src
- 如果你的 ncurses 库不是在标准的库路径 /usr/lib:/lib 那么需要export两个环境变量
- export LDFLAGS=-L/path/to/your/libncurses.so
- export LD_LIBRARY_PATH=/path/to/your/libncurses.so
- ./configure --prefix=$HOME --disable-gui --without-x --disable-acl --enable-perlinterp --enable-pythoninterp --enable-rubyinterp --enable-cscope --with-ncurses=$HOME
- make
- make install
4. 运行 vim
如果你的 ncurses 库不是在标准的库路径中,那么需要在运行vim之前 export LD_LIBRARY_PATH。 但是每次这样做是非常繁琐的,为了避免每次设定,可以在 $HOME/.bash_profile 中加入 alias vi='LD_LIBRARY_PATH=/path/to/your/ncurses.so /path/to/your/vim',这样每次运行vi时会自动export LD_LIBRARY_PATH. 使用 :version 查看版本信息。
As UTF-8 becomes the most popular encoding, many operating system
such as solaris, ubuntu are using UTF-8 as the default locale. Then how
to handle the large amount of legacy encoded
file(filename/filecontent)? There are several tools available, let's
have a look.
[
Read More]