Created DBus service (markdown)

AsamK 2017-02-25 18:22:08 +01:00
parent d1f170d6d5
commit 11e99db666

31
DBus-service.md Normal file

@ -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.
Its 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%|<INSERT_INSTALL_PATH>|" -e "s|%number%|<INSERT_YOUR_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.