[Unit]
Description=am Cms
[Service]
Type=simple
# will set the Current Working Directory (CWD)
WorkingDirectory=/srv/am
# systemd will run this executable to start the service
ExecStart=/usr/bin/dotnet /srv/am/web.dll --urls "http://localhost:5060;"
# to query logs using journalctl, set a logical name here
SyslogIdentifier=amina
# Use your username to keep things simple, for production scenario's I recommend a dedicated user/group.
# If you pick a different user, make sure dotnet and all permissions are set correctly to run the app.
# To update permissions, use 'chown yourusername -R /srv/AspNetSite' to take ownership of the folder and files,
# Use 'chmod +x /srv/AspNetSite/AspNetSite' to allow execution of the executable file.
User=ubuntu
# ensure the service restarts after crashing
Restart=always
# amount of time to wait before restarting the service
RestartSec=5
KillSignal=SIGINT
Environment=ASPNETCORE_ENVIRONMENT=Production
Environment=DOTNET_PRINT_TELEMETRY_MESSAGE=false
# This environment variable is necessary when dotnet isn't loaded for the specified user.
# To figure out this value, run 'env | grep DOTNET_ROOT' when dotnet has been loaded into your shell.
# Environment=DOTNET_ROOT=/opt/rh/rh-dotnet31/root/usr/lib64/dotnet
# When using the out of the box ASP.NET Tempates, this environment variable will allow you to override
# which IP & ports the Kestrel Web Server will listen to
# Environment=ASPNETCORE_URLS=http://*:80;https://*:443
# give the executed process the CAP_NET_BIND_SERVICE capability. This capability allows the process to bind to well known ports.
# AmbientCapabilities=CAP_NET_BIND_SERVICE
[Install]
WantedBy=multi-user.target