Running as Linux daemon (Ubuntu/Debian)
Use the respective commands of your package manager if you use another distribution like Red Hat Linux.
For the details and troubleshooting please refer to the official Microsoft learn documentation: Install .NET on Linux distributions - .NET | Microsoft Learn
Prerequisites
Before you install the ASP.NET runtime, run the following commands to add the Microsoft package signing key to your list of trusted keys and add the package repository.
Example for Debian 11 (replace the “11” in the wget command with your Debian version)
wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
Install the runtime
Example for .Net 10 (which is needed for Nano 1.4.x)
See Prerequisites for the version you need.
sudo apt-get update
sudo apt-get install -y aspnetcore-runtime-10.0
Copy the “DpeNanoService” app to your Linux machine
Copy “DpeNanoService” app to the server using a tool that integrates into the organization's workflow (for example SCP, SFTP). It's common to locate web apps under the var directory (for example var/www/dpenanoservices).
scp -r .\dpenanoservices youruser@yourIP:/var/www/dpenanoservices
You need to adjust the folder permissions.
chmod 0777 /var/www/dpenanoservices
Create the service defintion file
In this example we use the nano editor.
sudo nano /etc/systemd/system/dpenanoservices.service
Copy this example “ini” to the editor and adjust the paths, where needed.
[Unit]
Description=DpeNanoServices running on Linux
[Service]
WorkingDirectory=/var/www/dpenanoservices
ExecStart=/usr/bin/dotnet /var/www/dpenanoservices/DpeNanoServices.dll --urls "http://0.0.0.0:5000" DpeParFile:DigaSystemRegistryXmlFilePath=DigaSystemRegistry_Linux.xml --environment Development
Restart=always
RestartSec=10
KillSignal=SIGINT
SyslogIdentifier=dotnet-example
User=root
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
[Install]
WantedBy=multi-user.target
Start the service
sudo systemctl start dpenanoservices.service
Make the service reboot save (start the service at OS start).
sudo systemctl enable dpenanoservices.service
Verify, if the service is running.
sudo systemctl status dpenanoservices.service
Optional
If you need to access your DIGAS Par files from a network share and not from a local folder, you need to mount the network share …
# 0a. Install the necessary CIFS utilities for mounting
sudo apt install cifs-utils -y
# 0b. Create the local directory where the remote share will be accessible
sudo mkdir /mnt/yourmount
# 1. Create the credentials file
sudo nano /etc/cifs-creds
# Content:
username=your_user
password=YourSecurePassword
domain=your_company.local
# 2. Secure the credentials file
# Sets permissions to read/write for owner only.
sudo chmod 600 /etc/cifs-creds
# 3. Test the mount temporarily
# Uses the 'credentials=' option pointing to the secured file.
sudo mount -t cifs //192.168.1.100/data/shared/folder /mnt/yourmount -o credentials=/etc/cifs-creds,vers=3.0
# 4. Add the entry to /etc/fstab for permanent mounting
sudo nano /etc/fstab
# Add this line:
//192.168.1.100/data/shared/folder /mnt/yourmount cifs credentials=/etc/cifs-creds,vers=3.0,iocharset=utf8 0 0