zsh-users
 help / color / mirror / code / Atom feed
* can't set HISTFILE to /dev/null
@ 2011-06-23 19:46 Danek Duvall
  2011-06-24  8:54 ` Peter Stephenson
  2011-06-24 10:52 ` Vincent Lefevre
  0 siblings, 2 replies; 4+ messages in thread
From: Danek Duvall @ 2011-06-23 19:46 UTC (permalink / raw)
  To: zsh-users

A colleague of mine saw this today:

    zsh: locking failed for /dev/null: operation not supported: reading anyway

Turns out he was setting HISTFILE=/dev/null, rather than unsetting it.
4.3.10 was silent in this case, but 4.3.12 now complains.  Is this
intentional?

I've not seen the ENOTSUP, but he was doing something with zones that might
have changed the situation a bit.  Still, if I do

    HISTFILE=/dev/null
    fc -R

then I see

    zsh: locking failed for /dev/null: permission denied: reading anyway

and it appears to be coming from the same place in the code.

Thanks,
Danek


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: can't set HISTFILE to /dev/null
  2011-06-23 19:46 can't set HISTFILE to /dev/null Danek Duvall
@ 2011-06-24  8:54 ` Peter Stephenson
  2011-06-24 14:13   ` Bart Schaefer
  2011-06-24 10:52 ` Vincent Lefevre
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Stephenson @ 2011-06-24  8:54 UTC (permalink / raw)
  To: zsh-users

On Thu, 23 Jun 2011 12:46:24 -0700
Danek Duvall <duvall@comfychair.org> wrote:
> A colleague of mine saw this today:
> 
>  zsh: locking failed for /dev/null: operation not supported: reading anyway
>...
>  zsh: locking failed for /dev/null: permission denied: reading anyway
> 
> Turns out he was setting HISTFILE=/dev/null, rather than unsetting it.
> 4.3.10 was silent in this case, but 4.3.12 now complains.  Is this
> intentional?

Error messages apart, which is down to OS behaviour (both of those look
reasonable), this is behaving as designed.  We've had problems with
history file locking in the past, which can cause silent corruption, so
it now alerts the user if there was a failure to lock the file so they
can do something about it.

Using /dev/null was never a supported method of turning *off* history
saving --- indeed, it doesn't turn it off, the shell busily saves all
the contents straight to the bit bucket, which is a waste of time.  This
has always happened, all that's changed is that the shell now says "this
doesn't seem to be doing what I expect, is this what you really wanted?"

The recommended way of turning off file saving (by me, anyway) is to set
SAVEHIST to 0.

-- 
Peter Stephenson <pws@csr.com>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom
More information can be found at www.csr.com. Follow CSR on Twitter at http://twitter.com/CSR_PLC and read our blog at www.csr.com/blog


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: can't set HISTFILE to /dev/null
  2011-06-23 19:46 can't set HISTFILE to /dev/null Danek Duvall
  2011-06-24  8:54 ` Peter Stephenson
@ 2011-06-24 10:52 ` Vincent Lefevre
  1 sibling, 0 replies; 4+ messages in thread
From: Vincent Lefevre @ 2011-06-24 10:52 UTC (permalink / raw)
  To: zsh-users; +Cc: Danek Duvall

On 2011-06-23 12:46:24 -0700, Danek Duvall wrote:
> A colleague of mine saw this today:
> 
>     zsh: locking failed for /dev/null: operation not supported: reading anyway
> 
> Turns out he was setting HISTFILE=/dev/null, rather than unsetting it.
> 4.3.10 was silent in this case, but 4.3.12 now complains.  Is this
> intentional?

Locking is intentional (4.3.10 did that incorrectly, and the history
file could become corrupt, in particular under NFS). If you really
want HISTFILE=/dev/null, you can try to unset HIST_FCNTL_LOCK.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: can't set HISTFILE to /dev/null
  2011-06-24  8:54 ` Peter Stephenson
@ 2011-06-24 14:13   ` Bart Schaefer
  0 siblings, 0 replies; 4+ messages in thread
From: Bart Schaefer @ 2011-06-24 14:13 UTC (permalink / raw)
  To: zsh-users

On Jun 24,  9:54am, Peter Stephenson wrote:
}
} Using /dev/null was never a supported method of turning *off* history
} saving

Seems to me it was more likely intended to turn off history *loading*.
SAVEHIST=0 won't do that, nor will HISTSIZE=0 (though it'll all get
thrown away after loading in the latter case).

However, the right way is to unset HISTFILE, not set it to /dev/null.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-24 14:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-23 19:46 can't set HISTFILE to /dev/null Danek Duvall
2011-06-24  8:54 ` Peter Stephenson
2011-06-24 14:13   ` Bart Schaefer
2011-06-24 10:52 ` Vincent Lefevre

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).