Setup as a Background Service
This article instructs how to set up the Robocorp Workforce Agent Core background process on a Linux machine so that you get a new Unattended Worker into your Control Room.
The primary purpose of running Robocorp Workforce Agent Core as a service is to set up your machine as a constant Environment resource in Control Room just by having the machine powered on.
- You should be familiar with Systemctl Utility in Linux, systemd and command line use of Linux.
- The target machine must have at least
curlor similar to download needed files and a text-editor of your choosing.
- To follow along, you need a Robocorp account to access Control Room and Robocorp Workforce Agent Core.
- If you haven't already, you might want first to follow the Quickstart guide to get familiar with Control Room.
- You must have
sudopermissions on the machine to set up the service.
On Linux, you will not get UI access via this service setup; it is limited to so-called "headless" runs that do not need UI-level actions. It is good to note that a lot can be done even at this level; browser automation, excel data handling, etc., do NOT require any UI.
Officially we are testing the setups on Ubuntu distros; as there are so many different Linux distros, the guides here cannot cover all, but the setup is quite simple and should be adaptable in most cases.
The guide below does not cover the installation of other components your robot might need, e.g., chromium-browser
<link token> below with a link token created from the Control Room
Workers -page. Note that Workforce Agent is always linked to a specific workspace in Control Room to avoid accidental runs between development and production Workers.
At this point, you should be able to see the Environment in the
Idle state in Control Room, and you can test executing a simple bot like Python - Minimal Template.
This setup, however, will shut down once you log out of the machine or the terminal, so you should move on to the service setup next.
Create the service config filetouch /etc/systemd/system/RobocorpAgentCore.service sudo chmod 664 /etc/systemd/system/RobocorpAgentCore.service
Add the following content to the config file
Edit the file
/etc/systemd/system/RobocorpAgentCore.servicewith your favorite text editor.[Unit] Description=Robocorp Agent [Service] User=<user> ExecStart=/home/centos/.robocorp/robocorp-workforce-agent-core start --service Restart=always PrivateDevices=true ProtectControlGroups=true ProtectKernelTunables=true ProtectSystem=full RestrictSUIDSGID=true PrivateTmp=yes [Install] WantedBy=default.target
<user>with actual user
ExecStartneeds to have the absolute path
Setup and start the service:sudo systemctl daemon-reload sudo systemctl start RobocorpAgentCore.service sudo systemctl status RobocorpAgentCore.service
If you want the service to be running after startup you have to run:
The typical maintenance task is to update the Agent Core executable.
For that, you need to:
- Stop the service
- Download the latest Agent Core
- Restart the service