Mir

Merge lp:~mir-team/mir/fix-1236912 into lp:mir

Proposed by Alan Griffiths
Status: Merged
Approved by: kevin gunn
Approved revision: no longer in the source branch.
Merged at revision: 1116
Proposed branch: lp:~mir-team/mir/fix-1236912
Merge into: lp:mir
Diff against target: 86 lines (+45/-3)
4 files modified
include/shared/mir/default_configuration.h (+1/-1)
src/server/default_server_configuration.cpp (+2/-2)
src/shared/logging/CMakeLists.txt (+1/-0)
src/shared/logging/default_configuration.cpp (+41/-0)
To merge this branch: bzr merge lp:~mir-team/mir/fix-1236912
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Robert Ancell Approve
Review via email: mp+189916@code.launchpad.net

Commit message

shared: change default filesystem endpoint to $XDG_RUNTIME_DIR/mir_socket

Note that running examples by "sudo mir_demo_server_..." means that there's no XDG_RUNTIME_DIR variable - and we fallback to /tmp.

Running clients need to be told the server is there - e.g. "mir_demo_client_eglplasma -m /tmp/mir_socket"

Description of the change

shared: change default filesystem endpoint to $XDG_RUNTIME_DIR/mir_socket

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Looks good.

review: Approve
Revision history for this message
Robert Ancell (robert-ancell) wrote :

To clarify about potential side-effects:
- When using unity system compositor the Mir socket is set by LightDM to /tmp/mir_socket - so this change should have no effect on desktop cases (we should update lightdm to use XDG_RUNTIME_DIR though)
- On the phone, LightDM runs Unity Shell without setting any socket hint, so it will use the new socket location
- Some of the QA team tests have checked for the existence of /tmp/mir_socket to check if Mir is running - these might need to be updated.

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)
Revision history for this message
Robert Ancell (robert-ancell) wrote :

I confirmed running this branch locally with unity-system-compositor keeps using /tmp/mir_socket as expected.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'include/shared/mir/default_configuration.h'
2--- include/shared/mir/default_configuration.h 2013-08-28 03:41:48 +0000
3+++ include/shared/mir/default_configuration.h 2013-10-08 16:45:56 +0000
4@@ -23,7 +23,7 @@
5
6 namespace mir
7 {
8-const char default_server_socket[] = "/tmp/mir_socket";
9+extern const char *const default_server_socket;
10 }
11
12 #endif
13
14=== modified file 'src/server/default_server_configuration.cpp'
15--- src/server/default_server_configuration.cpp 2013-10-05 05:16:50 +0000
16+++ src/server/default_server_configuration.cpp 2013-10-08 16:45:56 +0000
17@@ -255,9 +255,9 @@
18 (standalone_opt, po::value<bool>(),
19 "Run mir in standalone mode. [bool:default=false]")
20 (host_socket_opt, po::value<std::string>(),
21- "Host socket filename. [string:default={$MIR_SOCKET,/tmp/mir_socket}]")
22+ "Host socket filename. [string:default={$MIR_SOCKET,$XDG_RUNTIME_DIR/mir_socket}]")
23 ("file,f", po::value<std::string>(),
24- "Socket filename. [string:default=/tmp/mir_socket]")
25+ "Socket filename. [string:default=$XDG_RUNTIME_DIR/mir_socket]")
26 (no_server_socket_opt, "Do not provide a socket filename for client connections")
27 (platform_graphics_lib, po::value<std::string>(),
28 "Library to use for platform graphics support [default=libmirplatformgraphics.so]")
29
30=== modified file 'src/shared/logging/CMakeLists.txt'
31--- src/shared/logging/CMakeLists.txt 2013-06-03 08:14:01 +0000
32+++ src/shared/logging/CMakeLists.txt 2013-10-08 16:45:56 +0000
33@@ -18,6 +18,7 @@
34 MIR_SHARED_LOGGING_SOURCES
35
36 dumb_console_logger.cpp
37+ default_configuration.cpp
38 )
39
40 add_library(
41
42=== added file 'src/shared/logging/default_configuration.cpp'
43--- src/shared/logging/default_configuration.cpp 1970-01-01 00:00:00 +0000
44+++ src/shared/logging/default_configuration.cpp 2013-10-08 16:45:56 +0000
45@@ -0,0 +1,41 @@
46+/*
47+ * Copyright © 2013 Canonical Ltd.
48+ *
49+ * This program is free software: you can redistribute it and/or modify it
50+ * under the terms of the GNU Lesser General Public License version 3,
51+ * as published by the Free Software Foundation.
52+ *
53+ * This program is distributed in the hope that it will be useful,
54+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
55+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
56+ * GNU Lesser General Public License for more details.
57+ *
58+ * You should have received a copy of the GNU Lesser General Public License
59+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
60+*
61+ * Authored by: Alan Griffiths <alan@octopull.co.uk>
62+ */
63+
64+#include "mir/default_configuration.h"
65+
66+#include <cstdlib>
67+#include <sstream>
68+
69+namespace
70+{
71+const char* init()
72+{
73+ std::ostringstream formatter;
74+
75+ char const* dir = getenv("XDG_RUNTIME_DIR");
76+ if (!dir) dir = "/tmp";
77+
78+ formatter << dir << "/mir_socket";
79+
80+ static auto result = formatter.str();
81+ return result.c_str();
82+}
83+}
84+
85+const char *const mir::default_server_socket = init();
86+

Subscribers

People subscribed via source and target branches