From 11e99db666dd46173bcab5fbb0ae0c71567240be Mon Sep 17 00:00:00 2001 From: AsamK Date: Sat, 25 Feb 2017 18:22:08 +0100 Subject: [PATCH] Created DBus service (markdown) --- DBus-service.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 DBus-service.md diff --git a/DBus-service.md b/DBus-service.md new file mode 100644 index 0000000..96d5d2a --- /dev/null +++ b/DBus-service.md @@ -0,0 +1,31 @@ +signal-cli can run in daemon mode and provides an experimental dbus interface. +For dbus support you need jni/unix-java.so installed on your system (Debian: libunixsocket-java ArchLinux: libmatthew-unix-java (AUR)). + +* Run in daemon mode (dbus session bus) + + signal-cli -u USERNAME daemon + +* Send a message via dbus + + signal-cli --dbus send -m "Message" [RECIPIENT [RECIPIENT ...]] [-a [ATTACHMENT [ATTACHMENT ...]]] + +### System bus + +To run on the system bus you need to take some additional steps. +It’s advisable to run signal-cli as a separate unix user, the following steps assume you created a user named *signal-cli*. +These steps, executed as root, should work on all distributions using systemd. + +Mind the fact that signal.service executes the signal-cli with "--config /var/lib/signal-cli". +If you registered with user signal-cli, remove the config option. + +```bash +cp data/org.asamk.Signal.conf /etc/dbus-1/system.d/ +cp data/org.asamk.Signal.service /usr/share/dbus-1/system-services/ +cp data/signal.service /etc/systemd/system/ +sed -i -e "s|%dir%||" -e "s|%number%||" /etc/systemd/system/signal.service +systemctl daemon-reload +systemctl enable signal.service +systemctl reload dbus.service +``` + +Make sure to use "--dbus-system" with the send command, the service will be autostarted by dbus the first time it is requested. \ No newline at end of file