From 67f145a99286ccc12b53968370b8397078f72ecb Mon Sep 17 00:00:00 2001 From: "Edgar P. Burkhart" Date: Sat, 21 May 2022 16:07:12 +0200 Subject: [PATCH] Make uvicorn work with socket --- PKGBUILD | 2 -- nummi.service | 4 ++-- nummi.socket | 9 --------- 3 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 nummi.socket diff --git a/PKGBUILD b/PKGBUILD index d21c7b4..012febd 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -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 diff --git a/nummi.service b/nummi.service index 57a7db3..19ad451 100644 --- a/nummi.service +++ b/nummi.service @@ -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 diff --git a/nummi.socket b/nummi.socket deleted file mode 100644 index 23000f1..0000000 --- a/nummi.socket +++ /dev/null @@ -1,9 +0,0 @@ -[Unit] -Description=Nummi socket - -[Socket] -ListenStream=/run/nummi.socket -SocketUser=http - -[Install] -WantedBy=sockets.target