The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
what is meaning of exit(0) and exit(1) amitpansuria UNIX for Dummies Questions & Answers 1 08-28-2007 04:02 AM
exit 2 xramm Shell Programming and Scripting 2 08-15-2007 10:48 AM
exit(0) versus exit(1) enuenu High Level Programming 9 06-22-2007 11:56 AM
Where can I find a list of exit codes? (Exit code 64) jkuchar747 UNIX for Dummies Questions & Answers 3 12-07-2004 06:08 PM
How to exit ssh davidg UNIX for Advanced & Expert Users 1 10-16-2003 08:10 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 06-20-2008
stv_t stv_t is offline
Registered User
  
 

Join Date: Jan 2008
Location: Gatwick, UK
Posts: 6
ZSH - '.zlogout' not being run on exit

Hi,

I have a problem with '.zlogout' not being run on Solaris 10.
Here's whats happening.
I remotely log in from a PC running Cygwin/X using a local xterm window and ssh to start a remote 'zsh' shell, version 4.2.5, on a Solaris 10 server.

The Server has KDE installed but as a Window manager is already running on the PC it cannot start KDE correctly. This does not give me a problem as the first xterm which connects to the server will also start 'kicker', the KDE menu bar, which allows me to access all the KDE programs that I need.

I have written a '.zlogout' script which will check to see if there are any 'zsh' sessions remaining. If there are not then it should kill any 'kicker' processes that I own.

The problem comes when I log off the server. The '.zlogout' script does not appear to be run leaving the 'kicker' process running.
I have run the .'zlogout' script manually from a ksh session after starting 'kicker' and it kills it off correctly, therefore there does not appear to anything wrong with the '.zlogout' script itself.

I have set $ZDOTDIR to the directory containing the '.zlogout' script and also placed an 'ls' command with the output re-directed to a file but nothing is being output, which leads me to believe that the '.zlogout' script is not being called.

Does anyone has any ideas of what may be wrong ?

This is the contents of the '.zlogout' file:

Code:
#!/usr/bin/zsh
ls -l > /tmp/t1    
xterm_cnt=$( ps -fu $USER | grep -v grep | grep -wc zsh )
if (( ${xterm_cnt} <= 1 )) ; then
    pkill -U ${USER} kicker
fi

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:41 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0