Job for hostapd.service failed because the control process exited with error code - raspberry-pi

I'm was halfway setting WiFi router for my Raspberry Pi but this appeared:
Job for hostapd.service failed because the control process exited with error code.
See
"systemctl status hostapd.service" and "journalctl -xe" for details.
I've tried to excude systemctl status hostapd.service:
● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Thu 2019-07-11 15:50:37 JST; 1s ago
Process: 1673 ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=ex
7月 11 15:50:37 raspberrypi systemd[1]: Failed to start Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA
7月 11 15:50:37 raspberrypi systemd[1]: hostapd.service: Unit entered failed state.
7月 11 15:50:37 raspberrypi systemd[1]: hostapd.service: Failed with result 'exit-code'.
I'm new to Raspberry Pi. Would appreciate any help. Thank you in advance!

I just had this error happen to me - lengthening the PSK to >= 8 characters resolved the issue.

Today is the second time I've successfully set up a Raspberry Pi 0 W access point. This time i had this error:
ExecStart=/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=1/FAILURE)
After retracing my steps I found that i had made an error in the /etc/default/hostapd file.
I simply forget to enter the ending quotation " symbol at the end of the DAEMON_CONF string.
Also, the driver for the rpi0w in the hostapd.conf file should be nl80211, not brcmfmac.
You've likely made a simple error like I did. Check all your edits.
I've used this site's instructions for my setup
https://www.raspberrypi.org/documentation/configuration/wireless/access-point-routed.md

A trick to get a more specific error is to run the line of code pointed to by ExecStart:
/usr/sbin/hostapd -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF}
Fill in $DAEMON_OPTS and ${DAEMON_CONF} with whatever values you have configured in /etc/default/hostapd.conf. Now you will see a better error, like mispelling of a config or a bad driver.

Related

Getting error "Failed to start Artifactory service" after Artifactory installation

Getting this error after installing Artifactory
artifactory.service - Artifactory service
Loaded: loaded (/usr/lib/systemd/system/artifactory.service; enabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: protocol) since Mon 2023-02-13 14:14:06 UTC; 43s ago
Process: 1469 ExecStart=/opt/jfrog/artifactory/app/bin/artifactoryManage.sh start (code=exited, status=0/SUCCESS)
Main PID: 26760 (code=exited, status=143)
Feb 13 14:14:06 mbiazelkdynatrace systemd[1]: Failed to start Artifactory service.
Feb 13 14:14:06 mbiazelkdynatrace systemd[1]: Unit artifactory.service entered failed state.
Feb 13 14:14:06 mbiazelkdynatrace systemd[1]: artifactory.service failed.
[root#mbiazelkdynatrace run]# systemctl status artifactory.service
Please help figure out the issue; I've trying this for the last two weeks.
Since you are trying to start for the first time, there may be an issue with ports where the ports required for Artifactory might already being used.
The above snippet does not reveal anything of the issue.
Can you try to perform the below steps.
Stop Artifactory from service.
Navigate to $JFROG_HOME/artifactory/app/bin (ideally /opt/jfrog/artifactory/app/bin if you have not changed the default location)
./artifactoryctl start
Navigate to $JFROG_HOME/artifactory/var/log location
tail the console.log that should reveal what is the issue.
or artifactory-service.log should reveal the issue.
If nothing is found, share the error snippet from artifactory-service.log

Should systemctl show output when start/stop fails?

I've googled every variation of this question I can think of, but I'm just getting questions about failed services, not about how systemctl treats them. I have a service that I've been running as an init.d script. We're using systemctl now, fine. I created a service file that's a lightly modified version of the file automatically generated by systemd-sysv-generator. For ExecStart and ExecStop, it calls a bash script that returns 0 if the start/stop was successful, and non-zero if it was not.
I understand that there's no output from "systemctl start/stop" if it was successful. But I also don't get any output if either of the calls failed. The return code of the systemctl start/stop command is always 0 even if the return code of the source script is not. It's very clear it did fail because it shows as failed when I run the status command.
Is that expected behavior? Should it not give any indication that something failed unless you run a separate status command? And if that's not how it should behave, how can I make it indicate that a failure occurred?
Service file below.
[Unit]
SourcePath=/my/service/script.sh
[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/my/service/script.sh start
ExecStop=/my/service/script.sh stop
Working fine here, CentOS 7. Maybe double check that script.sh is really returning non zero?
$pwd
/etc/systemd/system
$cat me.service
[Unit]
[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
ExecStart=/etc/systemd/system/die.sh
$cat die.sh
#!/bin/bash
echo "dying"
exit 1
$sudo systemctl start me
Job for me.service failed because the control process exited with error code. See "systemctl status me.service" and "journalctl -xe" for details.
$sudo systemctl status me.service
● me.service
Loaded: loaded (/etc/systemd/system/me.service; static; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2019-09-12 17:55:02 GMT; 8s ago
Process: 19758 ExecStart=/etc/systemd/system/die.sh (code=exited, status=1/FAILURE)
Sep 12 17:55:02 dpsdev-wkr01 systemd[1]: Starting me.service...
Sep 12 17:55:02 dpsdev-wkr01 die.sh[19758]: dying
Sep 12 17:55:02 dpsdev-wkr01 systemd[1]: me.service: control process exited, code=exited status=1
Sep 12 17:55:02 dpsdev-wkr01 systemd[1]: Failed to start me.service.
Sep 12 17:55:02 dpsdev-wkr01 systemd[1]: Unit me.service entered failed state.
Sep 12 17:55:02 dpsdev-wkr01 systemd[1]: me.service failed.

Raspberry Pi Motion Camera Not Working

I installed motion sensing camera on my Raspberry Pi with this tutorial.
I worked through everything. I'm using Raspbery Pi 3 Model B so there were a few differences but I think I've covered everything.
When I restart the Pi Motion seems to start as if I run sudo service motion status I get something like this:
pi#raspberrypi:~ $ sudo service motion status
● motion.service - LSB: Start Motion detection
Loaded: loaded (/etc/init.d/motion)
Active: active (exited) since Thu 2018-03-08 21:08:08 UTC; 3min 0s ago
Process: 1271 ExecStop=/etc/init.d/motion stop (code=exited, status=0/SUCCESS)
Process: 1277 ExecStart=/etc/init.d/motion start (code=exited, status=0/SUCCESS)
Mar 08 21:08:08 raspberrypi systemd[1]: Started LSB: Start Motion detection.
Mar 08 21:08:08 raspberrypi motion[1277]: Starting motion detection daemon: motion.
I can't connect to the browser page from my Mac though. If I use http://:8080 I get an unable to connect error. I did install Apache so If I do http:// I get the default page.
What can I do to get this working?
have you tried http:/[YOUR_IP_ADDRESS]:8081. The 8080 is dedicated to configuration.

PG::ConnectionBad Postgres Cluster down

Digitalocean disabled my droplet's internet access. After fixing the error (rollback to older backup) they restored the internet access. But afterwards I constantly get an error when deploying, I can't seem to get my Postgres database up and running.
I'm getting an error each time I try to deploy my application.
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
So I used SSH to login to my server and check if my Postgres was actually running with:
pg_lsclusters
Results into:
Ver Cluster Port Status Owner Data directory Log file
9.5 main 5432 down postgres /var/lib/postgresql/9.5/main /var/log/postgresql/postgresql-9.5-main.log
Postgres server status
So my Postgres server seems to be down. I tried putting it 'up' again with:
pg_ctlcluster 9.5 main start After doing so I got the error: Insecure directory in $ENV{PATH} while running with -T switch at /usr/bin/pg_ctlcluster line 403.
And /usr/bin/pg_ctlcluster on line 403 says:
system 'systemctl', 'is-active', '-q', "postgresql\#$version-$cluster";
But I'm not to sure what the problem could be here and how I could fix this.
Update
I also tried updating the permissions on /bin to 755 as mentioned here. Sadly that did not fix my problem.
Update 2
I changed the /usr/bin to 755. Now when I try pg_ctlcluster 9.5 main start, I get this:
Job for postgresql#9.5-main.service failed because the control process exited with error code. See "systemctl status postgresql#9.5-main.service" and "journalctl -xe" for details.
And inside the systemctl status postgresql#9.5-main.service:
postgresql#9.5-main.service - PostgreSQL Cluster 9.5-main
Loaded: loaded (/lib/systemd/system/postgresql#.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2018-01-28 17:32:38 EST; 45s ago
Process: 22473 ExecStart=postgresql#%i --skip-systemctl-redirect %i start (code=exited, status=1/FAILURE)
Jan 28 17:32:08 *url* systemd[1]: Starting PostgreSQL Cluster 9.5-main...
Jan 28 17:32:38 *url* postgresql#9.5-main[22473]: The PostgreSQL server failed to start.
Jan 28 17:32:38 *url* systemd[1]: postgresql#9.5-main.service: Control process exited, code=exited status=1
Jan 28 17:32:38 *url* systemd[1]: Failed to start PostgreSQL Cluster 9.5-main.
Jan 28 17:32:38 *url* systemd[1]: postgresql#9.5-main.service: Unit entered failed state.
Jan 28 17:32:38 *url* systemd[1]: postgresql#9.5-main.service: Failed with result 'exit-code'.
Thanks!
You better not mix systemctl and pg_ctlcluster. Let systemctl makes the calls to pg_ctlcluster with the right user and permissions. You should start your postgresql instance with
sudo systemctl start postgresql#9.5-main.service
Also, check the errors in the startup log. You can post them too, to help you figure out what's going on.
Your systemctl status also outputs that the service is disable, so, when the server reboots, you will have to start the service manually. To enable it run:
sudo systemctl enable postgresql#9.5-main.service
I hope it helps
It is mainly because /etc/hosts file is somehow changed.I have removed extra space inside /etc/hosts file.Use cat /etc/hosts
Add these lines into the file
127.0.0.1 localhost
127.0.1.1 your-host-name
::1 ip6-localhost ip6-loopback
And I have given permission 644 to /etc/hosts file.It is working for me even after the reboot of the system.

FreeIPA-Client sssd.service warning/failure

This warning is while installing ipa-client in ubuntu.
Warning: found usr.sbin.sssd in /etc/apparmor.d/force-complain, forcing complain mode
Warning failed to create cache: usr.sbin.sssd
Job for sssd.service failed because the control process exited with error code. See "systemctl status sssd.service" and "journalctl -xe" for details.
sssd.service couldn't start.
After Installation, I couldn't not able to start the service.(Please refer below)enter code here
â— sssd.service - System Security Services Daemon
Loaded: loaded (/lib/systemd/system/sssd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2017-10-08 23:25:12 ; 36s ago
Main PID: 3500 (code=exited, status=4)
: Starting System Security Services Daemon...
: Configuration file: /etc/sssd/sssd.conf does not exist.
: sssd.service: Main process exited, code=exited, status=4/NOPERMISSION
: Failed to start System Security Services Daemon.
: sssd.service: Unit entered failed state.
: sssd.service: Failed with result 'exit-code'.
And while configuring ipa - ipa-client-install
Joining realm failed: libcurl failed to execute the HTTP POST transaction, explaining: SSL certificate problem: certificate is not yet valid
Installation failed. Rolling back changes.
IPA client is not configured on this system.
Could someone help me on this?
I found the solution, why it was failing while joining to the IPA Server. Actually this is due to date and time between server and client.