| # Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| description "WPA Supplicant daemon" |
| author "chromium-os-dev@chromium.org" |
| |
| # Default log level for wpa_supplicant. |
| env WPA_DEBUG= |
| |
| start on started boot-services |
| stop on stopping boot-services |
| respawn |
| |
| # make sure the control interface dir exists and has the right owner |
| pre-start script |
| mkdir -p -m 0750 /var/run/wpa_supplicant |
| chown wpa:wpa /var/run/wpa_supplicant |
| end script |
| |
| # minijail0 will jail the wpa_supplicant instance it forks off. |
| expect fork |
| |
| # use minijail (drop root, keep CAP_NET_ADMIN|CAP_NET_RAW) |
| # enable dbus, syslog msgs, wpa_cli over unix domain socket |
| script |
| ARGS="" |
| case ${WPA_DEBUG} in |
| excessive) ARGS='-ddd';; |
| msgdump) ARGS='-dd';; |
| debug) ARGS='-d';; |
| info) ARGS='';; |
| warning) ARGS='-q';; |
| error) ARGS='-qq';; |
| esac |
| exec minijail0 -u wpa -g wpa -c 3000 -i -- \ |
| /usr/sbin/wpa_supplicant -u -s ${ARGS} -O/var/run/wpa_supplicant |
| end script |