- Docs
- On-Premise
- On-Premise Agent
- Installing the Agent as a System Service
Installing the Agent as a System Service
Setting up the Files.com Agent as a system service ensures that it starts automatically whenever the system powers on or reboots. This setup allows the Agent to run independently of user logins, making it a reliable part of your background operations.
Windows
Before you install the Agent as a Windows service, make sure that the root
setting in the configuration file uses either a local drive path (such as C:\path\to\folder
) or a UNC path to an accessible network drive (such as \\servername\c$\path\to\folder
).
Microsoft advises using UNC paths instead of mapped network drives for system services, so make sure to follow that recommendation for best results.
MSI Based Service Installation
If you're using a Windows x86 64-bit system, you can download the Agent Installer MSI executable from the Agent's download page.
Use the MSI specifically when you want to install the Agent as a system service. If you plan to run the Agent manually before setting it up as a service, be sure to download and use the EXE version instead.
Place the MSI file in the same folder as the Agent configuration file before installation. Once you’ve updated the configuration file, simply double-click the MSI to install the Agent as a service.
After installation, you’ll find the configuration file at C:\Program Files\Files.com-Agent\files_agent_config.toml
.
To uninstall the service, open the Windows “Add or remove programs” app and remove the Agent from there.
Command Line Service Installation
You can also install the Agent as a Windows service, by using the command:
files-agent.exe service install --config C:\path\to\files_agent_config.toml
When you install the Agent this way, the executable and configuration file stay in their current locations. After installation, open the Windows Services app, locate the "Files.com Agent v2" entry, right-click it, and select Start to begin running the service.
You can also start the service from the command line by running:
files-agent.exe service start
If you need to update the configuration file, stop the service first, make your changes, and then restart the service.
To stop it via the command line, use:
files-agent.exe service stop
To remove the Agent service from the system, run:
files-agent.exe service uninstall
Windows Service Permissions
Make sure the Windows service account running the Agent has the right permissions to access the folder defined in the configuration file's root
setting. For most environments, using a named Active Directory account is the best practice. Configure the service to log on as this account and verify that it exists on both the Agent host system and any remote system the UNC path references. This account must also have the "Log on as a service" privilege. The Agent will only be able to access the root
items that the selected user account has permissions to access.
If you choose a local system user account instead, ensure the same account exists and has appropriate access on both systems.
Windows Service Recovery Options
When you install the Agent as a service, it’s set to restart automatically if it fails. You can confirm this setup in the "Recovery" tab of the service's properties.
Linux
Before you install the Agent as a service, make sure that the root
setting in the configuration file uses either a local drive path (such as /path/to/folder
) or a path to an accessible mounted network drive (such as /mnt/path/to/folder
).
To install the Agent as a service on a Linux system, run the following command:
files-agent service install --user-service=false --config /path/to/files_agent_config.toml
Start the service with:
files-agent service start
If you modify the configuration file, stop the service, make your updates, and then restart it.
To stop the service, use:
files-agent service stop
When you're ready to remove the Agent service, run:
files-agent service uninstall --user-service=false
Alternative Installation Method for Linux
If your Linux system uses the systemd
init system, you can install the Agent service by creating a service file. For Linux variants that use another init system, refer to the system's init documentation.
Create a file at /lib/systemd/system/files-agent.service
with the following content:
[Unit]
Description=Files.com Agent v2
ConditionFileIsExecutable=/usr/bin/files-agent
[Service]
StartLimitInterval=5
StartLimitBurst=10
ExecStart=/usr/bin/files-agent "start" "--config" "/path/to/files_agent_config.toml" "--log_file" "/path/to/files-agent.log"
Restart=always
RestartSec=60
[Install]
WantedBy=multi-user.target
Replace the ExecStart
paths (config file and log file) with the correct locations for your configuration and log files.
After creating the service file, install and enable it using:
sudo systemctl enable files-agent
Start the service with:
sudo systemctl start files-agent
If any modifications to the configuration file are needed then stop the service first, modify the configuration file, and restart the service.
Stop the service with:
sudo systemctl stop files-agent
Remove the service with:
sudo systemctl disable files-agent
Mac
Before you install the Agent as a service, make sure that the root
setting in the configuration file uses either a local drive path (such as /path/to/folder
) or a path to an accessible mounted network drive (such as /mnt/path/to/folder
).
To install the Agent as a Launchd
service on a Mac, use this command:
files-agent service install --config /path/to/files_agent_config.toml
This method keeps the executable and configuration file in their original locations.
Start the service with:
files-agent service start
If you update the configuration file, stop the service, make your changes, and restart it.
Stop the service with:
files-agent service stop
Remove the service with:
files-agent service uninstall