Skip to content

Socket activation not working #12024

Open

Description

@pasqui23

LocalAI version:
commit 8321234

Environment, CPU architecture, OS, and Version:
Linux flatwoody 7.2.2 #1-NixOS SMP PREEMPT_DYNAMIC Fri Aug 28 06:25:22 UTC 2026 x86_64 GNU/Linux

Describe the bug
Socket activation does not work , when I try to connect to the port it hangs indefinetly while the logs report it running

To Reproduce

; sc cat localai
# /etc/systemd/system/localai.service -> /nix/store/ymx5w27nhwdcmfpxpyvhdql98x74ah7p-unit-localai.service/localai.service
[Unit]

[Service]
Environment="DEBUG=true"
Environment="HSA_ENABLE_SDMA=0"
Environment="HSA_OVERRIDE_GFX_VERSION=11.5.1"
Environment="HSA_XNACK=1"
Environment="LOCALAI_WATCHDOG_IDLE=true"
Environment="LOCALAI_WATCHDOG_IDLE_TIMEOUT=1m"
Environment="LOCALE_ARCHIVE=/nix/store/l45fk7x6bk1qdjb1sy1xnynmhdf9g100-glibc-locales-2.42-84/lib/locale/locale-archive"
Environment="PATH=/nix/store/3qgy8q2j64v2m9jy3a5jmssacbblhd4r-coreutils-9.11/bin:/nix/store/i4kjidyvl8ciwbcwm75g75sriq3knav0-findutils-4.11.0/bin:/nix/store/yhr4ps9rdmb55pgqaq246vlh7xfac1dx-gnugrep-3.12/bin:/nix/store/4nylac9gazdpsid79qyk0jpqm312b2jx-gnused-4.10/bin:/nix/store/sm8d6jpilwdy3bw3yq2lv8rr8jld26pb-systemd-261.2/bin:/nix/store/3qgy8q2j64v2m9jy3a5jmssacbblhd4r-coreutils-9.11/sbin:/nix/store/i4kjidyvl8ciwbcwm75g75sriq3knav0-findutils-4.11.0/sbin:/nix/store/yhr4ps9rdmb55pgqaq246vlh7xfac1dx-gnugrep-3.12/sbin:/nix/store/4nylac9gazdpsid79qyk0jpqm312b2jx-gnused-4.10/sbin:/nix/store/sm8d6jpilwdy3bw3yq2lv8rr8jld26pb-systemd-261.2/sbin"
Environment="ROCBLAS_USE_HIPBLASLT=1"
Environment="TZDIR=/nix/store/p0ff33dca0fbkskqwrl3spvxcn5974h0-tzdata-2026c/share/zoneinfo"
CPUWeight=50
DynamicUser=true
ExecStart=/nix/store/7vnw3p4fq874mmjvmzh5hia198wcviwm-localai/bin/localai run
Group=render
OOMScoreAdjust=1000
Restart=no
StateDirectory=localai
SupplementaryGroups=video
WorkingDirectory=/var/lib/localai

# /nix/store/46gqwy3vik6iwppyzzvncy85hs5rigd6-system-units/service.d/mail.conf -> /nix/store/p2av62fdi2q4ys5a9xrr6f2ykf7fayfn-mail.conf/lib/systemd/system/service.d/mail.conf
[Unit]
OnFailure=unit-status-mail@%n.service

; sc cat localai.socket
# /etc/systemd/system/localai.socket -> /nix/store/iwlnvm6zfhmaa1aa258iq56jbavzb1jc-unit-localai.socket/localai.socket
[Unit]

[Socket]

ListenStream=11434


[Install]
WantedBy=sockets.target

Expected behavior
It answers connections

Logs

Additional context

Activity

  1. localai-org-maint-bot commented on Sep 14, 2026

    @localai-org-maint-bot
    Collaborator

    Socket activation support is already present in the reported commit 8321234 (merged in #11169). core/cli/run.go reads the inherited listener and logs Using systemd socket activation listener before the ordinary startup message. Current master uses the same activation helper, so I have not identified a missing implementation to patch yet.

    Could you attach the startup journal from this attempt, including the address in LocalAI is started and running, and confirm whether the activation-listener message appears? Also useful: systemctl show localai.service -p MainPID -p ExecMainPID, ss -ltnp for ports 11434 and 8080, and the result of curl -v --max-time 10 http://127.0.0.1:11434/readyz.

    If the listener message is absent and the startup address is 8080, that would point toward the activation descriptors/PID not reaching the process; if it reports 11434, we need to trace the serving/startup path instead. The supplied unit alone does not distinguish those cases. I have not reproduced the hang on NixOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions