Merge lp:~ted/unity-greeter-session-broadcast/check-sender into lp:unity-greeter-session-broadcast/13.10

Proposed by Ted Gould
Status: Merged
Approved by: Michael Terry
Approved revision: 25
Merged at revision: 22
Proposed branch: lp:~ted/unity-greeter-session-broadcast/check-sender
Merge into: lp:unity-greeter-session-broadcast/13.10
Prerequisite: lp:~ted/unity-greeter-session-broadcast/signal-app
Diff against target: 85 lines (+35/-6)
5 files modified
CMakeLists.txt (+3/-3)
data/com.canonical.Unity.Greeter.Broadcast.service.in (+1/-0)
data/unity-greeter-session-broadcast-session.conf (+27/-3)
debian/control (+1/-0)
test-call.sh (+3/-0)
To merge this branch: bzr merge lp:~ted/unity-greeter-session-broadcast/check-sender
Reviewer Review Type Date Requested Status
Michael Terry Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+178339@code.launchpad.net

Commit message

Get name owner and make sure it matches the sender.

Description of the change

Upstart won't allow for putting the name of the sender in v1 of the dbus stuff. Let's do it ourselves.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Terry (mterry) wrote :

You should add libglib2.0-bin to the Depends for the package, eh?

18. By Ted Gould

Add libglib2.0-bin to get gdbus

Revision history for this message
Ted Gould (ted) wrote :

On Tue, 2013-08-27 at 23:52 +0000, Michael Terry wrote:

> You should add libglib2.0-bin to the Depends for the package, eh?

Good catch. Fixed r18.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
19. By Ted Gould

Merge trunk

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Terry (mterry) wrote :

Testing this, I can't get the upstart file to kick off... I have upstart daily ppa installed, I'm sending out the signal... But the pre-start script doesn't happen. Am I missing a step?

Revision history for this message
Michael Terry (mterry) wrote :

With latest upstart, this still doesn't seem to work.

20. By Ted Gould

Update to trunk

21. By Ted Gould

Move the user into the script and handle the lack of PATH

22. By Ted Gould

Handy little script

23. By Ted Gould

Install as a system bus service

24. By Ted Gould

Add a user so we can do system activation

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Terry (mterry) wrote :

Should also change this to be system-services:
   set(DBUSSERVICEDIR "${CMAKE_INSTALL_DATADIR}/dbus-1/services/")

Otherwise looks great, and WFM. Thanks for fixing dbus autostarting.

review: Needs Fixing
25. By Ted Gould

Making sure the local install directory is correct

Revision history for this message
Michael Terry (mterry) wrote :

Awesome!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-08-28 16:37:47 +0000
3+++ CMakeLists.txt 2013-08-30 19:43:43 +0000
4@@ -40,11 +40,11 @@
5 include_directories(${GIO_UNIX2_INCLUDE_DIRS})
6
7 if(${LOCAL_INSTALL})
8- set(DBUSSERVICEDIR "${CMAKE_INSTALL_DATADIR}/dbus-1/services/")
9+ set(DBUSSERVICEDIR "${CMAKE_INSTALL_DATADIR}/dbus-1/system-services/")
10 else()
11- EXEC_PROGRAM(${PKG_CONFIG_EXECUTABLE} ARGS dbus-1 --variable session_bus_services_dir OUTPUT_VARIABLE DBUSSERVICEDIR )
12+ EXEC_PROGRAM(${PKG_CONFIG_EXECUTABLE} ARGS dbus-1 --variable system_bus_services_dir OUTPUT_VARIABLE DBUSSERVICEDIR )
13 endif()
14-message("Installing DBus services to ${DBUSSERVICEDIR}")
15+message("Installing DBus system services to ${DBUSSERVICEDIR}")
16
17 if(${LOCAL_INSTALL})
18 set(DBUSSYSCONFDIR "${CMAKE_INSTALL_SYSCONFDIR}")
19
20=== modified file 'data/com.canonical.Unity.Greeter.Broadcast.service.in'
21--- data/com.canonical.Unity.Greeter.Broadcast.service.in 2013-06-26 21:25:55 +0000
22+++ data/com.canonical.Unity.Greeter.Broadcast.service.in 2013-08-30 19:43:43 +0000
23@@ -1,3 +1,4 @@
24 [D-BUS Service]
25 Name=com.canonical.Unity.Greeter.Broadcast
26 Exec=@pkglibexecdir@/unity-greeter-session-broadcast-service
27+User=root
28
29=== modified file 'data/unity-greeter-session-broadcast-session.conf'
30--- data/unity-greeter-session-broadcast-session.conf 2013-06-28 20:55:05 +0000
31+++ data/unity-greeter-session-broadcast-session.conf 2013-08-30 19:43:43 +0000
32@@ -6,6 +6,30 @@
33 emits application-start
34
35 #TODO: Check GSettings Key
36-start on dbus-system SIGNAL="StartApplication" INTERFACE="com.canonical.Unity.Greeter.Broadcast" SENDER="com.canonical.Unity.Greeter.Broadcast" PATH="/com/canonical/Unity/Greeter/Broadcast" ARG0=${USER}
37-
38-exec initctl emit application-start APP_ID=${ARG1}
39+start on dbus BUS=system SIGNAL="StartApplication" INTERFACE="com.canonical.Unity.Greeter.Broadcast" PATH="/com/canonical/Unity/Greeter/Broadcast"
40+
41+pre-start script
42+ PATH="/bin:/usr/bin:/sbin:/usr/sbin"
43+
44+ if [ -z $ARG0 ] ; then
45+ stop
46+ exit 1
47+ fi
48+ if [ $ARG0 != $USER ] ; then
49+ stop
50+ exit 1
51+ fi
52+
53+ OWNER=`gdbus call --system --dest org.freedesktop.DBus --object-path / --method org.freedesktop.DBus.GetNameOwner com.canonical.Unity.Greeter.Broadcast | cut -d "'" -f 2`
54+
55+ if [ -z $OWNER ] ; then
56+ stop
57+ exit 1
58+ fi
59+ if [ $OWNER != $SENDER ] ; then
60+ stop
61+ exit 1
62+ fi
63+end script
64+
65+exec /sbin/initctl emit application-start APP_ID=${ARG1}
66
67=== modified file 'debian/control'
68--- debian/control 2013-07-09 19:31:17 +0000
69+++ debian/control 2013-08-30 19:43:43 +0000
70@@ -10,6 +10,7 @@
71 intltool,
72 libdbus-1-dev,
73 libdbustest1-dev,
74+ libglib2.0-bin,
75 python3-dbusmock,
76 Standards-Version: 3.9.4
77 Homepage: http://launchpad.net/unity-greeter-session-broadcast
78
79=== added file 'test-call.sh'
80--- test-call.sh 1970-01-01 00:00:00 +0000
81+++ test-call.sh 2013-08-30 19:43:43 +0000
82@@ -0,0 +1,3 @@
83+#!/bin/bash
84+
85+gdbus call --system --dest com.canonical.Unity.Greeter.Broadcast --object-path /com/canonical/Unity/Greeter/Broadcast --method com.canonical.Unity.Greeter.Broadcast.RequestApplicationStart $1 $2

Subscribers

People subscribed via source and target branches