Path: utzoo!utgpu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!agate!csam.lbl.gov!csam!clarsen From: clarsen@lbl.gov (Case Larsen) Newsgroups: alt.hackers Subject: Updating running processes Message-ID: Date: 22 May 91 20:21:24 GMT Sender: usenet@csam.lbl.gov Distribution: alt Organization: Coalition for Properly Tail Recursive Languages Lines: 27 Approved: joe-code Nntp-Posting-Host: intruder.lbl.gov A nice thing about SunOS is that it pages directly from the file. The business of updating and restarting a server process that is constantly running on many machines is made simpler by noticing that when a process attempts to page from a newer image than it was started with, it dies. A shell script that restarts the server again after it dies can be used to automatically restart the server after updates. E.g. #!/bin/csh /etc/server-process exec $0 In my case, the server is a database process and updates are done by copying over the newly compiled program and broadcasting a query to all the database servers. The process starts to get "unblocked" because of the availability of data for read, but gets aborted and restarted because the disk image changed. This beats rsh $i 'ps agx | egrep server-process | \ some-ugly-awk-kill-script-I-forget| sh' and is faster. -- Case Larsen clarsen@lbl.gov -- ;; Case Larsen ;; Email: clarsen@lbl.gov