Plain bot mode under systemd has no controlling terminal, so the CLI accepts the WebSocket socket but never emits receivedContactRequest/newChatItems — contact requests hung unaccepted. Wrap ExecStart in script(1) to allocate a PTY; the events then flow and the gateway auto-accepts. Add util-linux to bootstrap prereqs.
23 lines
904 B
Plaintext
23 lines
904 B
Plaintext
[Unit]
|
|
Description=SemIf agent SimpleX Chat bot daemon
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
# Bot mode: a local WebSocket chat server with a bot user. Do NOT add
|
|
# --headless here — in SimpleX Chat v7 --headless means "chat relay" and
|
|
# requires --relay, which yields a relay address, not a user contact address.
|
|
# The CLI only pumps WebSocket events (receivedContactRequest, newChatItems)
|
|
# when it has a controlling terminal, so `script` allocates a PTY; without it
|
|
# systemd's TTY-less process receives no events and contact requests hang.
|
|
ExecStart=/usr/bin/script -q -e -c "@REPO@/.runtime/bin/simplex-chat -p @PORT@ -d @REPO@/.runtime/simplex/simplex_v1 -k '' --create-bot-display-name '@DISPLAY_NAME@'" /dev/null
|
|
Restart=always
|
|
RestartSec=10
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
SyslogIdentifier=semif-simplex
|
|
|
|
[Install]
|
|
WantedBy=default.target
|