Project

General

Profile

Actions

Bug #3930

closed

'tail -F ...' not resetting the offset of file rotation properly

Added by Robert Mustacchi almost 9 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Category:
cmd - userland programs
Start date:
2013-07-28
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

The following is from the Joyent bug report.

90307 /usr/bin/tail -1cF /var/svc/log/smartdc-site-vmapi:default.log
      90308 /usr/bin/tail -1cF /var/svc/log/smartdc-site-vmapi:default.log
      90309 /usr/bin/tail -1cF /var/svc/log/smartdc-site-vmapi:default.log
      90310 /usr/bin/tail -1cF /var/svc/log/smartdc-site-vmapi:default.log

[root@f437f858-26ef-48db-a0b9-00cd59957e11 (us-west-1:vmapi0) /var/svc/log]# truss -t read,write,open,close -p 90307
read(3, 0x08065BFC, 131072)                     = 0
read(3, 0x08065BFC, 131072)                     = 0
read(3, 0x08065BFC, 131072)                     = 0
read(3, 0x08065BFC, 131072)                     = 0
read(3, 0x08065BFC, 131072)                     = 0
read(3, 0x08065BFC, 131072)                     = 0
read(3, 0x08065BFC, 131072)                     = 0
read(3, 0x08065BFC, 131072)                     = 0
read(3, 0x08065BFC, 131072)                     = 0
read(3, 0x08065BFC, 131072)                     = 0
read(3, 0x08065BFC, 131072)                     = 0
read(3, 0x08065BFC, 131072)                     = 0
read(3, 0x08065BFC, 131072)                     = 0
read(3, 0x08065BFC, 131072)                     = 0
read(3, 0x08065BFC, 131072)                     = 0
10:33
[root@f437f858-26ef-48db-a0b9-00cd59957e11 (us-west-1:vmapi0) /var/svc/log]# pfiles 90307
90307:  /usr/bin/tail -1cF /var/svc/log/smartdc-site-vmapi:default.log
  Current rlimit: 65536 file descriptors
   0: S_IFSOCK mode:0666 dev:540,0 ino:25813 uid:0 gid:0 rdev:0,0
      O_RDWR
        SOCK_STREAM
        SO_SNDBUF(16384),SO_RCVBUF(5120)
        sockname: AF_UNIX
        peer: node[89377] zone: f437f858-26ef-48db-a0b9-00cd59957e11[37]
   1: S_IFSOCK mode:0666 dev:540,0 ino:51333 uid:0 gid:0 rdev:0,0
      O_RDWR
        SOCK_STREAM
        SO_SNDBUF(16384),SO_RCVBUF(5120)
        sockname: AF_UNIX
        peer: node[89377] zone: f437f858-26ef-48db-a0b9-00cd59957e11[37]
   2: S_IFSOCK mode:0666 dev:540,0 ino:24694 uid:0 gid:0 rdev:0,0
      O_RDWR
        SOCK_STREAM
        SO_SNDBUF(16384),SO_RCVBUF(5120)
        sockname: AF_UNIX
        peer: node[89377] zone: f437f858-26ef-48db-a0b9-00cd59957e11[37]
   3: S_IFREG mode:0644 dev:90,65693 ino:33213 uid:0 gid:0 size:1001437016
      O_RDONLY|O_LARGEFILE
      /var/svc/log/smartdc-site-vmapi:default.log
      offset:31794594609
   4: S_IFPORT mode:0000 dev:543,0 uid:0 gid:10 size:0

That offset matches the size of the rotated file.

-rw-r--r-- 1 root root  1001668693 Jun  5 17:34 smartdc-site-vmapi:default.log
-rw-r--r-- 1 root root 31794594609 Jun  5 03:28 smartdc-site-vmapi:default.log.0

Actions

Also available in: Atom PDF