Is there a way for the image to know when it has been restarted (ie, the vm is killed and then restarted).
Thank you in advance, Derek
Nerd on a Wire: Web and Information Solutions Website Design - Database Systems - Site Hosting 604.874.6463 mailto:info@nerdonawire.com For more information, visit http://nerdonawire.com
On Friday 03 January 2003 04:12 pm, Derek Brans wrote:
Is there a way for the image to know when it has been restarted (ie, the vm is killed and then restarted).
Yes: all the classes registered with the startup list get notified by calling their #startUp: or #startUp method. The parameter to startUp: indicates whether the image is restarting after a snapshot.
you do this:
Smalltalk addToStartUpList: SomeClass.
later the system calls:
SomeClass startUp: true (if resuming after snapshot) or SomeClass startUp: false (if starting fresh)
I don't think this is what Derek meant. I would presume that he's rather interested in finding out if the image crashed the last time it was run. I've actually been interested myself in this but as of now there's no way to distinguish between a "quit" and a crash. It is also hard to figure out (for example) if you crashed after a "save".
The reason why I wanted this was actually to have a trivial little watcher that should come up and tell newbies "by the way you crashed but here are changes you did" and throw them right into a change list - I've found that many newbies are very concerned about "loosing their stuff" since Squeak doesn't present that standard "file based feel" and there is nothing obvious that tells them that you can recover everything from the changes with the right tool (and what and where this tool is).
Cheers, - Andreas
-----Original Message----- From: squeak-dev-admin@lists.squeakfoundation.org [mailto:squeak-dev-admin@lists.squeakfoundation.org] On Behalf Of Ned Konz Sent: Saturday, January 04, 2003 1:18 AM To: squeak-dev@lists.squeakfoundation.org Subject: Re: testing for image restart
On Friday 03 January 2003 04:12 pm, Derek Brans wrote:
Is there a way for the image to know when it has been restarted (ie, the vm is killed and then restarted).
Yes: all the classes registered with the startup list get notified by calling their #startUp: or #startUp method. The parameter to startUp: indicates whether the image is restarting after a snapshot.
you do this:
Smalltalk addToStartUpList: SomeClass.
later the system calls:
SomeClass startUp: true (if resuming after snapshot) or SomeClass startUp: false (if starting fresh)
-- Ned Konz http://bike-nomad.com GPG key ID: BEEA7EFE
On Friday 03 January 2003 04:29 pm, Andreas Raab wrote:
I don't think this is what Derek meant.
You're right. I missed the whole question.
I would presume that he's rather interested in finding out if the image crashed the last time it was run. I've actually been interested myself in this but as of now there's no way to distinguish between a "quit" and a crash. It is also hard to figure out (for example) if you crashed after a "save".
I think it would be hard to tell whether *significant* changes had happened since the last save. Though you could certainly watch for unsaved source code changes or doits after a change. But what about direct manipulation of Morphs?
The reason why I wanted this was actually to have a trivial little watcher that should come up and tell newbies "by the way you crashed but here are changes you did" and throw them right into a change list - I've found that many newbies are very concerned about "loosing their stuff" since Squeak doesn't present that standard "file based feel" and there is nothing obvious that tells them that you can recover everything from the changes with the right tool (and what and where this tool is).
That would be easy enough to do at startup time if all you were concerned about was source code changes.
-----Original Message----- From: squeak-dev-admin@lists.squeakfoundation.org [mailto:squeak-dev-admin@lists.squeakfoundation.org] On Behalf Of Ned Konz Sent: Saturday, January 04, 2003 1:18 AM To: squeak-dev@lists.squeakfoundation.org Subject: Re: testing for image restart
On Friday 03 January 2003 04:12 pm, Derek Brans wrote:
Is there a way for the image to know when it has been restarted (ie, the vm is killed and then restarted).
Yes: all the classes registered with the startup list get notified by calling their #startUp: or #startUp method. The parameter to startUp: indicates whether the image is restarting after a snapshot.
you do this:
Smalltalk addToStartUpList: SomeClass.
later the system calls:
SomeClass startUp: true (if resuming after snapshot) or SomeClass startUp: false (if starting fresh)
-- Ned Konz http://bike-nomad.com GPG key ID: BEEA7EFE
Ned,
That would be easy enough to do at startup time if all you were concerned about was source code changes.
This would be a good starting point. From there you could extend it to log direct manipulations as well (similar to undo records) or capture some intermediate state. And you could also truncate the changes log programatically after a "successful quit" which would keep it small.
Cheers, - Andreas
-----Original Message----- From: squeak-dev-admin@lists.squeakfoundation.org [mailto:squeak-dev-admin@lists.squeakfoundation.org] On Behalf Of Ned Konz Sent: Saturday, January 04, 2003 1:41 AM To: squeak-dev@lists.squeakfoundation.org Subject: Re: testing for image restart
On Friday 03 January 2003 04:29 pm, Andreas Raab wrote:
I don't think this is what Derek meant.
You're right. I missed the whole question.
I would presume that he's rather interested in finding out if the image crashed the last time it was run. I've actually been interested myself in this but as of now there's no way to distinguish between a "quit" and a crash. It is also hard to figure out (for example) if you crashed after a "save".
I think it would be hard to tell whether *significant* changes had happened since the last save. Though you could certainly watch for unsaved source code changes or doits after a change. But what about direct manipulation of Morphs?
The reason why I wanted this was actually to have a trivial little watcher that should come up and tell newbies "by the way you crashed but here are changes you did" and throw them right into a change list - I've found that many newbies are very concerned about "loosing their stuff" since Squeak doesn't present that standard "file based feel" and there is nothing obvious that tells them that you can recover everything from the changes with the right tool (and what and where this tool is).
That would be easy enough to do at startup time if all you were concerned about was source code changes.
-----Original Message----- From: squeak-dev-admin@lists.squeakfoundation.org [mailto:squeak-dev-admin@lists.squeakfoundation.org] On Behalf Of Ned Konz Sent: Saturday, January 04, 2003 1:18 AM To: squeak-dev@lists.squeakfoundation.org Subject: Re: testing for image restart
On Friday 03 January 2003 04:12 pm, Derek Brans wrote:
Is there a way for the image to know when it has been restarted (ie, the vm is killed and then restarted).
Yes: all the classes registered with the startup list get notified by calling their #startUp: or #startUp method. The parameter to startUp: indicates whether the image is restarting after a snapshot.
you do this:
Smalltalk addToStartUpList: SomeClass.
later the system calls:
SomeClass startUp: true (if resuming after snapshot) or SomeClass startUp: false (if starting fresh)
-- Ned Konz http://bike-nomad.com GPG key ID: BEEA7EFE
-- Ned Konz http://bike-nomad.com GPG key ID: BEEA7EFE
On Sat, 4 Jan 2003, Andreas Raab wrote:
I don't think this is what Derek meant. I would presume that he's rather interested in finding out if the image crashed the last time it was run. I've actually been interested myself in this but as of now there's no way to distinguish between a "quit" and a crash. It is also hard to figure out (for example) if you crashed after a "save".
The only way I came up with to do that is to write out a small file on startup, and delete it on shutdown. If the file exists when you start back up again, you must have crashed.
On Sat, Jan 04, 2003 at 01:29:14AM +0100, Andreas Raab wrote:
I don't think this is what Derek meant. I would presume that he's rather interested in finding out if the image crashed the last time it was run. I've actually been interested myself in this but as of now there's no way to distinguish between a "quit" and a crash. It is also hard to figure out (for example) if you crashed after a "save".
The reason why I wanted this was actually to have a trivial little watcher that should come up and tell newbies "by the way you crashed but here are changes you did" and throw them right into a change list - I've found that many newbies are very concerned about "loosing their stuff" since Squeak doesn't present that standard "file based feel" and there is nothing obvious that tells them that you can recover everything from the changes with the right tool (and what and where this tool is).
A good way to do this is with a "session identifier". If you happen to have OSProcess loaded, see "OSProcess accessor getSessionIdentifier". For a more general solution, see http://swiki.gsug.org:8080/sqfixes/1942.html. This is out of date by now, but I'll be happy to bring it up to date if there is interest.
Dave
How do you get the changes you made since you last saved after a crash (I just crashed by subclassing the 'name' method in a class)?
Thanks in advance, Derek
On Friday, January 3, 2003, at 04:29 PM, Andreas Raab wrote:
I don't think this is what Derek meant. I would presume that he's rather interested in finding out if the image crashed the last time it was run. I've actually been interested myself in this but as of now there's no way to distinguish between a "quit" and a crash. It is also hard to figure out (for example) if you crashed after a "save".
The reason why I wanted this was actually to have a trivial little watcher that should come up and tell newbies "by the way you crashed but here are changes you did" and throw them right into a change list - I've found that many newbies are very concerned about "loosing their stuff" since Squeak doesn't present that standard "file based feel" and there is nothing obvious that tells them that you can recover everything from the changes with the right tool (and what and where this tool is).
Cheers,
- Andreas
-----Original Message----- From: squeak-dev-admin@lists.squeakfoundation.org [mailto:squeak-dev-admin@lists.squeakfoundation.org] On Behalf Of Ned Konz Sent: Saturday, January 04, 2003 1:18 AM To: squeak-dev@lists.squeakfoundation.org Subject: Re: testing for image restart
On Friday 03 January 2003 04:12 pm, Derek Brans wrote:
Is there a way for the image to know when it has been restarted (ie, the vm is killed and then restarted).
Yes: all the classes registered with the startup list get notified by calling their #startUp: or #startUp method. The parameter to startUp: indicates whether the image is restarting after a snapshot.
you do this:
Smalltalk addToStartUpList: SomeClass.
later the system calls:
SomeClass startUp: true (if resuming after snapshot) or SomeClass startUp: false (if starting fresh)
-- Ned Konz http://bike-nomad.com GPG key ID: BEEA7EFE
Nerd on a Wire: Web and Information Solutions Website Design - Database Systems - Site Hosting 604.874.6463 mailto:info@nerdonawire.com For more information, visit http://nerdonawire.com
Derek Brans brans@nerdonawire.com is claimed by the authorities to have written:
How do you get the changes you made since you last saved after a crash (I just crashed by subclassing the 'name' method in a class)?
World menu->changes->recent log file opens a browser on all the changes logged since some chosen point in the past. Select the ones you want and file them in. Then repeat after you discover you accidentally selected the crucial one that caused the problem in the first place.... and probably repeat again at least one more time.
tim
On Sunday 05 January 2003 05:06 pm, Derek Brans wrote:
How do you get the changes you made since you last saved after a crash (I just crashed by subclassing the 'name' method in a class)?
Changes/recently logged changes. select the changes you want and choose "file in".
Come to think of it, I'd like to know how to apply the changes too. Thank you, Derek
On Friday, January 3, 2003, at 04:29 PM, Andreas Raab wrote:
I don't think this is what Derek meant. I would presume that he's rather interested in finding out if the image crashed the last time it was run. I've actually been interested myself in this but as of now there's no way to distinguish between a "quit" and a crash. It is also hard to figure out (for example) if you crashed after a "save".
The reason why I wanted this was actually to have a trivial little watcher that should come up and tell newbies "by the way you crashed but here are changes you did" and throw them right into a change list - I've found that many newbies are very concerned about "loosing their stuff" since Squeak doesn't present that standard "file based feel" and there is nothing obvious that tells them that you can recover everything from the changes with the right tool (and what and where this tool is).
Cheers,
- Andreas
-----Original Message----- From: squeak-dev-admin@lists.squeakfoundation.org [mailto:squeak-dev-admin@lists.squeakfoundation.org] On Behalf Of Ned Konz Sent: Saturday, January 04, 2003 1:18 AM To: squeak-dev@lists.squeakfoundation.org Subject: Re: testing for image restart
On Friday 03 January 2003 04:12 pm, Derek Brans wrote:
Is there a way for the image to know when it has been restarted (ie, the vm is killed and then restarted).
Yes: all the classes registered with the startup list get notified by calling their #startUp: or #startUp method. The parameter to startUp: indicates whether the image is restarting after a snapshot.
you do this:
Smalltalk addToStartUpList: SomeClass.
later the system calls:
SomeClass startUp: true (if resuming after snapshot) or SomeClass startUp: false (if starting fresh)
-- Ned Konz http://bike-nomad.com GPG key ID: BEEA7EFE
Nerd on a Wire: Web and Information Solutions Website Design - Database Systems - Site Hosting 604.874.6463 mailto:info@nerdonawire.com For more information, visit http://nerdonawire.com
Thanks for your replies. What is the diff between snapshot vs starting fresh?
If I'm backing up data from my image, I need to know when the image has "quit without save" or crashed, because in that case, the backup data on disk is probably more recent than the data in the image.
Thanks again, Derek
On Friday, January 3, 2003, at 04:18 PM, Ned Konz wrote:
On Friday 03 January 2003 04:12 pm, Derek Brans wrote:
Is there a way for the image to know when it has been restarted (ie, the vm is killed and then restarted).
Yes: all the classes registered with the startup list get notified by calling their #startUp: or #startUp method. The parameter to startUp: indicates whether the image is restarting after a snapshot.
you do this:
Smalltalk addToStartUpList: SomeClass.
later the system calls:
SomeClass startUp: true (if resuming after snapshot) or SomeClass startUp: false (if starting fresh)
-- Ned Konz http://bike-nomad.com GPG key ID: BEEA7EFE
Nerd on a Wire: Web and Information Solutions Website Design - Database Systems - Site Hosting 604.874.6463 mailto:info@nerdonawire.com For more information, visit http://nerdonawire.com
Thanks for your replies. What is the diff between snapshot vs starting fresh?
You can use the argument provided in the startUp: method. This will tell you if the image was started freshly or if it is continuing after a save.
If I'm backing up data from my image, I need to know when the image has "quit without save" or crashed,
That's essentially the problem I was describing. However,
because in that case, the backup data on disk is probably more recent than the data in the image.
you could test this explicitly by adding a time stamp to your backup data and remember it in the image. Upon saves, it will become persistent so that whenever you start the image you can check the backup against the time stamp and perform the appropriate action.
Cheers, - Andreas
I gather a (in Ned's words) "snapshot" restart is equivalent to: save and quit then restart While a "start from fresh" is equivalent to quit or crash no save then restart.
On Friday, January 3, 2003, at 05:21 PM, Derek Brans wrote:
Thanks for your replies. What is the diff between snapshot vs starting fresh?
If I'm backing up data from my image, I need to know when the image has "quit without save" or crashed, because in that case, the backup data on disk is probably more recent than the data in the image.
Thanks again, Derek
On Friday, January 3, 2003, at 04:18 PM, Ned Konz wrote:
On Friday 03 January 2003 04:12 pm, Derek Brans wrote:
Is there a way for the image to know when it has been restarted (ie, the vm is killed and then restarted).
Yes: all the classes registered with the startup list get notified by calling their #startUp: or #startUp method. The parameter to startUp: indicates whether the image is restarting after a snapshot.
you do this:
Smalltalk addToStartUpList: SomeClass.
later the system calls:
SomeClass startUp: true (if resuming after snapshot) or SomeClass startUp: false (if starting fresh)
-- Ned Konz http://bike-nomad.com GPG key ID: BEEA7EFE
Nerd on a Wire: Web and Information Solutions Website Design - Database Systems - Site Hosting 604.874.6463 mailto:info@nerdonawire.com For more information, visit http://nerdonawire.com
Nerd on a Wire: Web and Information Solutions Website Design - Database Systems - Site Hosting 604.874.6463 mailto:info@nerdonawire.com For more information, visit http://nerdonawire.com
On Friday 03 January 2003 07:04 pm, Derek Brans wrote:
I gather a (in Ned's words) "snapshot" restart is equivalent to: save and quit then restart While a "start from fresh" is equivalent to quit or crash no save then restart.
On Friday, January 3, 2003, at 05:21 PM, Derek Brans wrote:
Thanks for your replies. What is the diff between snapshot vs starting fresh?
No. Snapshot is when you just say:
Smalltalk snapshot
or the equivalent:
Smalltalk snapshot: true andQuit: false.
or choose "save" from the menu. When you do this, all shutdown registrants are first told
shutDown: false
then the image is saved, then all startUp registrants are told to
startUp: true
We do this so that we don't save the image in a start that can't be restarted easily.
squeak-dev@lists.squeakfoundation.org