Repository navigation
Replies: 1 comment
|
Not a big issue: I'd add a |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Ubuntu 24.04 server.
when I call signal-cli in a cronjob on my server it waits for input after sending the command. As a result my cronjob is not finishing. So I want to run it as a headless service, which would solve the problem.
I followed the documentation at https://github.com/AsamK/signal-cli/wiki/DBus-service#send-using-dbus-send. With that I could not get it to work.
so I had to hack it a little and here is my working setup:
first of all I created a user signal-cli and with that user I went to the link device routine
sudo useradd -r -m signal-clisudo -u signal-cli signal-cli linkwith the sgnl:// link i did
qrencode -t UTF8 "sgnl://linkdevice?..."this generates the QR-code that you use to link your user to your account in signal on you phonethis will generate your data directory in
/home/signal-cli/.local/share.signal-cli/usr/share/dbus-1/system-services/org.asamk.Signal.service
[D-BUS Service]
Name=org.asamk.Signal
Exec=/bin/false
SystemdService=signal-cli.service
Note that I changed the SystemdService from dbus-org.asamk.Signal.service to signal-cli.service
/etc/systemd/system/signal-cli.service
[Unit]
Description=Signal-cli DBus daemon
#Description=Send secure messages to Signal clients
#Requires=dbus.socket
#After=dbus.socket
#Wants=network-online.target
#After=network-online.target
[Service]
#Type=dbus
#Environment="SIGNAL_CLI_OPTS=-Xms2m"
ExecStart=/usr/local/bin/signal-cli daemon --dbus-system
User=signal-cli
#BusName=org.asamk.Signal
#[Install]
#Alias=dbus-org.asamk.Signal.service
as you see I commented most of it since it is not started manually. DBus will activate it. it will generate some warning when dbus is reloaded but that is expected.
/etc/dbus-1/system.d/org.asamk.Signal.conf
<!DOCTYPE busconfig PUBLIC"-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN""http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"><busconfig><!-- Allow the daemon user to own the service --><policy user="signal-cli"><allow own="org.asamk.Signal"/></policy><!-- Allow any local user (including root, cron, scripts) to send --><policy context="default"><allow send_destination="org.asamk.Signal"/><allow send_interface="org.asamk.Signal"/><allow send_interface="org.asamk.SignalControl"/></policy></busconfigReload systemd and DBus
systemctl disable --now signal-cliTHIS IS IMPORTANT!! if you have tried running signal-cli as a service beforesudo systemctl daemon-reloadsudo systemctl reload dbus//with reloading dbus it now starts up signal-cli as a servicethis will generate the following warning but it is expected and okay
Test DBus activation
signal-cli --dbus-system send -m "Hello from DBus system activation" +31<phonenumber>test if signal-cli is activated
systemctl status signal-clisee all identities
signal-cli --dbus-system listIdentitiesSummary
All reactions