I can't stop tail -f /path/to/file via CTRL+C or kill onOpenBSD/sparc64 4.2 - BSD

This is a discussion on I can't stop tail -f /path/to/file via CTRL+C or kill onOpenBSD/sparc64 4.2 - BSD ; Hi, I noticed, that on OpenBSD/sparc64 4.2, I can't stop tail -f /path/to/ file via CTRL+C or kill command. I have to use kill -9. In bash prompt, CTRL+C is working fine, so I hope, that is not about disabled ...

+ Reply to Thread
Results 1 to 11 of 11

Thread: I can't stop tail -f /path/to/file via CTRL+C or kill onOpenBSD/sparc64 4.2

  1. I can't stop tail -f /path/to/file via CTRL+C or kill onOpenBSD/sparc64 4.2

    Hi,

    I noticed, that on OpenBSD/sparc64 4.2, I can't stop tail -f /path/to/
    file via CTRL+C or kill command. I have to use kill -9. In bash
    prompt, CTRL+C is working fine, so I hope, that is not about disabled
    CTRL+C, but something with tail. I'm connected via ssh with
    TERM=xterm.

    Is tail this working fine on other architecture? What I shall check?

    Thank you,
    Jiri

  2. Re: I can't stop tail -f /path/to/file via CTRL+C or kill on OpenBSD/sparc64 4.2

    On 2007-12-06, plavcik@gmail.com wrote:
    > Hi,
    >
    > I noticed, that on OpenBSD/sparc64 4.2, I can't stop tail -f /path/to/
    > file via CTRL+C or kill command. I have to use kill -9. In bash
    > prompt, CTRL+C is working fine, so I hope, that is not about disabled
    > CTRL+C, but something with tail. I'm connected via ssh with
    > TERM=xterm.
    >
    > Is tail this working fine on other architecture? What I shall check?


    Well ... I've not installed bash, but in a recently installed
    OpenBSD 4.2 in an Ultra-5 (which is sparc64) I encounter no problems
    using CTRL-C to terminate "tail -f /var/log/messages" with tcsh as the
    active shell.

    Have you tried it with other shells? It may be an artifact of
    bash -- or of your configuration options in bash.

    Good Luck,
    DoN.

    --
    Email: | Voice (all times): (703) 938-4564
    (too) near Washington D.C. | http://www.d-and-d.com/dnichols/DoN.html
    --- Black Holes are where God is dividing by zero ---

  3. Re: I can't stop tail -f /path/to/file via CTRL+C or kill onOpenBSD/sparc64 4.2

    On 7 Pro, 00:48, "DoN. Nichols" wrote:
    > Well ... I've not installed bash, but in a recently installed
    > OpenBSD 4.2 in an Ultra-5 (which is sparc64) I encounter no problems
    > using CTRL-C to terminate "tail -f /var/log/messages" with tcsh as the
    > active shell.
    >
    > Have you tried it with other shells? It may be an artifact of
    > bash -- or of your configuration options in bash.
    >
    > Good Luck,
    > DoN.


    Thank you for quick reply. I replaced bash with ksh, but with same
    result, CTRL+C is working fine directly in shell, but not in tail (to
    exit tail). I have to use CTRL+Z and then kill -9 to stop tail

    But, I discovered, that if I run tail as root, it's working fine (I
    can stop tail with CTRL+C).

    So I dont know answers to these questions:
    - If CTRL+C is working fine in shell, shall the setting be fine also
    for tail? I, hope that yes.
    - Why tail can't be stoped with CTRL+C or kill command (without -9)
    running under user, but is working running under root?

    Thank you for any ideas,
    Jiri

  4. Re: I can't stop tail -f /path/to/file via CTRL+C or kill on OpenBSD/sparc64 4.2

    On Fri, 7 Dec 2007 00:45:15 -0800 (PST) in plavcik@gmail.com wrote:
    > On 7 Pro, 00:48, "DoN. Nichols" wrote:
    >> Well ... I've not installed bash, but in a recently installed
    >> OpenBSD 4.2 in an Ultra-5 (which is sparc64) I encounter no problems
    >> using CTRL-C to terminate "tail -f /var/log/messages" with tcsh as the
    >> active shell.
    >>
    >> Have you tried it with other shells? It may be an artifact of
    >> bash -- or of your configuration options in bash.
    >>
    >> Good Luck,
    >> DoN.

    >
    > Thank you for quick reply. I replaced bash with ksh, but with same
    > result, CTRL+C is working fine directly in shell, but not in tail (to
    > exit tail). I have to use CTRL+Z and then kill -9 to stop tail
    >
    > But, I discovered, that if I run tail as root, it's working fine (I
    > can stop tail with CTRL+C).
    >
    > So I dont know answers to these questions:
    > - If CTRL+C is working fine in shell, shall the setting be fine also
    > for tail? I, hope that yes.
    > - Why tail can't be stoped with CTRL+C or kill command (without -9)
    > running under user, but is working running under root?
    >
    > Thank you for any ideas,


    If you cannot kill it with 'kill -INT', or 'kill' with no options, you
    have something wrong with the system.

    If 'kill -INT' works, check the output of 'stty -a' and see if
    intr is defined as ^C.

    If that works, check to see if ^C is actually making it down the
    tty.
    typeing 'e' 'c' 'h' 'o' ' ' control-v control-c
    should show 'echo ^C'

    P.S.
    If you're one of those hosers that insists on using 'kill -9'
    every time... you might consider finding a new hobby/line of work.
    --
    Chris Dukes
    < elfick> willg: you can't use dell to beat people, it wouldn't stand up
    to the strain... much like attacking a tank with a wiffle bat

  5. Re: I can't stop tail -f /path/to/file via CTRL+C or kill onOpenBSD/sparc64 4.2

    thank you for reply

    > If you cannot kill it with 'kill -INT', or 'kill' with no options, you
    > have something wrong with the system.
    >


    yes that$s not working and have something wrong with my system

    > If 'kill -INT' works, check the output of 'stty -a' and see if
    > intr is defined as ^C.
    >


    kill not work, intr is defined correctly

    > If that works, check to see if ^C is actually making it down the
    > tty.
    > typeing 'e' 'c' 'h' 'o' ' ' control-v control-c
    > should show 'echo ^C'
    >


    I'm sorry, I don't understand this instruction

    > P.S.
    > If you're one of those hosers that insists on using 'kill -9'
    > every time... you might consider finding a new hobby/line of work.


    I'm not. That the reason I'm trying to understand what is wrong.

  6. Re: I can't stop tail -f /path/to/file via CTRL+C or kill on OpenBSD/sparc64 4.2

    On Mon, 10 Dec 2007 05:32:57 -0800 (PST) in <6f1d61d6-8303-4145-8943-0eef707fdc2e@r1g2000hsg.googlegroups.com> plavcik@gmail.com wrote:
    > thank you for reply
    >
    >> If you cannot kill it with 'kill -INT', or 'kill' with no options, you
    >> have something wrong with the system.
    >>

    >
    > yes that$s not working and have something wrong with my system


    When I said something wrong with your system, I meant either what
    you have on disk is corrupted, or your hardware is dodgy.

    At this point I would assume that something was corrupted during
    install and do a reinstall formatting all partitions. If it continues
    to corrupt I'd assume hardware was defective and try it on a different
    physical box.
    >
    >> If 'kill -INT' works, check the output of 'stty -a' and see if
    >> intr is defined as ^C.
    >>

    >
    > kill not work, intr is defined correctly


    Then again you don't seem to understand the concept of
    "Only do this if the previous thing worked."
    I'm also perfectly happy to write this off as an ID TEN T error.
    --
    Chris Dukes
    < elfick> willg: you can't use dell to beat people, it wouldn't stand up
    to the strain... much like attacking a tank with a wiffle bat

  7. Re: I can't stop tail -f /path/to/file via CTRL+C or kill onOpenBSD/sparc64 4.2

    On 10 Pro, 16:35, pak...@localhost.pr.neotoma.org wrote:
    > On Mon, 10 Dec 2007 05:32:57 -0800 (PST) in <6f1d61d6-8303-4145-8943-0eef707fd...@r1g2000hsg.googlegroups.com> plav...@gmail.com wrote:
    >
    > > thank you for reply

    >
    > >> If you cannot kill it with 'kill -INT', or 'kill' with no options, you
    > >> have something wrong with the system.

    >
    > > yes that$s not working and have something wrong with my system

    >
    > When I said something wrong with your system, I meant either what
    > you have on disk is corrupted, or your hardware is dodgy.
    >
    > At this point I would assume that something was corrupted during
    > install and do a reinstall formatting all partitions. If it continues
    > to corrupt I'd assume hardware was defective and try it on a different
    > physical box.
    >


    I hope, that HW is fine, because as root, it's working fine.

    I will try it on different machine and come back with result.

    Thank you for your replies.

    Jiri

  8. Re: I can't stop tail -f /path/to/file via CTRL+C or kill on OpenBSD/sparc64 4.2

    On 2007-12-07, plavcik@gmail.com wrote:
    >
    > Thank you for quick reply. I replaced bash with ksh, but with same
    > result, CTRL+C is working fine directly in shell, but not in tail (to
    > exit tail). I have to use CTRL+Z and then kill -9 to stop tail
    >
    > But, I discovered, that if I run tail as root, it's working fine (I
    > can stop tail with CTRL+C).
    >
    > So I dont know answers to these questions:
    > - If CTRL+C is working fine in shell, shall the setting be fine also
    > for tail? I, hope that yes.
    > - Why tail can't be stoped with CTRL+C or kill command (without -9)
    > running under user, but is working running under root?
    >
    > Thank you for any ideas,
    > Jiri



    Ok ... so it works from a non-root shell but works fine in a root shell
    on the same box? That likely means something is different with the two
    environments.

    Are you tailing the same file in both sessions?

    What file are you tailing?

    Can you tail some other files in the non-root shell and have ctrl-c
    work?

    What do the environments look like in the two sessions? In particular,
    TERM, PATH and any shell specific env vars.

    As an aside, ctrl-c-ing after running tail -f /var/log/messages as a non-root
    user works on my reasonably generic 4.0 install.

    --
    ratfood@food.skaterat.net
    All foods should be removed to reply

  9. Re: I can't stop tail -f /path/to/file via CTRL+C or kill onOpenBSD/sparc64 4.2

    On 10 Pro, 21:12, John McGrail wrote:
    > Are you tailing the same file in both sessions?
    >


    yes

    > What file are you tailing?
    >


    I started with this file
    ls -l /var/multilog/qmail-send/current
    -rw-r--r-- 1 multilog wheel 83238 Dec 10 23:18 /var/multilog/qmail-
    send/current

    /dev/wd0e on /var type ffs (local, nodev, nosuid)

    but, the issue is the same for any file I had tested

    -bash-3.2$ touch /tmp/empty
    -bash-3.2$ tail -f /tmp/empty
    ^C^Z
    [1]+ Stopped tail -f /tmp/empty

    -bash-3.2$ ps
    PID TT STAT TIME COMMAND
    23777 p2 Is 0:00.12 -bash (bash)
    27741 p2 T 0:00.02 tail -f /tmp/empty
    9382 p2 R+ 0:00.01 ps

    > Can you tail some other files in the non-root shell and have ctrl-c
    > work?
    >


    no

    > What do the environments look like in the two sessions? In particular,
    > TERM, PATH and any shell specific env vars.
    >


    user:
    TERM=xterm
    PATH=/home/navratil/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/
    usr/local/bin:/usr/local/sbin:/usr/games:.

    root:
    TERM=xterm
    PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/
    local/bin

    > As an aside, ctrl-c-ing after running tail -f /var/log/messages as a non-root
    > user works on my reasonably generic 4.0 install.
    >


    I'm using OpenBSD 4.2/sparc64

    MD5 (/usr/bin/tail) = 4dd13aa71c202e4b918e24b1be693e94
    (same as in package base42.tgz)

    I also compiled tail from source /usr/src/usr.bin/tail
    but it not helped

    but, what helped was /usr/ports/sysutils/colortail
    compiled colortail is working fine

    So I can check log files as regular user with colortail.

    Have someone else this problem on OpenBSD/sparc64 4.2. ? Will be
    helpfull for OpenBSD developers, that I will try something next?

    Thank you for all inputs I got so far,
    Jiri


  10. Re: I can't stop tail -f /path/to/file via CTRL+C or kill on OpenBSD/sparc64 4.2

    On 2007-12-10, plavcik@gmail.com wrote:
    >
    >> What do the environments look like in the two sessions? In particular,
    >> TERM, PATH and any shell specific env vars.
    >>

    >
    > user:
    > TERM=xterm
    > PATH=/home/navratil/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin:/
    > usr/local/bin:/usr/local/sbin:/usr/games:.
    >
    > root:
    > TERM=xterm
    > PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/sbin:/usr/
    > local/bin
    >


    So, it's unlikely you're picking up two different tails even though the
    PATHs are different. But you could check that with a 'which tail' to
    make sure.

    In the two different shells, run the command
    stty -a

    In particular look at the 'intr' setting It should be
    intr = ^C
    in both sessions.

    If not, then likely one of your .profile, .bashrc (or some other script) is
    changing your tty settings.

    Beyond that, I'm out of ideas short of running a debugger.

    --
    ratfood@food.skaterat.net
    All foods should be removed to reply

  11. Re: I can't stop tail -f /path/to/file via CTRL+C or kill onOpenBSD/sparc64 4.2

    On 11 Pro, 21:24, John McGrail wrote:
    > So, it's unlikely you're picking up two different tails even though the
    > PATHs are different. But you could check that with a 'which tail' to
    > make sure.
    >


    for both root a user a got the same path:
    which tail
    /usr/bin/tail


    > In the two different shells, run the command
    > stty -a
    >
    > In particular look at the 'intr' setting It should be
    > intr = ^C
    > in both sessions.
    >


    stty -a outputs from both shells are identical
    and intr = ^C

    > Beyond that, I'm out of ideas short of running a debugger.


    I had compiled tail (taken from /usr/src/usr.bin/tail) in my home dir
    to debug it. Which information are interesting next to info terminal?

    Thank you,
    Jiri

    gdb --args ./tail -f /var/multilog/qmail-send/current
    (gdb) run
    Starting program: /home/navratil/tail/tail -f /var/multilog/qmail-send/
    current
    ^C
    Program received signal SIGINT, Interrupt.
    0x0000000046a73788 in kevent () from /usr/lib/libc.so.41.0

    (gdb) info terminal
    Inferior's terminal status (currently saved by GDB):
    File descriptor flags = O_RDWR
    Process group = 22558
    c_iflag = 0x302, c_oflag = 0x7,
    c_cflag = 0x4b00, c_lflag = 0x5cf
    c_cc: 0x4 0xff 0xff 0x7f 0x17 0x15 0x12 0xff 0x3 0x1c 0x1a 0x19 0x11
    0x13 0x16 0xf 0x1 0x0 0xff 0xff

    (gdb) step
    Single stepping until exit from function kevent,
    which has no line number information.
    forward (fp=0x47123328, style=RLINES, off=10, sbp=0xffffffffffff7330)
    at forward.c:209
    209 } else if (ke.filter == EVFILT_READ) {
    (gdb) step
    210 continue;
    (gdb) step
    192 while (!feof(fp) && (ch = getc(fp)) != EOF)
    (gdb) step
    __srget (fp=0x47123328) at /usr/src/lib/libc/stdio/rget.c:45
    45 _SET_ORIENTATION(fp, -1);


    (gdb) continue
    Continuing.
    text
    text
    text
    ^C
    Program received signal SIGINT, Interrupt.
    0x0000000046a73788 in kevent () from /usr/lib/libc.so.41.0
    (gdb) quit
    The program is running. Exit anyway? (y or n) y
    ^C^C^C^C^C^Z
    [1]+ Stopped gdb --args ./tail -f /var/multilog/qmail-
    send/current

    ps
    27204 p1 Is 0:00.44 -bash (bash)
    532 p1 T 0:01.50 gdb --args ./tail -f /var/multilog/qmail-
    send/current
    22558 p1 TX 0:00.06 /home/navratil/tail/tail -f /var/multilog/
    qmail-send/

    gdb --args ./tail -f /var/multilog/qmail-send/current
    (gdb) run



    (gdb) interrupt
    (gdb) quit
    The program is running. Exit anyway? (y or n) y
    ^C^C^C^Z
    [1]+ Stopped gdb --args ./tail -f /var/multilog/qmail-
    send/current

+ Reply to Thread