Diferencia entre revisiones de «Crear un servicio en linux»
Ir a la navegación
Ir a la búsqueda
Línea 10: | Línea 10: | ||
== Parametros == | == Parametros == | ||
Ejemplo para ejecutar como servicio una aplicación netcore. | |||
[Unit] | |||
Description=Example .NET Web API App running on Ubuntu | |||
[Service] | |||
WorkingDirectory=/var/www/helloapp | |||
ExecStart=/usr/bin/dotnet /var/www/helloapp/helloapp.dll | |||
Restart=always | |||
# Restart service after 10 seconds if the dotnet service crashes: | |||
RestartSec=10 | |||
KillSignal=SIGINT | |||
SyslogIdentifier=dotnet-example | |||
User=www-data | |||
Environment=ASPNETCORE_ENVIRONMENT=Production | |||
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false | |||
[Install] | |||
WantedBy=multi-user.target |
Revisión del 15:08 7 oct 2020
Comandos
Eliminar enlaces simbólicos del servicio creado
systemctl disable service
Parametros
Ejemplo para ejecutar como servicio una aplicación netcore.
[Unit] Description=Example .NET Web API App running on Ubuntu [Service] WorkingDirectory=/var/www/helloapp ExecStart=/usr/bin/dotnet /var/www/helloapp/helloapp.dll Restart=always # Restart service after 10 seconds if the dotnet service crashes: RestartSec=10 KillSignal=SIGINT SyslogIdentifier=dotnet-example User=www-data Environment=ASPNETCORE_ENVIRONMENT=Production Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
[Install] WantedBy=multi-user.target