[Bug 1099420] Re: "starting" hook doesn't work as expected
Steve Langasek
steve.langasek at canonical.com
Mon Jan 14 16:29:54 UTC 2013
I'm afraid you've misunderstood the semantics here. It's "start on
starting", not "run on starting"; once the job is considered "started"
by upstart, the network-interface job can continue - and unless you
specify 'task', the job is started as soon as the 'script' is running.
You also haven't taken into account here that network-interface has an
'instance'. This means that your job will only block the /first/
network interface. For an example of how to do this currently, see the
network-interface-security job in Ubuntu.
** Changed in: upstart (Ubuntu)
Status: New => Invalid
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to upstart in Ubuntu.
https://bugs.launchpad.net/bugs/1099420
Title:
"starting" hook doesn't work as expected
Status in “upstart” package in Ubuntu:
Invalid
Bug description:
I need to run an important shell script before the network is
configured. I created the following test job "before-net.conf":
description "Hook tester to start before network-interface"
start on starting network-interface
script
set -x
exec > /dev/.initramfs/before-net.log 2>&1
# long operation
date +%H:%M:%S.%N
sleep 10
date +%H:%M:%S.%N
end script
I also modified network-interface.conf to also write a log to
/dev/.initramfs/network-interface-$INTERFACE.log. According to
documentation, before-net.conf will be executed synchronously before
network-interface. But it doesn't.
Logged time:
13:50:11.450185264: before-net.conf is starting
13:50:11.522017582: "lo" is to be configured
13:50:11.530957266: "eth0" is to be configured
13:50:11.532905558: "eth1" is to be configured
13:50:21.506887517: before-net.conf has finished
I can conclude that "network-interface" doesn't execute "before-net"
synchronously.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/1099420/+subscriptions
More information about the foundations-bugs
mailing list