I was trying to make an access-point with a captive portal on my raspberry pi running Raspbian Stretch.
I have correctly configure hostapd and dnsmasq to make my AP work correctly a couple of weeks later, but nowadays I tried to make my AP work but I can't even enable the process. This is the error log when I tried to disable, or even enable it.
systemctl disable hostapd
Synchronizing state of hostapd.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable hostapd
Failed to disable unit: Invalid argument
When I run system-analyze verify
, it returns the next:
systemd-analyze verify hostapd.service
[/etc/systemd/system/hostapd.service:1] Assignment outside of section. Ignoring.
[/etc/systemd/system/hostapd.service:2] Assignment outside of section. Ignoring.
[/etc/systemd/system/hostapd.service:3] Assignment outside of section. Ignoring.
hostapd.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.
hostapd.service: Failed to create hostapd.service/start: Unit hostapd.service is not loaded properly: Invalid argument.
And when I have tried to run apt remove hostapd
(Reading database ... 92822 files or directories currently installed.)
Uninstalling hostapd (2:2.6-21~bpo9~rpt1) ...
Failed to stop hostapd.service: Unit hostapd.service not loaded.
invoke-rc.d: initscript hostapd, action "stop" failed.
dpkg: error processing package hostapd (--remove):
subprocess installing pre-removal script returns error code 5
Error processing:
hostapd
E: Sub-process /usr/bin/dpkg returned an error code (1)
(I translate the last return lines because there are in Spanish, I think there are accurate).
And with this problem I'm not able to run hostapd or even uninstalling and configuring again...
Any clues on how to resolve my problem?
Thank you!
sudo service hostapd stop
?systemctl
direct.sudo service hostapd stop
.