Use systemd timer to delay boinc startup

Bug #1544300 reported by Bryan Quigley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
boinc (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Using Ubuntu 16.04 (or any system with systemd)

Current status:
boinc-client shows up as costing 1 second at boot with systemd-analyze blame due to sleep 1 in service file. I'm guessing this is to try and make boinc have less impact on bootup (it does afaict). If there is a different reason this might all be moot :).

Proposal I'm looking into:
Using systemd timers to tell boinc to start running X amount of time after bootup.

Something like:
/lib/systemd/system/boinc-client.timer
[Unit]
Description=Runs boinc-client service after bootup

[Timer]
OnBootSec=25s
Unit=boinc-client.service

[Install]
WantedBy=multi-user.target

/lib/systemd/system/boinc-client.service
[Unit]
Description=Berkeley Open Infrastructure Network Computing Client
After=network.target

[Service]
Nice=10
User=boinc
PermissionsStartOnly=yes
#ExecStartPre=/usr/bin/touch /var/log/boinc.log /var/log/boincerr.log
#ExecStartPre=/bin/chown boinc:boinc /var/log/boinc.log /var/log/boincerr.log
ExecStart=/usr/bin/boinc --dir /var/lib/boinc-client
ExecReload=/usr/bin/boinccmd --read_cc_config
ExecStopPost=/bin/rm -f /var/lib/boinc-client/lockfile
IOSchedulingClass=idle

With the following boinc-client is no longer in the blame list at all!
I disabled the ExecStartPre because boinc-client seemed to start them earlier.
I choose 25s at random for my slow test machine. I'm not sure the best value there.

[1] man systemd.timer
OnActiveSec=, OnBootSec=, OnStartupSec=, OnUnitActiveSec=, OnUnitInactiveSec=
           Defines monotonic timers relative to different starting points: OnActiveSec= defines a timer relative to the moment the timer itself is activated. OnBootSec= defines
           a timer relative to when the machine was booted up. OnStartupSec= defines a timer relative to when systemd was first started. OnUnitActiveSec= defines a timer
           relative to when the unit the timer is activating was last activated. OnUnitInactiveSec= defines a timer relative to when the unit the timer is activating was last
           deactivated.
[2] http://jason.the-graham.com/2013/03/06/how-to-use-systemd-timers/

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package boinc - 7.6.25+dfsg-1

---------------
boinc (7.6.25+dfsg-1) unstable; urgency=medium

  * New upstream release.
  * Upload to unstable
  * Remove sleep 1 in service file, useless because it doesn't
    fix the missing GPU detect (LP: #1544300)

 -- Gianfranco Costamagna <email address hidden> Thu, 11 Feb 2016 12:38:59 +0100

Changed in boinc (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.