Oqtane als Linux Service laufen lassen #5

Closed
opened 2025-10-19 21:11:29 +00:00 by Kocoder · 5 comments
Owner

Momentan läuft Oqtane in einem GNU-Screen. Praktischer wäre es einen eigenen Linux Service dafür zu schreiben, damit man leichter Starten, Stoppen, oder die Restartfunktion von Oqtane nutzen kann.

Momentan läuft Oqtane in einem GNU-Screen. Praktischer wäre es einen eigenen Linux Service dafür zu schreiben, damit man leichter Starten, Stoppen, oder die Restartfunktion von Oqtane nutzen kann.
Kocoder added the
Kind/Enhancement
label 2025-10-19 21:11:29 +00:00
Kocoder self-assigned this 2025-10-19 21:11:30 +00:00
Kocoder added this to the Taskboard project 2025-10-19 21:11:30 +00:00
Kocoder moved this to To Do in Taskboard on 2025-10-19 21:12:09 +00:00
Kocoder added a new dependency 2025-10-19 21:43:25 +00:00
Author
Owner
https://linuxhandbook.com/create-systemd-services/ https://linuxhandbook.com/systemd-list-services/ https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html
Author
Owner

/etc/systemd/system/kestrel-oqtane.service

[Unit]
Description=Oqtane .NET Web App running on Linux

[Service]
WorkingDirectory=/home/kocoder/oqtane.framework/publish
ExecStart=/usr/bin/dotnet /home/kocoder/oqtane.framework/publish/Oqtane.Server.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=30
KillSignal=SIGINT
SyslogIdentifier=oqtane-kestrel
User=konstantin
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=ASPNETCORE_URLS="http://10.59.0.124:5000"
Environment=ASPNETCORE_FORWARDEDHEADERS_ENABLED=true
Environment=ASPNETCORE_FORWARDEDHEADERS_PROXIES=10.59.0.124
Environment=DOTNET_NOLOGO=true

[Install]
WantedBy=multi-user.target
/etc/systemd/system/kestrel-oqtane.service ``` [Unit] Description=Oqtane .NET Web App running on Linux [Service] WorkingDirectory=/home/kocoder/oqtane.framework/publish ExecStart=/usr/bin/dotnet /home/kocoder/oqtane.framework/publish/Oqtane.Server.dll Restart=always # Restart service after 10 seconds if the dotnet service crashes: RestartSec=30 KillSignal=SIGINT SyslogIdentifier=oqtane-kestrel User=konstantin Environment=ASPNETCORE_ENVIRONMENT=Production Environment=ASPNETCORE_URLS="http://10.59.0.124:5000" Environment=ASPNETCORE_FORWARDEDHEADERS_ENABLED=true Environment=ASPNETCORE_FORWARDEDHEADERS_PROXIES=10.59.0.124 Environment=DOTNET_NOLOGO=true [Install] WantedBy=multi-user.target ```
Author
Owner

/etc/systemd/system/kestrel-oqtane.service

[Unit]
Description=Oqtane .NET Web App running on Linux

[Service]
WorkingDirectory=/home/kocoder/oqtane.framework/publish
ExecStart=/usr/bin/dotnet /home/kocoder/oqtane.framework/publish/Oqtane.Server.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=30
KillSignal=SIGINT
SyslogIdentifier=oqtane-kestrel
User=konstantin
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=ASPNETCORE_URLS="http://10.59.0.124:5000"
Environment=ASPNETCORE_FORWARDEDHEADERS_ENABLED=true
Environment=ASPNETCORE_FORWARDEDHEADERS_PROXIES=10.59.0.124
Environment=DOTNET_NOLOGO=true

[Install]
WantedBy=multi-user.target

Source: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-9.0&tabs=linux-ubuntu#create-the-service-file

> /etc/systemd/system/kestrel-oqtane.service > ``` > [Unit] > Description=Oqtane .NET Web App running on Linux > > [Service] > WorkingDirectory=/home/kocoder/oqtane.framework/publish > ExecStart=/usr/bin/dotnet /home/kocoder/oqtane.framework/publish/Oqtane.Server.dll > Restart=always > # Restart service after 10 seconds if the dotnet service crashes: > RestartSec=30 > KillSignal=SIGINT > SyslogIdentifier=oqtane-kestrel > User=konstantin > Environment=ASPNETCORE_ENVIRONMENT=Production > Environment=ASPNETCORE_URLS="http://10.59.0.124:5000" > Environment=ASPNETCORE_FORWARDEDHEADERS_ENABLED=true > Environment=ASPNETCORE_FORWARDEDHEADERS_PROXIES=10.59.0.124 > Environment=DOTNET_NOLOGO=true > > [Install] > WantedBy=multi-user.target > ``` Source: https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-9.0&tabs=linux-ubuntu#create-the-service-file
Kocoder added spent time 30 minutes 2025-10-19 21:48:57 +00:00
Kocoder moved this to Backlog in Taskboard on 2025-10-20 06:42:18 +00:00
Kocoder moved this to To Do in Taskboard on 2025-10-23 15:43:16 +00:00
Kocoder moved this to In Progress in Taskboard on 2025-10-23 15:52:55 +00:00
Kocoder added spent time 15 minutes 2025-10-23 15:53:03 +00:00
Author
Owner

/etc/systemd/system/kestrel-oqtane.service

[Unit]
Description=Oqtane .NET Web App running on Linux

[Service]
WorkingDirectory=/home/kocoder/oqtane.framework/publish
ExecStart=/usr/bin/dotnet /home/kocoder/oqtane.framework/publish/Oqtane.Server.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=30
KillSignal=SIGINT
SyslogIdentifier=oqtane-kestrel
User=konstantin
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=ASPNETCORE_URLS="http://10.59.0.124:5000"
Environment=ASPNETCORE_FORWARDEDHEADERS_ENABLED=true
Environment=ASPNETCORE_FORWARDEDHEADERS_PROXIES=10.59.0.124
Environment=DOTNET_NOLOGO=true

[Install]
WantedBy=multi-user.target

Wrong Paths: /home/kocoder wurde mit /home/konstantin ausgetauscht.

Und RestartSec auf 5 heruntergesetzt.

> /etc/systemd/system/kestrel-oqtane.service > ``` > [Unit] > Description=Oqtane .NET Web App running on Linux > > [Service] > WorkingDirectory=/home/kocoder/oqtane.framework/publish > ExecStart=/usr/bin/dotnet /home/kocoder/oqtane.framework/publish/Oqtane.Server.dll > Restart=always > # Restart service after 10 seconds if the dotnet service crashes: > RestartSec=30 > KillSignal=SIGINT > SyslogIdentifier=oqtane-kestrel > User=konstantin > Environment=ASPNETCORE_ENVIRONMENT=Production > Environment=ASPNETCORE_URLS="http://10.59.0.124:5000" > Environment=ASPNETCORE_FORWARDEDHEADERS_ENABLED=true > Environment=ASPNETCORE_FORWARDEDHEADERS_PROXIES=10.59.0.124 > Environment=DOTNET_NOLOGO=true > > [Install] > WantedBy=multi-user.target > ``` Wrong Paths: /home/kocoder wurde mit /home/konstantin ausgetauscht. Und RestartSec auf 5 heruntergesetzt.
Author
Owner

Oqtane läuft jetzt als Linux Service

Oqtane läuft jetzt als Linux Service
Kocoder moved this to Review in Taskboard on 2025-10-23 15:54:07 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Total Time Spent: 45 minutes
Kocoder
45 minutes
Due Date
No due date set.
Depends on
#6 Install dotnet Systemwide (for linux service)
Diplomarbeit-Absolventenverein/oqtane.framework
Reference: Diplomarbeit-Absolventenverein/oqtane.framework#5
No description provided.