Overview
The PosService program is a small stub that can be used to start Fieldpine POS as a Windows Service. It simply loads fpos.dll and transfers control to it. fpos.dll contains all the application logic.
Stopping PosService on a running system may have the following side effects:
- Active BIS transfers are stopped and may result in either failure or hang at the remote POS lanes. These failures are instantly fatal but do not result in permanent problems. Repeating the Sync operation will clear any problem.
- All caches are lost, and starting the service with active trading can result in significant amounts of time to come back online. As each lane sends sales to the server, the server is required to load details of previous sales to avoid duplicates. This typically takes several seconds per lane, and if sales from different lanes arrive during this scanning time, then the server appears to hang for long periods as it clears the backlog. This is not an issue, and not even noticeable by remote users, but if you try and use the PosService directly during this time it may respond slowly.
- Realtime validations, such as Prepay, accounts, vouchers and similar are set to offline mode while the service is not responding. The exact effect of this depends on site configuration and policy, but does open a small window of indeterminate operation.
- (P1839) If your site is using permanent links to lanes, the lanes will all enter retry mode until the server is restarted. This can generate large amounts of TCP/UDP connect attempts if you have lots of active lanes.
Command Line
To register the service, you can use the following Windows Commands.
sc delete PosService sc create "PosService" binPath= "C:\Fieldpine\Pos\PosService.exe" sc config PosService start= "delayed-auto" sc failure PosService reset= 1800 actions= restart/30000/restart/60000/restart/180000Note, the spacing in the above commands is important. You can also issue QuickCode F72058 from a PosLane to perform the commands shown. The SC command may require administrator rights.
Application Start Logic
- Set Service status "Start Pending"
- Initialise Windows environment (COM etc)
- Perform any code updates pending. Code updates are simply applied and must already be present, this program does not directly download updates
- Load fpos.dll from the same folder as PosService.exe
- Set Service status "Started"
- Initialise the DLL and transfer control to it. fpos.dll is started in "service" mode, which primarily indicates that it is running in background mode.
As services do not have consoles to display error messages, fpos.dll will typically write error messages into the file CoreError.log
Notes
PosService requires a valid, current licence code. It will not start without a licence. Licences should be placed in fpos.ctl using the form licence:YYYYZZZZAAAABBBBCCCC where the actual licence string is used in place of YYYYZZZZAAAABBBBCCCC.
If you need to record a trace file for the PosService, you need to pre-enable this in the fpos.ctl file with cmdline:debug=4 This instructs the POS at startup to enable tracing as soon as possible. The trace file will be called trace.out and if you start the Pos interactively (eg for selling), it will also use this setting and overwrite the trace file. If tracing the service, be sure to only run the service
If the PosService has errors to report it will typically write these to the file CoreError.log