El Fri, 28 de Mar 2014 a las 10:25 PM, Steve Langasek <vor...@debian.org> escribió:
On Sat, Mar 29, 2014 at 03:28:13AM -0007, Cameron Norman wrote:
 > Failed to connect to wpa_supplicant - wpa_ctrl_open: Read-only
 file system

 Since Upstart does not have native state, wait-for-state is going to
 need to be used for this. I have attached a modified
 network-interface job and another helper job that should fix this.

That's not a correct fix. If the problem is that wpa_supplicant can't run until the full filesystem is up, that's a bug in wpa_supplicant. It needs
to be fixed to use /run, like other network-related packages do.


It seems to be more than that. wpa_supplicant requires a few libraries in /usr as well. Furthermore, it does not make much sense to mount stuff like /usr over wifi, so waiting until at least local filesystems are up to bring up wireless interfaces is acceptable, I think. I have attached the further modified network-interface job as well as a wpa_supplicant job. This one only delays wireless interfaces, not loopback or wired interfaces.

Best regards,
--
Cameron Norman
# network-interface - configure network device
#
# This service causes network devices to be brought up or down as a result
# of hardware being added or removed, including that which isn't ordinarily
# removable.

description     "configure network device"

emits net-device-up
emits net-device-down
emits static-network-up

start on net-device-added
stop on net-device-removed INTERFACE=$INTERFACE

instance $INTERFACE
export INTERFACE

pre-start script
    case "$INTERFACE" in
        # Make sure that local-filesystems are up before bringing up wireless
        # interfaces, since wpa_supplicant needs /usr and /var/run
        wl*|ww*|wlan*)
            start wait-for-state WAITER=network-interface-$INTERFACE \
                WAIT_FOR=wpa_supplicant WAIT_STATE=running
            ;;
        # Bring up lo even if /etc/network/interfaces is broken
        lo)
            ifconfig lo 127.0.0.1 up || true
            initctl emit -n net-device-up \
                IFACE=lo LOGICAL=lo ADDRFAM=inet METHOD=loopback || true
            ;;
    esac

    mkdir -p /run/network
    exec ifup --allow auto $INTERFACE
end script

post-stop exec ifdown --allow auto $INTERFACE
description "wpa_supplicant - signals that wpa_supplicant can be used"

start on local-filesystems
stop on runlevel [06]

pre-start script
    # wait-for-state likes to try to start the job manually, this prevents that
    [ -n "$UPSTART_EVENTS" ] || { stop; exit 0; }
end script

Reply via email to