On Nov 4, 2017, at 3:32 PM, Perkins, Bradley D via 4D_Tech <[email protected]> wrote:
> I believe I've done everything I can using the pmset command to prevent > sleep, standby etc. It isn't clear if you can totally turn power management > off everywhere though. In researching this problem I also discovered the > 'caffeinate' command. This is a command-line system utility that is supposed > to prevent the computer from sleeping. I haven't tried it yet. Has anyone > here used it? If so, can you describe how? I don’t know if this is possible in your situation, but for the Mac Mini running 4D Server on 10.12 for my client I installed Apple’s Server app after having a couple issues suspected to be related to the power management. We had already purchased Server for other machines. If you go this route, you will probably have to configure your Apache web serving through the Server app. If you leave the FTP services turned off it shouldn’t interfere with whatever you’re using to run the SFTP server. > I first deployed this system in 1995 under 3.x and it has provided continuous > near 24/7/365 service since then. It has a small, but global user base which > is primarily web-based. The machine in question is the web 'client', but it > also runs a Apache for static web content and an SFTP server. This system has > remained largely unchanged functionality-wise in the last 10 years. The main > structure changes have been those required to upgrade major 4D versions. I > maintain this system, but haven't implemented many newer 4D features. I've > tried to stay aware of how 4D has changed. Is Apache still serving static content when 4D Remote stops working? > 2. Continuously monitor the 4D web server. Every few minutes an off-site > monitoring agent requests a simple dynamically generated page. If the request > times out, or if the response contains unexpected content, I get notified. > These requests provide an added benefit of keeping 4D busy during light or no > usage periods. You’ve only mentioned being notified by the scripts on the machine itself. Does the external service monitor also notify you that the 4D web server has stopped serving? > 3. There is not an easy way to externally determine if 4D, or any Mac OS > desktop app has hung. You can easily detect if 4D is running, but not when it > is non-responsive. For us this is when 4D has encountered a low-level error > that can't be gracefully handled with an error handler. It doesn't help that > any displayed dialogs provide little useful information. One solution is to > have 4D run a process that writes a 'heartbeat' file every minute and have a > system process check for changes to this file. If the file is present and > hasn't changed in more than a few minutes, we'll assume that 4D has hung and > run a script to kill it. At this point the auto-launcher from (1) above takes > over. This is where we seem to be failing currently. > > If others have done (3) how do you implement your heartbeat? I write a > current timestamp into the file every minute. That assumes the file exists > and is writable. It usually is. Is there a better way that is more robust? Which part of #3 is failing? Is the script to kill 4D being run and failing? Is it running “kill -9 process_id”? Is the auto-launch failing? Is the heartbeat file writing stopping while the service is actually running? There are numerous reports of problems with file writing and delayed processes. If only the heartbeat file writing is stopping, does the file actually exist and is still writable by that process? Where is the file located? Does the external service monitor have an API? If so, could you periodically check the external service monitor for your service, and bounce 4D when there is actually a problem with the service? Jim Crate ********************************************************************** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:[email protected] **********************************************************************

