Commit e67769a1 authored by Jussi Laakkonen's avatar Jussi Laakkonen

[connman] Home must be mounted before connmand is run. Fixes JB#46139

This forces connman to wait for /home to be mounted before it is
started. It can be achieved with RequiresMountsFor, which is equal to
having Requires and After for home.mount. Also, connman needs to be
stopped when /home is unmounted. This is achieved with PartOf.

Added a systemd service additional conf file to be put under systemd
system/connman.service.d/ which makes the above possible.
parent 86fed5c0
# This file amends the connman systemd settings by making connman to "follow"
# home mount status. RequiresMountsFor is the same as adding Requires and After
# for home.mount and ensures that connman is not started until home is mounted.
# PartOf ensures that connman is stopped before home is unmounted. This is
# because if the configurations go missing when connman is running undefined
# behavior can happen.
[Unit]
RequiresMountsFor=/home
PartOf=home.mount
...@@ -7,6 +7,7 @@ License: GPLv2 ...@@ -7,6 +7,7 @@ License: GPLv2
URL: http://connman.net/ URL: http://connman.net/
Source0: %{name}-%{version}.tar.bz2 Source0: %{name}-%{version}.tar.bz2
Source1: main.conf Source1: main.conf
Source2: 01-require-home-mount-to-be-present.conf
Requires: dbus >= 1.4 Requires: dbus >= 1.4
Requires: wpa_supplicant >= 0.7.1 Requires: wpa_supplicant >= 0.7.1
Requires: ofono Requires: ofono
...@@ -212,6 +213,9 @@ cp -a %{SOURCE1} %{buildroot}%{_sysconfdir}/connman/ ...@@ -212,6 +213,9 @@ cp -a %{SOURCE1} %{buildroot}%{_sysconfdir}/connman/
mkdir -p %{buildroot}/%{_lib}/systemd/system/network.target.wants mkdir -p %{buildroot}/%{_lib}/systemd/system/network.target.wants
ln -s ../connman.service %{buildroot}/%{_lib}/systemd/system/network.target.wants/connman.service ln -s ../connman.service %{buildroot}/%{_lib}/systemd/system/network.target.wants/connman.service
mkdir -p %{buildroot}/%{_lib}/systemd/system/connman.service.d
cp -a %{SOURCE2} %{buildroot}/%{_lib}/systemd/system/connman.service.d/
mkdir -p %{buildroot}/%{_docdir}/%{name}-%{version} mkdir -p %{buildroot}/%{_docdir}/%{name}-%{version}
install -m0644 -t %{buildroot}/%{_docdir}/%{name}-%{version} \ install -m0644 -t %{buildroot}/%{_docdir}/%{name}-%{version} \
AUTHORS ChangeLog README AUTHORS ChangeLog README
...@@ -263,6 +267,7 @@ systemctl daemon-reload || : ...@@ -263,6 +267,7 @@ systemctl daemon-reload || :
/%{_lib}/systemd/system/connman.service /%{_lib}/systemd/system/connman.service
/%{_lib}/systemd/system/network.target.wants/connman.service /%{_lib}/systemd/system/network.target.wants/connman.service
/%{_lib}/systemd/system/connman-vpn.service /%{_lib}/systemd/system/connman-vpn.service
/%{_lib}/systemd/system/connman.service.d
/%{_datadir}/dbus-1/system-services/net.connman.vpn.service /%{_datadir}/dbus-1/system-services/net.connman.vpn.service
%files wait-online %files wait-online
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment