summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Reichel <sre@ring0.de>2017-04-16 01:19:16 +0200
committerSebastian Reichel <sre@ring0.de>2017-04-18 22:08:34 +0200
commita211b960a7590910b46c1d59acaeda5e87b5b522 (patch)
treeda94483c1d1719d71777477452d34092df91e215
parent2bee9e0eb0f46d41a381e3fc32ff98a192f9493a (diff)
downloadserial-barcode-scanner-a211b960a7590910b46c1d59acaeda5e87b5b522.tar.bz2
all: switch from session to system bus
-rw-r--r--dbus/Makefile4
-rw-r--r--dbus/config/Makefile15
-rw-r--r--dbus/config/io.mainframe.shopsystem.AudioPlayer.conf17
-rw-r--r--dbus/config/io.mainframe.shopsystem.Config.conf17
-rw-r--r--dbus/config/io.mainframe.shopsystem.Database.conf17
-rw-r--r--dbus/config/io.mainframe.shopsystem.InputDevice.conf17
-rw-r--r--dbus/config/io.mainframe.shopsystem.InvoicePDF.conf17
-rw-r--r--dbus/config/io.mainframe.shopsystem.Mail.conf17
-rw-r--r--dbus/config/io.mainframe.shopsystem.PGP.conf17
-rw-r--r--dbus/config/io.mainframe.shopsystem.ScannerSession.conf17
-rw-r--r--dbus/config/io.mainframe.shopsystem.SerialDevice.conf17
-rw-r--r--dbus/config/io.mainframe.shopsystem.StockPDF.conf17
-rw-r--r--dbus/io.mainframe.shopsystem.AudioPlayer.service.in1
-rw-r--r--dbus/io.mainframe.shopsystem.Config.service.in1
-rw-r--r--dbus/io.mainframe.shopsystem.Database.service.in1
-rw-r--r--dbus/io.mainframe.shopsystem.InputDevice.service.in4
-rw-r--r--dbus/io.mainframe.shopsystem.InvoicePDF.service.in1
-rw-r--r--dbus/io.mainframe.shopsystem.Mail.service.in1
-rw-r--r--dbus/io.mainframe.shopsystem.PGP.service.in1
-rw-r--r--dbus/io.mainframe.shopsystem.ScannerSession.service.in1
-rw-r--r--dbus/io.mainframe.shopsystem.SerialDevice.service.in1
-rw-r--r--dbus/io.mainframe.shopsystem.StockPDF.service.in1
-rw-r--r--src/audio/main.vala4
-rw-r--r--src/backup/main.vala6
-rw-r--r--src/cli/main.vala2
-rw-r--r--src/config/main.vala2
-rw-r--r--src/curses-ui/main.vala4
-rw-r--r--src/database/main.vala4
-rw-r--r--src/input-device/main.vala4
-rw-r--r--src/invoice/invoice.vala16
-rw-r--r--src/mail/mailer.vala2
-rw-r--r--src/mail/main.vala2
-rw-r--r--src/pdf-invoice/main.vala4
-rw-r--r--src/pdf-invoice/test.vala2
-rw-r--r--src/pdf-stock/main.vala2
-rw-r--r--src/pdf-stock/pdf-stock.vala2
-rw-r--r--src/pdf-stock/test.vala2
-rw-r--r--src/pgp/main.vala4
-rw-r--r--src/scanner-session/main.vala2
-rw-r--r--src/scanner-session/scannersession.vala8
-rw-r--r--src/serial-device/main.vala4
-rw-r--r--src/web/main.vala6
42 files changed, 242 insertions, 42 deletions
diff --git a/dbus/Makefile b/dbus/Makefile
index a18cd2e..31d22b3 100644
--- a/dbus/Makefile
+++ b/dbus/Makefile
@@ -1,6 +1,6 @@
SERVICEFILESIN=$(wildcard *.service.in)
SERVICEFILES=$(basename ${SERVICEFILESIN})
-INSTALLPATH=/usr/share/dbus-1/services/
+INSTALLPATH=/usr/share/dbus-1/system-services/
BINARYPATH=$(realpath $(dir $(lastword $(MAKEFILE_LIST)))/../src)
ESCAPEDBINARYPATH=
@@ -14,10 +14,12 @@ install: ${SERVICEFILES}
@echo Installing DBus service files into ${INSTALLPATH}...
@mkdir -p ${INSTALLPATH}
@$(foreach file,${SERVICEFILES},install -m644 ${file} ${INSTALLPATH}/${file};)
+ @cd config && make install
uninstall:
@echo Remove DBus service files from ${INSTALLPATH}...
@$(foreach file,${SERVICEFILES},rm -f ${INSTALLPATH}/${file};)
+ @cd config && make uninstall
clean:
@rm -f ${SERVICEFILES}
diff --git a/dbus/config/Makefile b/dbus/config/Makefile
new file mode 100644
index 0000000..99083ab
--- /dev/null
+++ b/dbus/config/Makefile
@@ -0,0 +1,15 @@
+CONFIGFILES=$(wildcard *.conf)
+INSTALLPATH=/etc/dbus-1/system.d
+
+all:
+
+install: ${CONFIGFILES}
+ @echo Installing DBus config files into ${INSTALLPATH}...
+ @mkdir -p ${INSTALLPATH}
+ @$(foreach file,${CONFIGFILES},install -m644 ${file} ${INSTALLPATH}/${file};)
+
+uninstall:
+ @echo Remove DBus config files from ${INSTALLPATH}...
+ @$(foreach file,${CONFIGFILES},rm -f ${INSTALLPATH}/${file};)
+
+.PHONY: all install uninstall
diff --git a/dbus/config/io.mainframe.shopsystem.AudioPlayer.conf b/dbus/config/io.mainframe.shopsystem.AudioPlayer.conf
new file mode 100644
index 0000000..b8c11c0
--- /dev/null
+++ b/dbus/config/io.mainframe.shopsystem.AudioPlayer.conf
@@ -0,0 +1,17 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <!-- ../system.conf have denied everything, so we just punch some holes -->
+
+ <policy user="root">
+ <allow own="io.mainframe.shopsystem.AudioPlayer"/>
+ <allow send_destination="io.mainframe.shopsystem.AudioPlayer"/>
+ </policy>
+
+ <policy user="shop">
+ <allow own="io.mainframe.shopsystem.AudioPlayer"/>
+ <allow send_destination="io.mainframe.shopsystem.AudioPlayer"/>
+ </policy>
+
+</busconfig>
diff --git a/dbus/config/io.mainframe.shopsystem.Config.conf b/dbus/config/io.mainframe.shopsystem.Config.conf
new file mode 100644
index 0000000..41e5cb6
--- /dev/null
+++ b/dbus/config/io.mainframe.shopsystem.Config.conf
@@ -0,0 +1,17 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <!-- ../system.conf have denied everything, so we just punch some holes -->
+
+ <policy user="root">
+ <allow own="io.mainframe.shopsystem.Config"/>
+ <allow send_destination="io.mainframe.shopsystem.Config"/>
+ </policy>
+
+ <policy user="shop">
+ <allow own="io.mainframe.shopsystem.Config"/>
+ <allow send_destination="io.mainframe.shopsystem.Config"/>
+ </policy>
+
+</busconfig>
diff --git a/dbus/config/io.mainframe.shopsystem.Database.conf b/dbus/config/io.mainframe.shopsystem.Database.conf
new file mode 100644
index 0000000..61bde19
--- /dev/null
+++ b/dbus/config/io.mainframe.shopsystem.Database.conf
@@ -0,0 +1,17 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <!-- ../system.conf have denied everything, so we just punch some holes -->
+
+ <policy user="root">
+ <allow own="io.mainframe.shopsystem.Database"/>
+ <allow send_destination="io.mainframe.shopsystem.Database"/>
+ </policy>
+
+ <policy user="shop">
+ <allow own="io.mainframe.shopsystem.Database"/>
+ <allow send_destination="io.mainframe.shopsystem.Database"/>
+ </policy>
+
+</busconfig>
diff --git a/dbus/config/io.mainframe.shopsystem.InputDevice.conf b/dbus/config/io.mainframe.shopsystem.InputDevice.conf
new file mode 100644
index 0000000..15ad43d
--- /dev/null
+++ b/dbus/config/io.mainframe.shopsystem.InputDevice.conf
@@ -0,0 +1,17 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <!-- ../system.conf have denied everything, so we just punch some holes -->
+
+ <policy user="root">
+ <allow own="io.mainframe.shopsystem.InputDevice"/>
+ <allow send_destination="io.mainframe.shopsystem.InputDevice"/>
+ </policy>
+
+ <policy user="shop">
+ <allow own="io.mainframe.shopsystem.InputDevice"/>
+ <allow send_destination="io.mainframe.shopsystem.InputDevice"/>
+ </policy>
+
+</busconfig>
diff --git a/dbus/config/io.mainframe.shopsystem.InvoicePDF.conf b/dbus/config/io.mainframe.shopsystem.InvoicePDF.conf
new file mode 100644
index 0000000..6ec4610
--- /dev/null
+++ b/dbus/config/io.mainframe.shopsystem.InvoicePDF.conf
@@ -0,0 +1,17 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <!-- ../system.conf have denied everything, so we just punch some holes -->
+
+ <policy user="root">
+ <allow own="io.mainframe.shopsystem.InvoicePDF"/>
+ <allow send_destination="io.mainframe.shopsystem.InvoicePDF"/>
+ </policy>
+
+ <policy user="shop">
+ <allow own="io.mainframe.shopsystem.InvoicePDF"/>
+ <allow send_destination="io.mainframe.shopsystem.InvoicePDF"/>
+ </policy>
+
+</busconfig>
diff --git a/dbus/config/io.mainframe.shopsystem.Mail.conf b/dbus/config/io.mainframe.shopsystem.Mail.conf
new file mode 100644
index 0000000..e48e264
--- /dev/null
+++ b/dbus/config/io.mainframe.shopsystem.Mail.conf
@@ -0,0 +1,17 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <!-- ../system.conf have denied everything, so we just punch some holes -->
+
+ <policy user="root">
+ <allow own="io.mainframe.shopsystem.Mail"/>
+ <allow send_destination="io.mainframe.shopsystem.Mail"/>
+ </policy>
+
+ <policy user="shop">
+ <allow own="io.mainframe.shopsystem.Mail"/>
+ <allow send_destination="io.mainframe.shopsystem.Mail"/>
+ </policy>
+
+</busconfig>
diff --git a/dbus/config/io.mainframe.shopsystem.PGP.conf b/dbus/config/io.mainframe.shopsystem.PGP.conf
new file mode 100644
index 0000000..ab2f8b2
--- /dev/null
+++ b/dbus/config/io.mainframe.shopsystem.PGP.conf
@@ -0,0 +1,17 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <!-- ../system.conf have denied everything, so we just punch some holes -->
+
+ <policy user="root">
+ <allow own="io.mainframe.shopsystem.PGP"/>
+ <allow send_destination="io.mainframe.shopsystem.PGP"/>
+ </policy>
+
+ <policy user="shop">
+ <allow own="io.mainframe.shopsystem.PGP"/>
+ <allow send_destination="io.mainframe.shopsystem.PGP"/>
+ </policy>
+
+</busconfig>
diff --git a/dbus/config/io.mainframe.shopsystem.ScannerSession.conf b/dbus/config/io.mainframe.shopsystem.ScannerSession.conf
new file mode 100644
index 0000000..49c4eb1
--- /dev/null
+++ b/dbus/config/io.mainframe.shopsystem.ScannerSession.conf
@@ -0,0 +1,17 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <!-- ../system.conf have denied everything, so we just punch some holes -->
+
+ <policy user="root">
+ <allow own="io.mainframe.shopsystem.ScannerSession"/>
+ <allow send_destination="io.mainframe.shopsystem.ScannerSession"/>
+ </policy>
+
+ <policy user="shop">
+ <allow own="io.mainframe.shopsystem.ScannerSession"/>
+ <allow send_destination="io.mainframe.shopsystem.ScannerSession"/>
+ </policy>
+
+</busconfig>
diff --git a/dbus/config/io.mainframe.shopsystem.SerialDevice.conf b/dbus/config/io.mainframe.shopsystem.SerialDevice.conf
new file mode 100644
index 0000000..d849ef4
--- /dev/null
+++ b/dbus/config/io.mainframe.shopsystem.SerialDevice.conf
@@ -0,0 +1,17 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <!-- ../system.conf have denied everything, so we just punch some holes -->
+
+ <policy user="root">
+ <allow own="io.mainframe.shopsystem.SerialDevice"/>
+ <allow send_destination="io.mainframe.shopsystem.SerialDevice"/>
+ </policy>
+
+ <policy user="shop">
+ <allow own="io.mainframe.shopsystem.SerialDevice"/>
+ <allow send_destination="io.mainframe.shopsystem.SerialDevice"/>
+ </policy>
+
+</busconfig>
diff --git a/dbus/config/io.mainframe.shopsystem.StockPDF.conf b/dbus/config/io.mainframe.shopsystem.StockPDF.conf
new file mode 100644
index 0000000..8cf0fdc
--- /dev/null
+++ b/dbus/config/io.mainframe.shopsystem.StockPDF.conf
@@ -0,0 +1,17 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+
+ <!-- ../system.conf have denied everything, so we just punch some holes -->
+
+ <policy user="root">
+ <allow own="io.mainframe.shopsystem.StockPDF"/>
+ <allow send_destination="io.mainframe.shopsystem.StockPDF"/>
+ </policy>
+
+ <policy user="shop">
+ <allow own="io.mainframe.shopsystem.StockPDF"/>
+ <allow send_destination="io.mainframe.shopsystem.StockPDF"/>
+ </policy>
+
+</busconfig>
diff --git a/dbus/io.mainframe.shopsystem.AudioPlayer.service.in b/dbus/io.mainframe.shopsystem.AudioPlayer.service.in
index 3629cae..b6a0c83 100644
--- a/dbus/io.mainframe.shopsystem.AudioPlayer.service.in
+++ b/dbus/io.mainframe.shopsystem.AudioPlayer.service.in
@@ -1,3 +1,4 @@
[D-BUS Service]
Name=io.mainframe.shopsystem.AudioPlayer
Exec=${PATH}/audio/audio
+User=shop
diff --git a/dbus/io.mainframe.shopsystem.Config.service.in b/dbus/io.mainframe.shopsystem.Config.service.in
index b2cdb7e..8203523 100644
--- a/dbus/io.mainframe.shopsystem.Config.service.in
+++ b/dbus/io.mainframe.shopsystem.Config.service.in
@@ -1,3 +1,4 @@
[D-BUS Service]
Name=io.mainframe.shopsystem.Config
Exec=${PATH}/config/config
+User=shop
diff --git a/dbus/io.mainframe.shopsystem.Database.service.in b/dbus/io.mainframe.shopsystem.Database.service.in
index 02674ed..1461477 100644
--- a/dbus/io.mainframe.shopsystem.Database.service.in
+++ b/dbus/io.mainframe.shopsystem.Database.service.in
@@ -1,3 +1,4 @@
[D-BUS Service]
Name=io.mainframe.shopsystem.Database
Exec=${PATH}/database/database
+User=shop
diff --git a/dbus/io.mainframe.shopsystem.InputDevice.service.in b/dbus/io.mainframe.shopsystem.InputDevice.service.in
new file mode 100644
index 0000000..b761d7d
--- /dev/null
+++ b/dbus/io.mainframe.shopsystem.InputDevice.service.in
@@ -0,0 +1,4 @@
+[D-BUS Service]
+Name=io.mainframe.shopsystem.InputDevice
+Exec=${PATH}/input-device/input-device
+User=shop
diff --git a/dbus/io.mainframe.shopsystem.InvoicePDF.service.in b/dbus/io.mainframe.shopsystem.InvoicePDF.service.in
index a41a69f..9da0a00 100644
--- a/dbus/io.mainframe.shopsystem.InvoicePDF.service.in
+++ b/dbus/io.mainframe.shopsystem.InvoicePDF.service.in
@@ -1,3 +1,4 @@
[D-BUS Service]
Name=io.mainframe.shopsystem.InvoicePDF
Exec=${PATH}/pdf-invoice/pdf-invoice
+User=shop
diff --git a/dbus/io.mainframe.shopsystem.Mail.service.in b/dbus/io.mainframe.shopsystem.Mail.service.in
index 6788453..1f0d2d1 100644
--- a/dbus/io.mainframe.shopsystem.Mail.service.in
+++ b/dbus/io.mainframe.shopsystem.Mail.service.in
@@ -1,3 +1,4 @@
[D-BUS Service]
Name=io.mainframe.shopsystem.Mail
Exec=${PATH}/mail/mailer
+User=shop
diff --git a/dbus/io.mainframe.shopsystem.PGP.service.in b/dbus/io.mainframe.shopsystem.PGP.service.in
index 29bca05..3c5dc88 100644
--- a/dbus/io.mainframe.shopsystem.PGP.service.in
+++ b/dbus/io.mainframe.shopsystem.PGP.service.in
@@ -1,3 +1,4 @@
[D-BUS Service]
Name=io.mainframe.shopsystem.PGP
Exec=${PATH}/pgp/pgp
+User=shop
diff --git a/dbus/io.mainframe.shopsystem.ScannerSession.service.in b/dbus/io.mainframe.shopsystem.ScannerSession.service.in
index 97e7966..974d33c 100644
--- a/dbus/io.mainframe.shopsystem.ScannerSession.service.in
+++ b/dbus/io.mainframe.shopsystem.ScannerSession.service.in
@@ -1,3 +1,4 @@
[D-BUS Service]
Name=io.mainframe.shopsystem.ScannerSession
Exec=${PATH}/scanner-session/scanner-session
+User=shop
diff --git a/dbus/io.mainframe.shopsystem.SerialDevice.service.in b/dbus/io.mainframe.shopsystem.SerialDevice.service.in
index 4574f0b..3cac817 100644
--- a/dbus/io.mainframe.shopsystem.SerialDevice.service.in
+++ b/dbus/io.mainframe.shopsystem.SerialDevice.service.in
@@ -1,3 +1,4 @@
[D-BUS Service]
Name=io.mainframe.shopsystem.SerialDevice
Exec=${PATH}/serial-device/serial-device
+User=shop
diff --git a/dbus/io.mainframe.shopsystem.StockPDF.service.in b/dbus/io.mainframe.shopsystem.StockPDF.service.in
index a0d5ebd..06b2953 100644
--- a/dbus/io.mainframe.shopsystem.StockPDF.service.in
+++ b/dbus/io.mainframe.shopsystem.StockPDF.service.in
@@ -1,3 +1,4 @@
[D-BUS Service]
Name=io.mainframe.shopsystem.StockPDF
Exec=${PATH}/pdf-stock/pdf-stock
+User=shop
diff --git a/src/audio/main.vala b/src/audio/main.vala
index ac80c75..ac64f52 100644
--- a/src/audio/main.vala
+++ b/src/audio/main.vala
@@ -19,7 +19,7 @@ public static int main(string[] args) {
Gst.init(ref args);
Bus.own_name(
- BusType.SESSION,
+ BusType.SYSTEM,
"io.mainframe.shopsystem.AudioPlayer",
BusNameOwnerFlags.NONE,
on_bus_aquired,
@@ -27,7 +27,7 @@ public static int main(string[] args) {
() => stderr.printf("Could not aquire name\n"));
try {
- Config cfg = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
+ Config cfg = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
var path = cfg.get_string("AUDIO", "path");
player = new AudioPlayerImplementation(path);
} catch(IOError e) {
diff --git a/src/backup/main.vala b/src/backup/main.vala
index 00ff623..4aed71f 100644
--- a/src/backup/main.vala
+++ b/src/backup/main.vala
@@ -15,12 +15,12 @@
public static int main(string[] args) {
try {
- Mailer mailer = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Mail", "/io/mainframe/shopsystem/mailer");
- Config cfg = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
+ Mailer mailer = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Mail", "/io/mainframe/shopsystem/mailer");
+ Config cfg = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
string dbfile = cfg.get_string("DATABASE", "file");
string mailpath = mailer.create_mail();
- Mail mail = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Mail", mailpath);
+ Mail mail = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Mail", mailpath);
uint8[] dbdata;
FileUtils.get_data(dbfile, out dbdata);
diff --git a/src/cli/main.vala b/src/cli/main.vala
index a85cbc7..a3208dd 100644
--- a/src/cli/main.vala
+++ b/src/cli/main.vala
@@ -26,7 +26,7 @@ public static int main(string[] args) {
cli = new CliImpl();
Bus.own_name(
- BusType.SESSION,
+ BusType.SYSTEM,
"io.mainframe.shopsystem.Cli",
BusNameOwnerFlags.NONE,
on_bus_aquired,
diff --git a/src/config/main.vala b/src/config/main.vala
index 566730b..5ae15be 100644
--- a/src/config/main.vala
+++ b/src/config/main.vala
@@ -21,7 +21,7 @@ public static int main(string[] args) {
cfg = new Cfg(binarylocation + "/../../ktt-shopsystem.cfg");
Bus.own_name(
- BusType.SESSION,
+ BusType.SYSTEM,
"io.mainframe.shopsystem.Config",
BusNameOwnerFlags.NONE,
on_bus_aquired,
diff --git a/src/curses-ui/main.vala b/src/curses-ui/main.vala
index 993848c..da822a9 100644
--- a/src/curses-ui/main.vala
+++ b/src/curses-ui/main.vala
@@ -47,8 +47,8 @@ public static int main(string[] args) {
Unix.signal_add(Posix.SIGINT, handle_signals);
try {
- audio = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.AudioPlayer", "/io/mainframe/shopsystem/audio");
- scanner = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.ScannerSession", "/io/mainframe/shopsystem/scanner_session");
+ audio = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.AudioPlayer", "/io/mainframe/shopsystem/audio");
+ scanner = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.ScannerSession", "/io/mainframe/shopsystem/scanner_session");
} catch(IOError e) {
error("IOError: %s\n", e.message);
}
diff --git a/src/database/main.vala b/src/database/main.vala
index 1de94b8..72e3813 100644
--- a/src/database/main.vala
+++ b/src/database/main.vala
@@ -21,7 +21,7 @@ DataBase db;
public static int main(string[] args) {
try {
- Config cfg = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
+ Config cfg = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
var dbfile = cfg.get_string("DATABASE", "file");
db = new DataBase(dbfile);
} catch(IOError e) {
@@ -31,7 +31,7 @@ public static int main(string[] args) {
}
Bus.own_name(
- BusType.SESSION,
+ BusType.SYSTEM,
"io.mainframe.shopsystem.Database",
BusNameOwnerFlags.NONE,
on_bus_aquired,
diff --git a/src/input-device/main.vala b/src/input-device/main.vala
index e2dee27..8578033 100644
--- a/src/input-device/main.vala
+++ b/src/input-device/main.vala
@@ -17,7 +17,7 @@ Device dev;
public static int main(string[] args) {
try {
- Config cfg = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
+ Config cfg = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
dev = new Device(cfg.get_string("INPUT", "device"));
} catch(IOError e) {
error("IOError: %s\n", e.message);
@@ -26,7 +26,7 @@ public static int main(string[] args) {
}
Bus.own_name(
- BusType.SESSION,
+ BusType.SYSTEM,
"io.mainframe.shopsystem.InputDevice",
BusNameOwnerFlags.NONE,
on_bus_aquired,
diff --git a/src/invoice/invoice.vala b/src/invoice/invoice.vala
index 9f501d7..443b4c2 100644
--- a/src/invoice/invoice.vala
+++ b/src/invoice/invoice.vala
@@ -34,10 +34,10 @@ public class InvoiceImplementation {
string datadir;
public InvoiceImplementation() throws IOError, KeyFileError {
- mailer = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Mail", "/io/mainframe/shopsystem/mailer");
- db = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Database", "/io/mainframe/shopsystem/database");
- pdf = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.InvoicePDF", "/io/mainframe/shopsystem/invoicepdf");
- Config cfg = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
+ mailer = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Mail", "/io/mainframe/shopsystem/mailer");
+ db = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Database", "/io/mainframe/shopsystem/database");
+ pdf = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.InvoicePDF", "/io/mainframe/shopsystem/invoicepdf");
+ Config cfg = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
datadir = cfg.get_string("INVOICE", "datadir");
}
@@ -66,7 +66,7 @@ public class InvoiceImplementation {
var users = db.get_users_with_sales(ts.from, ts.to);
string treasurer_path = mailer.create_mail();
- Mail treasurer_mail = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Mail", treasurer_path);
+ Mail treasurer_mail = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Mail", treasurer_path);
treasurer_mail.from = {"KtT Shopsystem", "shop@kreativitaet-trifft-technik.de"};
treasurer_mail.subject = mailtitle;
treasurer_mail.add_recipient({"Schatzmeister", "shop-einzug@kreativitaet-trifft-technik.de"}, RecipientType.TO);
@@ -81,7 +81,7 @@ public class InvoiceImplementation {
if(userid == user) {
var invoicedata = generate_invoice(temporary, timestamp, userid, invoiceid);
string mail_path = mailer.create_mail();
- Mail mail = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Mail", mail_path);
+ Mail mail = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Mail", mail_path);
mail.from = {"KtT Shopsystem", "shop@kreativitaet-trifft-technik.de"};
mail.subject = mailtitle;
mail.add_recipient({@"$(userdata.firstname) $(userdata.lastname)", userdata.email}, RecipientType.TO);
@@ -134,7 +134,7 @@ public class InvoiceImplementation {
var users = db.get_users_with_sales(ts.from, ts.to);
string treasurer_path = mailer.create_mail();
- Mail treasurer_mail = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Mail", treasurer_path);
+ Mail treasurer_mail = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Mail", treasurer_path);
treasurer_mail.from = {"KtT Shopsystem", "shop@kreativitaet-trifft-technik.de"};
treasurer_mail.subject = mailtitle;
treasurer_mail.add_recipient({"Schatzmeister", "shop-einzug@kreativitaet-trifft-technik.de"}, RecipientType.TO);
@@ -148,7 +148,7 @@ public class InvoiceImplementation {
var total_sum = db.get_user_invoice_sum(userid, tst.from, tst.to);
string mail_path = mailer.create_mail();
- Mail mail = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Mail", mail_path);
+ Mail mail = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Mail", mail_path);
mail.from = {"KtT Shopsystem", "shop@kreativitaet-trifft-technik.de"};
mail.subject = mailtitle;
mail.add_recipient({@"$(userdata.firstname) $(userdata.lastname)", userdata.email}, RecipientType.TO);
diff --git a/src/mail/mailer.vala b/src/mail/mailer.vala
index 4888fe7..3ec9381 100644
--- a/src/mail/mailer.vala
+++ b/src/mail/mailer.vala
@@ -70,7 +70,7 @@ public class MailerImplementation {
Posix.signal(Posix.SIGPIPE, Posix.SIG_IGN);
/* get configuration */
- Config config = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
+ Config config = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
try {
var cfgserv = config.get_string("MAIL", "server");
var cfgport = config.get_integer("MAIL", "port");
diff --git a/src/mail/main.vala b/src/mail/main.vala
index 1aeb3eb..0c36f6b 100644
--- a/src/mail/main.vala
+++ b/src/mail/main.vala
@@ -24,7 +24,7 @@ public static int main(string[] args) {
}
Bus.own_name(
- BusType.SESSION,
+ BusType.SYSTEM,
"io.mainframe.shopsystem.Mail",
BusNameOwnerFlags.NONE,
on_mail_bus_aquired,
diff --git a/src/pdf-invoice/main.vala b/src/pdf-invoice/main.vala
index cbb73f2..3d8e298 100644
--- a/src/pdf-invoice/main.vala
+++ b/src/pdf-invoice/main.vala
@@ -17,7 +17,7 @@ private string datadir;
public static int main(string[] args) {
try {
- Config cfg = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
+ Config cfg = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
datadir = cfg.get_string("INVOICE", "datadir");
} catch(IOError e) {
error("IOError: %s\n", e.message);
@@ -26,7 +26,7 @@ public static int main(string[] args) {
}
Bus.own_name(
- BusType.SESSION,
+ BusType.SYSTEM,
"io.mainframe.shopsystem.InvoicePDF",
BusNameOwnerFlags.NONE,
on_bus_aquired,
diff --git a/src/pdf-invoice/test.vala b/src/pdf-invoice/test.vala
index 0ca02fd..e55f3a3 100644
--- a/src/pdf-invoice/test.vala
+++ b/src/pdf-invoice/test.vala
@@ -14,7 +14,7 @@
*/
public static int main(string args[]) {
- PDFInvoice invoice = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.InvoicePDF", "/io/mainframe/shopsystem/invoicepdf");
+ PDFInvoice invoice = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.InvoicePDF", "/io/mainframe/shopsystem/invoicepdf");
InvoiceRecipient r = {
"Max",
diff --git a/src/pdf-stock/main.vala b/src/pdf-stock/main.vala
index fee62af..49613f4 100644
--- a/src/pdf-stock/main.vala
+++ b/src/pdf-stock/main.vala
@@ -15,7 +15,7 @@
public static int main(string[] args) {
Bus.own_name(
- BusType.SESSION,
+ BusType.SYSTEM,
"io.mainframe.shopsystem.StockPDF",
BusNameOwnerFlags.NONE,
on_bus_aquired,
diff --git a/src/pdf-stock/pdf-stock.vala b/src/pdf-stock/pdf-stock.vala
index c1e9b6a..e971f78 100644
--- a/src/pdf-stock/pdf-stock.vala
+++ b/src/pdf-stock/pdf-stock.vala
@@ -169,7 +169,7 @@ public class StockPDF {
/* get stock */
try {
- Database db = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Database", "/io/mainframe/shopsystem/database");
+ Database db = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Database", "/io/mainframe/shopsystem/database");
stock = db.get_stock();
timestamp = new DateTime.now_local().to_unix();
} catch(IOError e) {
diff --git a/src/pdf-stock/test.vala b/src/pdf-stock/test.vala
index 9cd3a7e..cc3da4f 100644
--- a/src/pdf-stock/test.vala
+++ b/src/pdf-stock/test.vala
@@ -15,7 +15,7 @@
public static int main(string args[]) {
try {
- PDFStock stock = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.StockPDF", "/io/mainframe/shopsystem/stockpdf");
+ PDFStock stock = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.StockPDF", "/io/mainframe/shopsystem/stockpdf");
var pdfdata = stock.generate();
FileUtils.set_contents("test.pdf", (string) pdfdata, pdfdata.length);
} catch(IOError e) {
diff --git a/src/pgp/main.vala b/src/pgp/main.vala
index f95b6f7..c866c7b 100644
--- a/src/pgp/main.vala
+++ b/src/pgp/main.vala
@@ -22,7 +22,7 @@ Config cfg;
public static int main(string[] args) {
try {
- cfg = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
+ cfg = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
pgp = new PGPKeyArchive(cfg.get_string("PGP", "keyring"));
} catch(IOError e) {
error("IOError: %s\n", e.message);
@@ -32,7 +32,7 @@ public static int main(string[] args) {
Bus.own_name(
- BusType.SESSION,
+ BusType.SYSTEM,
"io.mainframe.shopsystem.PGP",
BusNameOwnerFlags.NONE,
on_bus_aquired,
diff --git a/src/scanner-session/main.vala b/src/scanner-session/main.vala
index 6de4f99..2ed94f9 100644
--- a/src/scanner-session/main.vala
+++ b/src/scanner-session/main.vala
@@ -17,7 +17,7 @@ ScannerSessionImplementation session;
public static int main(string[] args) {
Bus.own_name(
- BusType.SESSION,
+ BusType.SYSTEM,
"io.mainframe.shopsystem.ScannerSession",
BusNameOwnerFlags.NONE,
on_bus_aquired,
diff --git a/src/scanner-session/scannersession.vala b/src/scanner-session/scannersession.vala
index 666f2ac..27213c2 100644
--- a/src/scanner-session/scannersession.vala
+++ b/src/scanner-session/scannersession.vala
@@ -32,10 +32,10 @@ public class ScannerSessionImplementation {
public ScannerSessionImplementation() {
try {
- db = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Database", "/io/mainframe/shopsystem/database");
- dev = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.InputDevice", "/io/mainframe/shopsystem/device");
- cli = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Cli", "/io/mainframe/shopsystem/cli");
- audio = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.AudioPlayer", "/io/mainframe/shopsystem/audio");
+ db = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Database", "/io/mainframe/shopsystem/database");
+ dev = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.InputDevice", "/io/mainframe/shopsystem/device");
+ cli = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Cli", "/io/mainframe/shopsystem/cli");
+ audio = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.AudioPlayer", "/io/mainframe/shopsystem/audio");
dev.received_barcode.connect(handle_barcode);
cli.received_barcode.connect(handle_barcode);
diff --git a/src/serial-device/main.vala b/src/serial-device/main.vala
index ae1aa75..0dea907 100644
--- a/src/serial-device/main.vala
+++ b/src/serial-device/main.vala
@@ -17,7 +17,7 @@ Device dev;
public static int main(string[] args) {
try {
- Config cfg = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
+ Config cfg = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
dev = new Device(cfg.get_string("INPUT", "device"), 9600, 8, 1);
} catch(IOError e) {
error("IOError: %s\n", e.message);
@@ -26,7 +26,7 @@ public static int main(string[] args) {
}
Bus.own_name(
- BusType.SESSION,
+ BusType.SYSTEM,
"io.mainframe.shopsystem.InputDevice",
BusNameOwnerFlags.NONE,
on_bus_aquired,
diff --git a/src/web/main.vala b/src/web/main.vala
index 86caea5..c0fd77f 100644
--- a/src/web/main.vala
+++ b/src/web/main.vala
@@ -26,9 +26,9 @@ public static int main(string[] args) {
uint port = 8080;
try {
- db = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Database", "/io/mainframe/shopsystem/database");
- pgp = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.PGP", "/io/mainframe/shopsystem/pgp");
- cfg = Bus.get_proxy_sync(BusType.SESSION, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
+ db = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Database", "/io/mainframe/shopsystem/database");
+ pgp = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.PGP", "/io/mainframe/shopsystem/pgp");
+ cfg = Bus.get_proxy_sync(BusType.SYSTEM, "io.mainframe.shopsystem.Config", "/io/mainframe/shopsystem/config");
templatedir = cfg.get_string("WEB", "filepath");
port = cfg.get_integer("WEB", "port");