Make uvicorn work with socket

This commit is contained in:
Edgar P. Burkhart 2022-05-21 16:07:12 +02:00
parent ea4959dc44
commit 67f145a992
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
3 changed files with 2 additions and 13 deletions

View file

@ -14,7 +14,6 @@ optdepends=("postgresql: database")
source=(
"${pkgname}::git+ssh://gitea@git.edgarpierre.fr:39529/edpibu/nummi.git"
"${pkgname}.service"
"${pkgname}.socket"
"${pkgname}.tmpfiles"
"${pkgname}.sysusers"
"${pkgname}.nginx"
@ -22,7 +21,6 @@ source=(
package() {
install -Dm644 ${pkgname}.service -t "${pkgdir}"/usr/lib/systemd/system/
install -Dm644 ${pkgname}.socket -t "${pkgdir}"/usr/lib/systemd/system/
install -Dm644 ${pkgname}.tmpfiles "${pkgdir}"/usr/lib/tmpfiles.d/${pkgname}.conf
install -Dm644 ${pkgname}.sysusers "${pkgdir}"/usr/lib/sysusers.d/${pkgname}.conf
install -Dm644 ${pkgname}.nginx "${pkgdir}"/etc/nginx/sites-enabled/${pkgname}.conf

View file

@ -4,12 +4,12 @@ Requires=nummi.socket
After=network.target
[Service]
Type=notify
Type=simple
User=nummi
Group=nummi
RuntimeDirectory=nummi
WorkingDirectory=/usr/share/webapps/nummi
ExecStart=/usr/bin/uvicorn nummi.asgi:application
ExecStart=/usr/bin/uvicorn nummi.asgi:application -uds /run/nummi/nummi.socket
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=mixed
TimeoutStopSec=5

View file

@ -1,9 +0,0 @@
[Unit]
Description=Nummi socket
[Socket]
ListenStream=/run/nummi.socket
SocketUser=http
[Install]
WantedBy=sockets.target