From 233bc85a5643c1316dbd915402265c88d06229f9 Mon Sep 17 00:00:00 2001 From: Seonah Moon Date: Wed, 10 Aug 2016 11:20:22 +0900 Subject: [PATCH] Add socket file to enable DNS proxy Change-Id: I9e04465f130cfee07678046660ca9292a2385dec Signed-off-by: Seonah Moon --- packaging/connman.spec | 16 ++++++++++++++++ src/connman.socket | 13 +++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 src/connman.socket diff --git a/packaging/connman.spec b/packaging/connman.spec index 1fd96eb..b571e59 100755 --- a/packaging/connman.spec +++ b/packaging/connman.spec @@ -154,6 +154,17 @@ mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants ln -s ../connman.service %{buildroot}%{_unitdir}/multi-user.target.wants/connman.service %endif +#Systemd socket file for DNS proxy +%if "%{?_lib}" == "lib64" +cp src/connman.socket %{buildroot}%{_unitdir}/connman.socket +mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants +ln -s ../connman.socket %{buildroot}%{_unitdir}/sockets.target.wants/connman.socket +%else +cp src/connman.socket %{buildroot}%{_libdir}/systemd/system/connman.socket +mkdir -p %{buildroot}%{_libdir}/systemd/system/sockets.target.wants +ln -s ../connman.socket %{buildroot}%{_libdir}/systemd/system/sockets.target.wants/connman.socket +%endif + mkdir -p %{buildroot}/%{_localstatedir}/lib/connman cp resources/var/lib/connman/settings %{buildroot}/%{_localstatedir}/lib/connman/settings mkdir -p %{buildroot}%{_datadir}/dbus-1/system-services @@ -202,6 +213,11 @@ systemctl daemon-reload %attr(644,root,root) %{_unitdir}/connman.service %attr(644,root,root) %{_unitdir}/multi-user.target.wants/connman.service %attr(644,root,root) %{_unitdir}/connman-vpn.service +%attr(644,root,root) %{_unitdir}/connman.socket +%attr(644,root,root) %{_unitdir}/sockets.target.wants/connman.socket +%else +%attr(644,root,root) %{_libdir}/systemd/system/connman.socket +%attr(644,root,root) %{_libdir}/systemd/system/sockets.target.wants/connman.socket %endif %{_datadir}/license/connman diff --git a/src/connman.socket b/src/connman.socket new file mode 100644 index 0000000..e27041f --- /dev/null +++ b/src/connman.socket @@ -0,0 +1,13 @@ +[Unit] +Description=DNS Proxy Socket +Before=connman.service + +[Socket] +ListenStream=0.0.0.0:53 +ListenDatagram=0.0.0.0:53 +FreeBind=true +SmackLabelIPIn=* +SmackLabelIPOut=@ + +[Install] +WantedBy=sockets.target \ No newline at end of file -- 2.7.4