home *** CD-ROM | disk | FTP | other *** search
/ Education Sampler 1992 [NeXTSTEP] / Education_1992_Sampler.iso / NeXT / Misc / HigherEducationMailbox.mbox / Archives_provide_val_.attach / May_91 / workspace.500 < prev    next >
Text File  |  1991-05-21  |  3KB  |  53 lines

  1. {\rtf0\ansi{\fonttbl\f0\fnil Times-Roman;\f2\fmodern Courier;}
  2. \paperw11440
  3. \paperh16000
  4. \margl120
  5. \margr120
  6. \pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b0\i0\ul0\fs28 loginwindow .login .logout hooks\
  7. \
  8. Q:  How do you execute ~/.login, ~/.cshrc, ~/.profile, or ~/.logout without invoking Terminal, Shell, or a similar sort of shell-based terminal emulator?  Is there a hook in Workspace Manager that allows you do something when you log in or log out?\
  9. \
  10. A:  All the shell run control files (the ones mentioned above) are shell-specific.  .cshrc, .login, and .logout pertain to the C-Shell; .profile pertains to the Bourne Shell.  Only those programs examine and execute these files.  (By implication, then, if your login shell is neither csh nor sh, these files will not be executed even when you launch Terminal or Shell.)\
  11. \
  12. There is a "LoginHook" and a "LogoutHook" in 
  13. \b loginwindow
  14. \b0 .  The LoginHook is run just before loginwindow launches the specified workspace (by default, the NeXT Workspace Manager; but this can be overridden in the user's defaults database), and after account verification.  Note that the LoginHook is NOT run under the Workspace Manager, but rather is run BEFORE the Workspace Manager.  LogoutHook is run after the Workspace Manager terminates.\
  15. \
  16. To set up these hooks, type:\
  17.  
  18. \f2 \
  19.  
  20. \fs24     myhost% 
  21. \b su
  22. \b0 \
  23.     myhost# 
  24. \b dwrite loginwindow LoginHook someProgram
  25. \b0 \
  26.     myhost# 
  27. \b dwrite loginwindow LogoutHook someOtherProgram
  28. \b0 \
  29.     myhost# 
  30. \b exit
  31. \b0 \
  32.  
  33. \fs28 \
  34.  
  35. \f0  where the final argument to 
  36. \b dwrite
  37. \b0  is the name of whatever program you want to run.
  38. \b   
  39. \b0 This creates the default on a machine-by-machine basis, since the information is stored in the directory /.NeXT.  (Of course, if you have netboot clients, it need only be done on the servers of all the clients, since the root directory is shared.
  40. \b )\
  41.  
  42. \b0 \
  43. Note that neither hook is run if an automatic "me" login is performed.  The real philosophy behind the hooks is to provide additional accounting or authentication, rather than setting up the Workspace Manager's environment.  If something is required within the Workspace Manager's environment, the only real option is to have a program of your specification autolaunched from your dock.  (Yes, this will use up one of your dock slots, and it's only an option when you have an available dock slot.)\
  44. \
  45. See /NextLibrary/Documentation/NeXT/SysAdmin/ApA_BootSequence.wn for more information on loginwindow.\
  46. \
  47. QA500\
  48. \
  49. Valid for 1.0\
  50. Valid for 2.0\
  51. \
  52.  
  53.