Overview
In some situations, M-Files client service is not necessarily starting automatically. This situation may happen for example on the Citrix server when after server restart, the M-Files client service cannot contact the shared cache server. Starting M-Files client service with delay would solve this this issue since due to delay connection to shared cache server would be ready when M-Files client service is started. However, setting Startup type to "Automatic (Delayed Start)" is not possible currently. It gives the following error:There is open improvement (ID 132218) to make delayed start available for M-Files Client service.
The completed improvement will be is listed on Release note pages after it has been implemented.
Workaround
Set Startup type as "Manual" in services.mcs and create a script which applies delayed start. Script is started on Task scheduler.Workaround Example
Delayed start can be set via following example Powershell script, which is then to run in Windows Task Scheduler:example scipt delayed_start_mfclient.ps1:
Start-Sleep -s 30 | Out-Null # Set delay for 30 seconds
net start "MFClient 21.6.10322.8" | Out-Null # Start M-Files client service
Note that starting MFClient is tied to specific version in the script. To handle the version dynamically in the script, the version number needs to be parsed separately.
- Create new basic task to Windows Task scheduler and set it run when logging in to computer:
- Select "Start a program" to run specific script.
- Set task to run with argument "-executionpolicy bypass -file "path_to_script\file.ps1" (For example: "-executionpolicy bypass -file "C:\scripts\delayed_start_mfclient.ps1") and select "Run with highest privileges" in Task Scheduler.
Now, when restarting the computer and logging in, script should be run, and M-Files client started with delay.
Please notice that scripting is not part of standard support, and this is just an example script. Be aware that all scripts are run at your own risk.
