diff --git a/.gitignore b/.gitignore index 89d04a5..76cfbab 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,5 @@ dbus-glue.h *.pid *.tar *.bz2 +*.conf rpm diff --git a/Makefile.in b/Makefile.in index 018667f..8dfcfee 100644 --- a/Makefile.in +++ b/Makefile.in @@ -131,6 +131,10 @@ install: \ @$(MKDIR) $(DESTDIR)/$(unitdir) @$(INSTALL_DATA) conf/systemd.service $(DESTDIR)/$(unitdir)/$(PACKAGE_NAME).service + @$(MKDIR) $(DESTDIR)/etc/dbus-1/system.d + @$(INSTALL_DATA) conf/dbus.conf $(DESTDIR)/etc/dbus-1/system.d/$(PACKAGE_NAME).conf + + bz2: \ $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 diff --git a/conf/dbus.conf.in b/conf/dbus.conf.in new file mode 100644 index 0000000..41095c5 --- /dev/null +++ b/conf/dbus.conf.in @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + diff --git a/conf/dbus.service.in b/conf/dbus.service.in new file mode 100644 index 0000000..e6a1e4a --- /dev/null +++ b/conf/dbus.service.in @@ -0,0 +1,5 @@ +[D-BUS Service] +Name=br.com.bb.pw3270.service +Exec=/bin/false +User=root +SystemdService=@PACKAGE_NAME@.service diff --git a/conf/systemd.service.in b/conf/systemd.service.in index 09ab6cf..231fe5b 100644 --- a/conf/systemd.service.in +++ b/conf/systemd.service.in @@ -12,4 +12,5 @@ Restart=on-failure [Install] WantedBy=default.target +Alias=dbus-br.com.bb.pw3270.service diff --git a/configure.ac b/configure.ac index 15c8c83..bc1466b 100644 --- a/configure.ac +++ b/configure.ac @@ -358,6 +358,8 @@ dnl --------------------------------------------------------------------------- AC_CONFIG_FILES(Makefile) AC_CONFIG_FILES(conf/systemd.service) +AC_CONFIG_FILES(conf/dbus.service) +AC_CONFIG_FILES(conf/dbus.conf) dnl --------------------------------------------------------------------------- dnl Output the generated config.status script. diff --git a/src/main.c b/src/main.c index c557480..a7af75e 100644 --- a/src/main.c +++ b/src/main.c @@ -141,17 +141,18 @@ static void initialize() { connection = dbus_g_bus_get_private(bustype, g_main_context_default(), &error); if(error) { - g_error("Error \"%s\" getting D-Bus connection",error->message); + fprintf(stderr,"Error \"%s\" getting D-Bus connection\n",error->message); g_error_free(error); - return; + exit(-1); } proxy = dbus_g_proxy_new_for_name(connection,DBUS_SERVICE_DBUS,DBUS_PATH_DBUS,DBUS_INTERFACE_DBUS); org_freedesktop_DBus_request_name(proxy, PW3270_SERVICE_DBUS_SERVICE, DBUS_NAME_FLAG_DO_NOT_QUEUE, &result, &error); if(error) { - g_error("Error \"%s\" getting D-Bus name",error->message); - return; + fprintf(stderr,"Error \"%s\" getting D-Bus name\n",error->message); + g_error_free(error); + exit(-1); } GType object_type = PW3270_TYPE_DBUS; -- libgit2 0.21.2