home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / network / lsshdown / lsshdown.doc < prev    next >
Text File  |  1993-01-11  |  4KB  |  105 lines

  1.  
  2.                  OS/2 LAN Server Shutdown command-line utility
  3.  
  4.                        Copyright (C) 1993 Dimitri Vulis
  5.  
  6. This program is free software; you can redistribute it and/or modify it under
  7. the terms of the GNU General Public License as published by the Free Software
  8. Foundation; either version 1, or (at your option) any later version.
  9.  
  10. This program is distributed in the hope that it will be useful, but WITHOUT ANY
  11. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  12. PARTICULAR PURPOSE. See the GNU General Public License for more details.
  13.  
  14. You should have received a copy of the GNU General Public License along with
  15. this program; if not, write to the Free Software Foundation, Inc., 675 Mass
  16. Ave, Cambridge, MA 02139, USA.
  17.  
  18.                                  Description:
  19.  
  20. The purpose of this short utility is to shut down an IBM LAN Server network
  21. server gracefully. I've found it incovenient to walk over to the server and go
  22. through PM to shut it down. Also if you try to shutdown without first issuing
  23. NET STOP on all the services, it occasionally dumps registers and abends. Just
  24. turning off the server with open HPFS files has caused disk corruption,
  25. requiring lengthy recovery. This little utility is my answer to the problems
  26. I've encountered. I hope it'll help others.
  27.  
  28. What this program does (see the source code for the exact details):
  29.  
  30. 1. It tries to close all the files that are open via the server. (Not the
  31. locally open files, I don't know how to do that). This is equivalent to issuing
  32. NET FILE nnnn /CLOSE for each remotely open file.
  33.  
  34. 2. It issues NET USE resource /D for all USEd network resources. This is not
  35. strictly necessary, and it will not delete, e.g., a network drive which is the
  36. current drive for some process.
  37.  
  38. 3. It likewise closes all the sessions via NET SESSION /D. It does not log out
  39. users to update the DCDB; I don't know how to do that, but would like to know.
  40.  
  41. 4. It tries to stop all the network services. It issues NET START to list
  42. running services, issues NET STOP name to each, waits 1/10 of a second, then
  43. does it again; if a service hasn't stopped after 10 seconds, it's probably
  44. hung, so it goes on to the next step.
  45.  
  46. 5. It asks OS/2 to flush disk buffers and shut down the file system. Unlike
  47. the shutdown routine in the desktop menu, it does not ask you to confirm
  48. whether you want to shutdown (which is impossible remotely).
  49.  
  50. 6. It beeps for 1 second and freezes. At this point, according to the
  51. documentation, it should be safe to turn off or reset (via Ctrl-Alt-Del) the
  52. server (provided the disk light is off). If you press something else, like
  53. Ctrl-Break, Ctrl-Esc, Ctrl-Alt-NumLock, etc, after the beep, you may get a
  54. register dump, a blank screen, etc, but you can't do anything useful once
  55. DosShutdown has returned.
  56.  
  57. If you're invoking LSSHDOWN via NET ADMIN from a workstation, you'll get back
  58. messages NET3502 and SYS0240 indicating that the network connection has been
  59. lost (not suprisingly).
  60.  
  61. The network calls use C:\MUGLIB\DLL\NETAPI.DLL, not present in vanilla OS/2
  62. 2.0, so the executable won't run without the LAN Server's requester.
  63.  
  64. Please e-mail your comments to me at DLV@DM.COM.
  65.  
  66.                                     Usage:
  67.  
  68.  path\LSSHDOWN
  69.  
  70. There are no arguments and no output except the final beep.
  71.  
  72. Conveniently, the program can also be invoked remotely from a workstation:
  73.  
  74.  NET ADMIN \\server /COMMAND path\LSSHDOWN
  75.  
  76. (You need to be logged on the workstation with PRIV:ADMIN or OPER:SERVER,
  77. but you need not be logged on the server.)
  78.  
  79. and timed via AT:
  80.  
  81.  AT 13:00 path\LSSHDOWN
  82.  
  83. You can even put it on the server's desktop (there's an icon inside the
  84. .EXE file) by running this REXX .CMD script:
  85.  
  86.  /* If you don't want it on the desktop, replace <WP_DESKTOP> (location)
  87.  by something like <WP_OS2SYS> */
  88.  
  89.  call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  90.  call sysloadfuncs
  91.  
  92.  result = SysCreateObject('WPProgram', 'NShutdown', '<WP_DESKTOP>',,
  93.  'EXENAME=M:\UTIL\BINP\LSSHDOWN.EXE;PROGTYPE=PM;OBJECTID=<SRV_SHUTDOWN>', 'U')
  94.  
  95.                               ZIP file contents:
  96.  
  97. LSSHDOWN.DOC        this file
  98. LSSHDOWN.EXE        executable
  99. MAKEFILE            make file
  100. LSSHDOWN.C          source files
  101. LSSHDOWN.DEF
  102. LSSHDOWN.ICO
  103. LSSHDOWN.RC
  104. COPYING             GNU licence
  105.