> On 28 Aug 2019, at 10:23 am, Mike Beatty via 4D_Tech <[email protected]> 
> wrote:
> 
> All-
> 
> Running into an issue trying to get a v16.6 built application to run as a 
> service, wondering if anyone has this in place before we ramp up the 
> troubleshooting.
> 
> A few notes — this is on a client remote server, which is administered        
> by a third party that will not allow us to have administrative access. The 
> machine does have a 2003 app running as a service. We can run the application 
> outside of services without an issue. We have switched between running as the 
> local account to use interactive desktop, but when we try to view the 
> message, we get kicked out of machine — the third party group loses 
> connection for roughly 60 seconds, then reports seeing both a power shell 
> window and a command prompt. When running as an administrator account, as is 
> the 2003 version, the service will start, then inexplicably stop. Windows 
> logs don’t shed much light on the issue.
> 
> We are going to start trying other means to find cause/resolution, just 
> wanted to see if anyone is running this config successfully.

Hi Mike

We're not running v16.6 specifically but it's probably worth checking how the 
server locates the data file it needs to use. If the server can't find the 
right data file when running as a service, it won't start.

This is a semi-complicated area. One way to control it is to use the Default 
Data mechanism but this causes crashes for us in the versions we've tested it 
with (v17.0, 17.1, 17.2, 17R4). The crashes occur when 4D is trying to open the 
Default.4DD data file so it is before any of our code runs so there's not much 
we can do about it. For that reason we can't use this mechanism on Windows, 
although we use it successfully on Mac.

The other option revolves around how the path to the last used data file is 
stored (set using the LastDataPathLookup key in the BuildApp.xml). There are 
three options:
1. InDbStruct (store the path in the 4DC)
2. ByAppName (store the path in user preferences, indexed by the structure name)
3. ByAppPath (store the path in user preferences, indexed by the full path to 
the server executable)

On Windows the latter two options reference the file here: 
%APPDATA%\Roaming\<structure_name>\lastDataPath.xml

If you use either option 2 or 3 you muct have the "Use new architecture for 
application deployments" option ticked in the Compatibility page of the 
Structure Settings.

You would use option 3 over option 2 if you have more than one instance of the 
same application on the server.

If you are running the service under the local system account rather than a 
user account, the path to the lastDataPath.xml file is actually at:

C:\Windows\System32\config\systemprofile\AppData\Roaming\<structure_name>\

unless you're running a 32-bit server application on a 64-bit Windows OS, in 
which case replace System32 with SysWOW64 above.

Once the server has started successfully once, it will remember the path to the 
data file using one of these mechanisms and will continue to open sucessfully 
thereafter. Unless you use option 1 (InDbStruct) in which case the next time 
you deploy a new 4DC file you will lose the path to the data file and be back 
in the same boat. For this reason I would recommend using option 2 or 3 in your 
situation.

Hope that helps!

cheers
J
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to