Is it possible to, using the same code, create an .NET Core application that can be run as a windows service and as a deamon on linux?
Do you have an example/proof of concept?
Linux daemon services can be in any language that could be executed on system.
Daemons can be executed using systemd (in Fedora: systemctl start name.service). To put your program on Linux Systemd services you should create a new .service file and move it into '/etc/systemd/system/'
The syntax of a service it is:
[Unit]
Description=The description of your service
After=previous services needed
[Service]
ExecStart=The program execution /sbin/helloworld.exe
ExecStop=The command given when killing the service
[Install]
WantedBy=services that needs your service
More information about Linux-Red Hat services and service modules: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/sect-Managing_Services_with_systemd-Unit_Files.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With