Bug 44735

Summary: install a systemd service file if systemd is used
Product: colord Reporter: Benedikt Morbach <moben>
Component: daemonAssignee: Richard Hughes <richard>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: add a systemd service
some fixes to what was comitted

Description Benedikt Morbach 2012-01-12 10:15:36 UTC
Created attachment 55509 [details] [review]
add a systemd service

upower should install a systemd service file and add a SystemdService= line to
its dbus-activated service.

By doing that it will be started by systemd instead of dbus.
This has the advantage that it will be treated like any other system daemon and
put in its own cgroup by systemd. Also its state can be checked and it can
easily be restarted or stopped if it might misbehave.

On systems without systemd, dbus will start the daemon itself, just like it
does now.

Attached is a patch that implements this behaviour.
Like most other packages that support systemd, it adds a
--with-systemdsystemunitdir switch to configure.
Installation of the systemd service file can also be disabled using this
configure switch.
Comment 1 Benedikt Morbach 2012-01-12 10:19:35 UTC
That description should obviously say colord, not upower…

But as you will notice, the patches look very similar too and do the same thing, so I copy&pasted the description.

:)
Comment 2 Richard Hughes 2012-01-17 03:08:10 UTC
Committed with some minor modifications, thanks.
Comment 3 Benedikt Morbach 2012-01-18 11:47:02 UTC
Created attachment 55750 [details] [review]
some fixes to what was comitted

 - fix configure to correctly interpret --without-systemdsystemunitdir
 - make sure the service.in file is included by make dist
 - Tweak service description (comments from systemd people)
    - don't use the word "daemon" (nothing else does)
    - Title Case
    - drop WantedBy line, it's not really needed and noone will use it
Comment 4 Richard Hughes 2012-05-22 04:40:10 UTC
commit 32c9bffc3264d09fe755f7abbc3e77b167a30371
Author: Benedikt Morbach <benedikt.morbach@googlemail.com>
Date:   Tue May 22 12:28:11 2012 +0100

    Fix autotools when configuring without systemd
    
    Signed-off-by: Richard Hughes <richard@hughsie.com>

:100644 100644 22d4f28... bd4ec9d... M  configure.ac
:100644 100644 516c6a2... 23aeca8... M  data/Makefile.am

commit eb14ca20a52d92465c586c19764cb16ccd9e3c55
Author: Benedikt Morbach <benedikt.morbach@googlemail.com>
Date:   Tue May 22 12:25:23 2012 +0100

    Fix the description in the systemd service file
    
    Signed-off-by: Richard Hughes <richard@hughsie.com>

:100644 100644 f662fbb... b473397... M  data/colord.service.in

commit 80ca44664b8e433ddc39f7953ff4de2e589103dd
Author: Benedikt Morbach <benedikt.morbach@googlemail.com>
Date:   Tue May 22 12:24:23 2012 +0100

    Do not use 'WantedBy=graphical.target' in the shipped systemd file
    
    Signed-off-by: Richard Hughes <richard@hughsie.com>

:100644 100644 8301b40... f662fbb... M  data/colord.service.in

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.