zsh-workers
 help / color / mirror / code / Atom feed
* adding history logging "automagically" :)
@ 2007-07-09 17:41 Joe D
  2007-07-10  0:47 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Joe D @ 2007-07-09 17:41 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1556 bytes --]

Hi all,
   We have two user accounts which groups use for a few diff purposes, and
to ease our debugging of what went wrong when things crash with our tools,
we want a nice easy way to find out what was last done on the system (as
opposed to the user not having any idea what the previous user did).  So
essentially, these two user accounts (who already use 'zsh') will always log
to a file that not everyone has to know about (just the support teams).
This doesn't take into account users who switch shells, etc, but this will
give us info for about 90% of our problems.

So in a nutshell, all I want to do is modify 'zsh' source to always do the
following options automatically (regardless of if these lines are present or
not):

HISTSIZE=1000
SAVEHIST=1000
HISTFILE=/opt/some_location/.user.log
setopt APPEND_HISTORY
setopt SHARE_HISTORY
setopt INC_APPEND_HISTORY

I've played around with hist.c & init.c with various functions and couldn't
quite get this behaviour, so I was hoping for a few pointers from anyone?
I've looked at 'init_misc' in init.c and tried simple things like:

    dosetopt(SHAREHISTORY, 1, 1);
    dosetopt(INCAPPENDHISTORY, 1, 1);

and in 'hist.c', I've used

char *new_hf = "/opt/some_location/.user.log"
setsparam("HISTFILE", ztrdup(new_hf));

in a few different places, but didn't seem to do the trick.  At this point,
i get a ".user.log.LOCK" file created in the proper place, but nothing gets
written to ".user.log" even after the shell is exitted.

Any suggestions/info/comments would be greatly appreciated.

Thanks,
Joe.

[-- Attachment #2: Type: text/html, Size: 2545 bytes --]

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

end of thread, other threads:[~2007-07-10  1:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-09 17:41 adding history logging "automagically" :) Joe D
2007-07-10  0:47 ` Bart Schaefer
2007-07-10  1:27   ` Joe D

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).