I am trying to troubleshoot wpa_supplicant on a smaller tablet. The tablet is using systemd to run a wpa_supplicant.service which has an entry

ExecStart=/usr/sbin/wpa_supplicant -u

I would like to stop this service and run wpa_supplicant with a custom configuration instead of using the D-BUS interface. So I entered

systemctl stop wpa_supplicant

to stop the original service. The command succeeds, but unfortunately the service is restarted immediately. This is most unfortunate, since multiple instances of wpa_supplicant cannot really coexist.

Since I do not know that much about systemd: Why is the service immediately restarted? How can I prevent this from happening? Is this due to some service dependencies that I am not aware of?

The service definition in its entirety is given by:

Description=WPA supplicant

ExecStart=/usr/sbin/wpa_supplicant -u


Edit: The services which are up are

   CGroup: /
           | `-1 /sbin/init
             | `-154 /lib/systemd/systemd-timesyncd
             | `-228 /usr/bin/crashuploader --path /home/root/
             | `-181 /usr/bin/sync --service
             | `[email protected]:22- 
             |   |-2831 /usr/sbin/dropbear -i -r /etc/dropbear/dropbear_rsa_host_key -B
             |   |-2832 -sh
             |   |-2841 systemctl status
             |   `-2842 less
             | `-176 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
             | `-185 /usr/sbin/update_engine -foreground
             | `[email protected] 
             |   `-180 /sbin/agetty -8 -L ttymxc0 115200 xterm
             | `[email protected] 
             |   `-179 /sbin/agetty -o -p -- \x5cu --noclear tty1 linux
             | `-2754 /usr/sbin/wpa_supplicant -u
             | `-217 /lib/systemd/systemd-logind
             | `[email protected] 
             |   `-175 /usr/sbin/ifplugd -n -i usb0
             | `-135 /lib/systemd/systemd-udevd
             | `-134 /lib/systemd/systemd-journald
             | `-198 /usr/sbin/dhcpcd -4 -b --master wlan0
             | `-133 /usr/sbin/haveged -w 1024 -v 1 --Foreground
             | `-145 /lib/systemd/systemd-networkd
             | `[email protected] 
             |   `-1781 /usr/sbin/udhcpd -f /etc/udhcpd.usb0.conf
             | `-229 /usr/bin/xochitl --system
               `-258 /usr/bin/qmdns-responder
  • systemctl disable wpa_supplicant? Feb 2, 2022 at 16:05
  • Sorry, that does not seem to have any effect...
    – hfhc2
    Feb 2, 2022 at 16:17
  • restarting the device? Feb 2, 2022 at 16:22
  • Well, apparently the service is started from elsewhere. The "disable" does not remove any symlinks...
    – hfhc2
    Feb 2, 2022 at 17:56

1 Answer 1


You can mask a service to prevent it from being started by systemd.

Just run systemctl mask wpa_supplicant.service. This this will prevent the service from being started by systemd until it is unmasked.

You can unmask the service by running systemctl unmask wpa_supplicant.service.

Keep in mind that this will prevent anything from starting the service via systemd, including other services that may expect or need the service to be running in order to run themselves.

From the systemctl man page:

       mask UNIT...
           Mask one or more units, as specified on the command line. This will link these unit files to /dev/null, making it impossible to start them. This is a stronger version of disable, since it prohibits all kinds of
           activation of the unit, including enablement and manual activation. Use this option with care. This honors the --runtime option to only mask temporarily until the next reboot of the system. The --now option may be used
           to ensure that the units are also stopped. This command expects valid unit names only, it does not accept unit file paths.

       unmask UNIT...
           Unmask one or more unit files, as specified on the command line. This will undo the effect of mask. This command expects valid unit names only, it does not accept unit file paths.
  • 1
    Thanks, that seems to have done the trick
    – hfhc2
    Feb 2, 2022 at 16:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .