New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 731930 link

Starred by 1 user

Issue metadata

Status: Archived
Owner: ----
Closed: Jun 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Feature



Sign in to add a comment

Chrome OS: Revise comments in /etc/init/system-services.conf

Project Member Reported by yusukes@chromium.org, Jun 9 2017

Issue description

/etc/init/system-services.conf has the following comment:

 # Jobs that depend on system-services as described above can assume the
 # following:
 #   * All services implied by 'boot-services' are available.

This is correct 99.9% of time, but unless I'm missing something, there seems to be no real synchronization between boot-services and system-services.

With the following test Upstart jobs, system-services jobs are started before boot-services' "exec sleep 24h" lines are executed. Can we just ignore such an extreme case, or is it better to rewrite the comment? I'm not really sure if this is worth fixing, but filing this as a feature request for the record.


Test scripts:

localhost ~ # cat /etc/init/boot-test.conf 
start on started boot-services

pre-start script
  exec >> /var/log/test.log 2>&1
  echo "$(date --rfc-3339=ns): pre-start boot-test.conf"
  sleep 30
  exec sleep 24h
end script

localhost ~ # cat /etc/init/boot-test-2.conf 
start on started boot-services

script
  exec >> /var/log/test.log 2>&1
  echo "$(date --rfc-3339=ns): start boot-test-2.conf"
  sleep 30
  exec sleep 24h
end script

localhost ~ # cat /etc/init/system-test.conf 
start on started system-services

pre-start script
  exec >> /var/log/test.log 2>&1
  echo "$(date --rfc-3339=ns): pre-start system-test.conf"
  exec sleep 24h
end script

localhost ~ # cat /etc/init/system-test-2.conf 
start on started system-services

script
  exec >> /var/log/test.log 2>&1
  echo "$(date --rfc-3339=ns): start system-test-2.conf"
  exec sleep 24h
end script


Test result:

localhost ~ # cat /var/log/test.log 
2017-06-09 15:18:47.005118578-07:00: start boot-test-2.conf
2017-06-09 15:18:47.005569162-07:00: pre-start boot-test.conf
2017-06-09 15:18:52.526157017-07:00: pre-start system-test.conf
2017-06-09 15:18:52.532803346-07:00: start system-test-2.conf

system-test* jobs were started without waiting for 'sleep 30' to finish.

 

Comment 1 by vapier@chromium.org, Jun 16 2017

i think your test is flawed.  you're using "started" instead of "starting".  "started" is after the phase completes and does not block while "starting" blocks the "started" event.

this is why all the services that are in boot-services use "start on starting boot-services" while system-services.conf uses "start on started boot-services".

check out the upstart cookbook:
  http://upstart.ubuntu.com/cookbook/#event
Yes, that's more or less what this bug is about: /etc/init/system-services.conf recommends the flawed version in https://chromium.googlesource.com/chromiumos/platform2/+/master/init/upstart/system-services.conf#16

should we either change the recommendation to say "starting" rathern than "started", OR change the wording of the guarantee.
Sorry, wrong link: /etc/init/boot-services.conf recommends the "started" version https://chromium.googlesource.com/chromiumos/platform2/+/master/init/upstart/boot-services.conf

There's also this:

chromiumos/src$ ag 'start on started.*boot-services' -G conf$ | wc -l
36
chromiumos/src$ ag 'start on starting.*boot-services' -G conf$ | wc -l
28
Components: OS>Kernel
Project Member

Comment 5 by sheriffbot@chromium.org, Jun 28 2018

Status: Archived (was: Unconfirmed)
Issue has not been modified or commented on in the last 365 days, please re-open or file a new bug if this is still an issue.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Sign in to add a comment