Skip to content

Install DevCDR Agent on Linux

Roger Zander edited this page Oct 19, 2019 · 4 revisions

Installation

dotnet --info
Host (useful for support):
  Version: 2.2.5
  Commit:  0a3c9209c0

.NET Core SDKs installed:
  No SDKs were found.

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.2.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.2.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.2.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  • Download DevCDR Agent Core 2:
    wget https://github.com/rzander/DevCDR/releases/download/1.0.0.3/devcdr_core2.tar
  • extract archive
    tar -xvf devcdr_core2.tar
  • run DevCDR Agent
    dotnet DevCDR_Agent_Core21.dll

Set EndPoint

Edit appsettings.json to define the DevCDRURL:

{
  "settings": {
    "DevCDRURL": "https://devcdrcore.azurewebsites.net/chat",
    "Groups": "Linux"
  }
}

Run DevCDR as daemon

create a file /etc/systemd/system/devcdr.service with the following content:

Note: WorkingDirectory and ExecStart may be different in your environment

[Unit]
Description=DeviceCommander

[Service]
WorkingDirectory=/opt/devcdrcore
ExecStart=/usr/share/dotnet/dotnet /opt/devcdrcore/DevCDR_Agent_Core21.dll &
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
SyslogIdentifier=dotnet-devcdr
User=root

[Install]
WantedBy=multi-user.target

Register and start the service:

sudo systemctl enable devcdr
sudo systemctl start devcdr

To stop the DevCDR Agent:

sudo systemctl stop devcdr