Skip to content

Commit

Permalink
[boot] service file uses new boot targets
Browse files Browse the repository at this point in the history
Signed-off-by: Pekka Lundstrom <pekka.lundstrom@jollamobile.com>
  • Loading branch information
Pekka Lundstrom committed Jul 3, 2013
1 parent daa9fcf commit 4009e8b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
7 changes: 4 additions & 3 deletions contactsd.service
@@ -1,9 +1,10 @@
[Unit]
Description=Contacts daemon
After=xorg.target
Requires=dbus.socket xorg.target
After=pre-user-session.target
Requires=dbus.socket

[Service]
ExecStart=/usr/bin/contactsd


[Install]
WantedBy=user-session.target
18 changes: 18 additions & 0 deletions rpm/contactsd.spec
Expand Up @@ -6,6 +6,8 @@ Group: System/Libraries
URL: https://github.com/nemomobile/contactsd
License: LGPLv2
Source0: %{name}-%{version}.tar.bz2
Requires: systemd
Requires: systemd-user-session-targets
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Network)
Expand All @@ -27,6 +29,7 @@ information), and store it to QtContacts.
%files
%defattr(-,root,root,-)
%{_libdir}/systemd/user/contactsd.service
%{_libdir}/systemd/user/user-session.target.wants/contactsd.service
%{_bindir}/contactsd
%{_libdir}/contactsd-1.0/plugins/*.so
# we currently don't have a backup framework
Expand Down Expand Up @@ -74,3 +77,18 @@ make %{?_smp_mflags}
%install
make INSTALL_ROOT=%{buildroot} install

mkdir -p %{buildroot}%{_libdir}/systemd/user/user-session.target.wants
ln -s ../contactsd.service %{buildroot}%{_libdir}/systemd/user/user-session.target.wants/

%post
if [ "$1" -ge 1 ]; then
systemctl-user daemon-reload || :
systemctl-user restart contactsd.service || :
fi

%postun
if [ "$1" -eq 0 ]; then
systemctl-user stop contactsd.service || :
systemctl-user daemon-reload || :
fi

0 comments on commit 4009e8b

Please sign in to comment.