zsh-users
 help / color / mirror / code / Atom feed
* IPC (or how to "bounce" a running zsh?)
@ 2004-12-23  3:59 kynn
  2004-12-23  4:13 ` Clint Adams
  0 siblings, 1 reply; 5+ messages in thread
From: kynn @ 2004-12-23  3:59 UTC (permalink / raw)
  To: zsh-users





Is there any mechanism for interprocess communication in which at
least one of the processes is a running zsh?

TIA!

kj

P.S. The context of this question is the problem of "bouncing" a
running zsh, i.e. telling it somehow to re-source the appropriate .z*
files (according to whether or not it is an interactive/login shell).
(I realize that I could solve this problem by adding one more task to
my poor overworked preexec or precmd, and coax it to do a "poor man's
IPC", namely to check for the presence of a sentinel file, perform the
appropriate re-sourcing, and delete the sentinel; this opens the
possibility of a race condition, but I'm sure there is a way to deal
with it.)



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

* Re: IPC (or how to "bounce" a running zsh?)
  2004-12-23  3:59 IPC (or how to "bounce" a running zsh?) kynn
@ 2004-12-23  4:13 ` Clint Adams
  2004-12-23  4:53   ` kynn
  0 siblings, 1 reply; 5+ messages in thread
From: Clint Adams @ 2004-12-23  4:13 UTC (permalink / raw)
  To: kynn; +Cc: zsh-users

> Is there any mechanism for interprocess communication in which at
> least one of the processes is a running zsh?

On most systems, you could use named pipes.  See mkfifo(1).

With the corresponding zsh modules, you can use either
TCP (zsh/net/tcp) or Unix domain sockets (zsh/net/socket).
See zshmodules(1).

Modules for SYSV IPC or POSIX IPC have not yet been written.


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

* Re: IPC (or how to "bounce" a running zsh?)
  2004-12-23  4:13 ` Clint Adams
@ 2004-12-23  4:53   ` kynn
  0 siblings, 0 replies; 5+ messages in thread
From: kynn @ 2004-12-23  4:53 UTC (permalink / raw)
  To: zsh-users


   Date: Wed, 22 Dec 2004 23:13:53 -0500
   From: Clint Adams <clint@zsh.org>

   > Is there any mechanism for interprocess communication in which at
   > least one of the processes is a running zsh?

   On most systems, you could use named pipes.  See mkfifo(1).

   With the corresponding zsh modules, you can use either
   TCP (zsh/net/tcp) or Unix domain sockets (zsh/net/socket).
   See zshmodules(1).

   Modules for SYSV IPC or POSIX IPC have not yet been written.



Great.  Thanks!

kj





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

* Re: IPC (or how to "bounce" a running zsh?)
  2004-12-23  9:01 Oliver Kiddle
@ 2004-12-23 17:03 ` kynn
  0 siblings, 0 replies; 5+ messages in thread
From: kynn @ 2004-12-23 17:03 UTC (permalink / raw)
  To: zsh-users



   From: Oliver Kiddle <okiddle@yahoo.co.uk>
   Date: Thu, 23 Dec 2004 10:01:01 +0100

   > Is there any mechanism for interprocess communication in which at
   > least one of the processes is a running zsh?

   You can use a signal and trap it from the running zsh:
     trap "source ~/.zshrc" USR1

   Then just send the running zsh the USR1 signal. (kill -USR1).

   In effect, signals are a simple form of communication. They are just
   somewhat limited because you can't attach data when sending a signal.


For my immediate purposes that'd be good enough, actually.  Thanks.

On a related note, does anyone know where I can find a listing of the
default actions zsh performs in response to the various kill signals?
I hoped to find this info in zshall, but no dice.

kj




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

* Re: IPC (or how to "bounce" a running zsh?)
@ 2004-12-23  9:01 Oliver Kiddle
  2004-12-23 17:03 ` kynn
  0 siblings, 1 reply; 5+ messages in thread
From: Oliver Kiddle @ 2004-12-23  9:01 UTC (permalink / raw)
  To: Zsh users; +Cc: kynn

> Is there any mechanism for interprocess communication in which at
> least one of the processes is a running zsh?

You can use a signal and trap it from the running zsh:
  trap "source ~/.zshrc" USR1

Then just send the running zsh the USR1 signal. (kill -USR1).

In effect, signals are a simple form of communication. They are just
somewhat limited because you can't attach data when sending a signal.

Oliver


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

end of thread, other threads:[~2004-12-23 17:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-12-23  3:59 IPC (or how to "bounce" a running zsh?) kynn
2004-12-23  4:13 ` Clint Adams
2004-12-23  4:53   ` kynn
2004-12-23  9:01 Oliver Kiddle
2004-12-23 17:03 ` kynn

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