I'm running a ASP.net Core 2.0 on my raspberry Pi, called IoTServer, for homeautomation.
It runs fine, on port 5003, when I start it manually.
> pi@raspberrypi:~/Programs/iotserver $ ./IoTServer Hosting environment:
> Production Content root path: /home/pi/Programs/iotserver Now
> listening on: http://[::]:5003 Application started. Press Ctrl+C to
> shut down.
However, once I move it to a service, it still seems to start up fine, without any errors, but it can no longer be reached on 127.0.0.1:5003 or via LAN.
How can I debug this? I've tried different user pi and root, but no difference.
I use the systemmd style of running it.
[Unit]
Description=IoTServer
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/home/pi/Programs/iotserver
ExecStart=/home/pi/Programs/iotserver/IoTServer
Restart=always
[Install]
WantedBy=multi-user.target
When I check the status of the service it shows:
pi@raspberrypi:~ $ service iotserver status
● iotserver.service - IoTserver
Loaded: loaded (/etc/systemd/system/iotserver.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2018-08-16 19:09:18 CEST; 4min 40s ago
Main PID: 445 (IoTServer)
CGroup: /system.slice/iotserver.service
└─445 /home/pi/Programs/iotserver/IoTServer
Aug 16 19:10:11 raspberrypi IoTServer[445]: info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
Aug 16 19:10:11 raspberrypi IoTServer[445]: User profile is available. Using '/root/.local/share/ASP.NET/DataProtection-Keys' as key repository; keys wil
Aug 16 19:10:17 raspberrypi IoTServer[445]: Hosting environment: Production
Aug 16 19:10:17 raspberrypi IoTServer[445]: Content root path: /
Aug 16 19:10:17 raspberrypi IoTServer[445]: Now listening on: http://[::]:5003
Aug 16 19:10:17 raspberrypi IoTServer[445]: Application started. Press Ctrl+C to shut down.
Aug 16 19:13:38 raspberrypi IoTServer[445]: info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
Aug 16 19:13:38 raspberrypi IoTServer[445]: Request starting HTTP/1.1 GET http://192.168.1.100:5003/
Aug 16 19:13:40 raspberrypi IoTServer[445]: info: Microsoft.AspNetCore.Hosting.Internal.WebHost[2]
Aug 16 19:13:40 raspberrypi IoTServer[445]: Request finished in 1975.3237ms 404
Edit: It does seem to receive and process the request, but it is not fed back to the requestor.