1. 由时间引起的:
编译安装Sys-Statistics-Linux
-
perl Makefile.PL
-
make
-
make install
每次make 都会报错,我一直在考虑各种包的依赖关系,终于让发现了不少包需要装。
-
yum install perl-Time-HiRes
-
yum install perl-ExtUtils-CBuilder perl-ExtUtils-MakeMaker
-
yum install perl-Test-Simple perl-Test-Harness perl-Test-Pod-Coverage perl-Test-Pod
但是其实真正的问题出在哪里呢?时间是错误的,更新完时间后, Sys-Statistics-Linux安装成功,nrpe也安装成功了。
-
date
-
Mon Jan 5 19:38:08 EST 1970
-
ntpdate 192.168.*.* //ntpdate update time
2. 链接:
用一个账户kobe建立一个1.txt,然后用root来分别对这个文件做软链接和硬链接。
A.可以看到硬链接保持了文件oid和gid, 而我用root 建立的软连接 3.txt 则uid和gid 都是root.
-
4 -rw-rw-r--. 2 kobe kobe 14 Oct 23 09:30 1.txt
-
4 -rw-rw-r--. 2 kobe kobe 14 Oct 23 09:30 2.txt
-
0 lrwxrwxrwx. 1 root root 5 Oct 23 09:33 3.txt -> 1.txt
B. 可以看到硬链接和原始文件的Inode是相同的,而软连接则不是。
-
[root@c653f1u25 tmp]# stat 1.txt
-
File: ‘1.txt’
-
Size: 14 Blocks: 8 IO Block: 4096 regular file
-
Device: fd00h/64768d Inode: 5846 Links: 2
-
Access: (0664/-rw-rw-r--) Uid: ( 1000/ kobe) Gid: ( 1000/ kobe)
-
Context: unconfined_u:object_r:user_tmp_t:s0
-
Access: 2015-10-23 09:32:04.204412959 -0400
-
Modify: 2015-10-23 09:30:17.986761312 -0400
-
Change: 2015-10-23 09:31:55.253358045 -0400
-
Birth: -
-
[root@c653f1u25 tmp]# stat 2.txt
-
File: ‘2.txt’
-
Size: 14 Blocks: 8 IO Block: 4096 regular file
-
Device: fd00h/64768d Inode: 5846 Links: 2
-
Access: (0664/-rw-rw-r--) Uid: ( 1000/ kobe) Gid: ( 1000/ kobe)
-
Context: unconfined_u:object_r:user_tmp_t:s0
-
Access: 2015-10-23 09:32:04.204412959 -0400
-
Modify: 2015-10-23 09:30:17.986761312 -0400
-
Change: 2015-10-23 09:31:55.253358045 -0400
-
Birth: -
-
[root@c653f1u25 tmp]# stat 3.txt
-
File: ‘3.txt’ -> ‘1.txt’
-
Size: 5 Blocks: 0 IO Block: 4096 symbolic link
-
Device: fd00h/64768d Inode: 5848 Links: 1
-
Access: (0777/lrwxrwxrwx) Uid: ( 0/ root) Gid: ( 0/ root)
-
Context: unconfined_u:object_r:user_tmp_t:s0
-
Access: 2015-10-26 02:35:49.017516496 -0400
-
Modify: 2015-10-23 09:33:25.094909175 -0400
-
Change: 2015-10-23 09:33:25.094909175 -0400
-
Birth: -
估计这些信息都是来自于这个结构体:
-
struct stat {
-
dev_t st_dev; /* ID of device containing file */
-
ino_t st_ino; /* inode number */
-
mode_t st_mode; /* protection */
-
nlink_t st_nlink; /* number of hard links */
-
uid_t st_uid; /* user ID of owner */
-
gid_t st_gid; /* group ID of owner */
-
dev_t st_rdev; /* device ID (if special file) */
-
off_t st_size; /* total size, in bytes */
-
blksize_t st_blksize; /* blocksize for file system I/O */
-
blkcnt_t st_blocks; /* number of 512B blocks allocated */
-
time_t st_atime; /* time of last access */
-
time_t st_mtime; /* time of last modification */
-
time_t st_ctime; /* time of last status change */
-
}
阅读(1268) | 评论(0) | 转发(0) |