Skip to content

Activating a systemd service #1142

Closed Answered by tim-tx
tim-tx asked this question in Q&A
Discussion options

You must be logged in to vote

This is what I settled on. Some help provided on stack exchange.

myservice.socket:

[Unit]
Description=myservice socket

[Socket]
ListenStream=127.0.0.1:9900
Accept=yes

[Install]
WantedBy=sockets.target

[email protected]:

[Unit]
Description=myservice

[Service]
ExecStartPre=/bin/sh -c 'echo -e "HTTP/1.1 200 OK\nContent-Type: text/plain; charset=utf-8\nConnection: close\nContent-length: 3\n\nOK\n"'
ExecStart=<do something>
StandardInput=socket
StandardOutput=socket
$ apprise -vv -t 'foo' -b 'bar' 'json://localhost:9900'
2024-06-14 12:52:05,399 - INFO - Sent JSON POST notification.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tim-tx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant