Usually it is convenient to run the license server as a background system service in order to have it started automatically upon OS start. 


If Agisoft License Server is to be installed as a system service, we recommend doing this before activating the floating licenses via the following procedure: (Metashape 2.x) Floating license activation procedure

In case the floating licenses are already activated, deactivate them, install and run Agisoft FLS as a service and then re-activate the floating licenses.


The sections below describe how to set up Agisoft License Server as a system service on Windows, Linux and macOS.:



Setting up Agisoft FLS on Windows


Use the service-name <service_name> , service install and service start command line parameters, providing that administrative privileges have been used. For example:

agisoft-fls.exe --service install <start parameters>

then start the service:

agisoft-fls.exe --service start
For Agisoft FLS v.1.0.1 it is required to use the full absolute path to agisoft-fls.exe when installing service via cmd.exe.



In <start parameters> it is possible to use the IP address of the license server machine can be used as --host argument value. If required, also port number can be customized from default 5842 value, for example:

agisoft-fls.exe --service install --host 127.0.0.1:5842 

To stop and remove service corresponding parameters should be used:

agisoft-fls.exe --service stop 
agisoft-fls.exe --service remove

By default the service name is "Agisoft License Server". If the service name should be customized, then additional argument:
--service-name "Service Name"
 should be used for all commands that install, start, stop and remove the service.



After activating the floating licenses via Agisoft FLS run as a service, the license files will be stored in the following directory:

C:\Windows\ServiceProfiles\LocalService\AppData\Local\Agisoft\LicenseServer\



Setting up Agisoft FLS on Linux


On Linux we suggest to create the system service (daemon) via systemd manager.


Create a file agisoft-fls.service in /etc/systemd/system/ directory with the following content:

[Unit]
Description=Agisoft License Server 
After=network.target 

[Service]
ExecStart=<absolute path to agisoft-fls binary> <start parameters> 
User=<user> 

[Install]
WantedBy=default.target


For <start parameters> you can use --host 127.0.0.1:5842 argument, for example, using the license server IP address and desired port number.


Parameter <user> defines the user account that will be used to start the service (we do not recommend to use root account). The license files corresponding to the floating licenses activated via Agisoft FLS run as a service will be stored in the following directory: 

/home/<user>/.local/share/Agisoft/LicenseServer/



After creation or modification of the .service file, the reload command should be used, then auto start of the service should be enabled and finally service should be started:

sudo systemctl daemon-reload 
sudo systemctl enable agisoft-fls 
sudo systemctl start agisoft-fls

To stop and disable the service the following commands should be used:

sudo systemctl stop agisoft-fls 
sudo systemctl disable agisoft-fls

Current status of the service can be checked via the following command:

sudo systemctl status agisoft-fls



Setting up Agisoft FLS on macOS


On macOS we suggest to create the system service (daemon) via launchd manager.


Create a file com.agisoft.license-server.plist in /Library/LaunchDaemons/ directory with the following content:

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 
<plist version="1.0"> 
<dict>
    <key>Label</key>
    <string>com.agisoft.license-server</string>
    <key>ProgramArguments</key>
    <array>
        <string>absolute path to agisoft-fls binary</string>
    </array>
    <key>KeepAlive</key>
    <true/>
    <key>UserName</key>
    <string>username</string>
</dict>
</plist>


Parameter "Label" defines unique service (daemon) id and usually is the same as .plist file name.


Parameter "UserName" defines the user account that will be used to start the service (we do not recommend to use root account). 

The license files corresponding to the floating licenses activated via Agisoft FLS run as a service will be stored in the following directory: 

/Users/<username>/Library/Application Support/Agisoft/LicenseServer/



After creating *.plist file it is necessary to load and start service using command load <path to *.plist>:

sudo launchctl load /Library/LaunchDaemons/com.agisoft.license-server.plist


Service can be stopped and unloaded using unload <path to *.plist> commandfor example:

sudo launchctl unload /Library/LaunchDaemons/com.agisoft.license-server.plist