[Bug 1544300] [NEW] Use systemd timer to delay boinc startup

Bryan Quigley bryan.quigley at canonical.com
Wed Feb 10 21:40:58 UTC 2016


Public bug reported:

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/

** Affects: boinc (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Debian
BOINC Maintainers, which is subscribed to boinc in Ubuntu.
https://bugs.launchpad.net/bugs/1544300

Title:
  Use systemd timer to delay boinc startup

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/boinc/+bug/1544300/+subscriptions



More information about the pkg-boinc-devel mailing list