Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
But then dhcpcd.service went into FAILURE state. Why and how properly shutdown dhcpcd in systemd?
Code:
root@raspberrypi:/home/pi# systemctl status dhcpcd.service
● dhcpcd.service - dhcpcd on all interfaces
Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled)
Active: failed (Result: exit-code) since Sat 2017-05-13 20:44:51 UTC; 23min ago
Main PID: 1689 (code=exited, status=1/FAILURE)
May 13 20:44:50 raspberrypi systemd[1]: Stopping dhcpcd on all interfaces...
May 13 20:44:50 raspberrypi dhcpcd[1835]: dhcpcd[1835]: sending signal TERM to pid 1689
May 13 20:44:50 raspberrypi dhcpcd[1835]: sending signal TERM to pid 1689
May 13 20:44:50 raspberrypi systemd[1]: dhcpcd.service: main process exited, code=exited, status=1/FAILURE
May 13 20:44:50 raspberrypi dhcpcd[1835]: dhcpcd[1835]: waiting for pid 1689 to exit
May 13 20:44:50 raspberrypi dhcpcd[1835]: waiting for pid 1689 to exit
May 13 20:44:51 raspberrypi systemd[1]: Stopped dhcpcd on all interfaces.
May 13 20:44:51 raspberrypi systemd[1]: Unit dhcpcd.service entered failed state.
May 13 20:51:38 raspberrypi systemd[1]: Stopped dhcpcd on all interfaces.
May 13 20:55:18 raspberrypi systemd[1]: Stopped dhcpcd on all interfaces.
The commands used should be correct. You should probably track down the error, it sounds like the service may have a problem. Maybe you can start it from the command line and see if any helpful info shows up.
I wonder IF similar to this bug: https://bugzilla.redhat.com/show_bug.cgi?id=1356561
Can you provide version details (&distro), like in that bug? (&service config file maybe)
Note the two different pids. Any ideas from a systemd guru? (?e.g.)
it went to failed state already 23 minutes before you looked at the status.
maybe it's unrelated?
i'd be more worried that it stays off, i.e. other services can't restart it. maybe you have to mask it.
root@raspberrypi:/home/pi# netstat -anop | grep -v unix
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name Timer
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 440/sshd off (0.00/0/0)
tcp 0 0 164.48.95.90:22 164.48.95.89:54892 ESTABLISHED 2280/sshd: pi [priv keepalive (5477.34/0/0)
tcp 0 0 164.48.95.90:22 164.48.95.89:54888 ESTABLISHED 1300/sshd: pi [priv keepalive (5006.30/0/0)
udp 0 0 0.0.0.0:46201 0.0.0.0:* 319/avahi-daemon: r off (0.00/0/0)
udp 0 0 169.254.41.133:123 0.0.0.0:* 462/ntpd off (0.00/0/0)
udp 0 0 164.48.95.90:123 0.0.0.0:* 462/ntpd off (0.00/0/0)
udp 0 0 127.0.0.1:123 0.0.0.0:* 462/ntpd off (0.00/0/0)
udp 0 0 0.0.0.0:123 0.0.0.0:* 462/ntpd off (0.00/0/0)
udp 0 0 0.0.0.0:5353 0.0.0.0:* 319/avahi-daemon: r off (0.00/0/0)
The good thing is that daemon/process is gone.
However, it looks like systemd is not satisfied as it shows status: failed
Code:
root@raspberrypi:/home/pi# systemctl status dhcpcd.service
● dhcpcd.service - dhcpcd on all interfaces
Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled)
Drop-In: /etc/systemd/system/dhcpcd.service.d
└─wait.conf
Active: failed (Result: exit-code) since Sun 2017-05-14 23:01:41 UTC; 17s ago
Process: 2553 ExecStop=/sbin/dhcpcd -x (code=exited, status=0/SUCCESS)
Process: 2543 ExecStart=/sbin/dhcpcd -q -w (code=exited, status=0/SUCCESS)
Main PID: 2547 (code=exited, status=1/FAILURE)
May 14 22:47:44 raspberrypi dhcpcd[2543]: forked to background, child pid 2547
May 14 22:47:44 raspberrypi systemd[1]: Started dhcpcd on all interfaces.
May 14 23:01:41 raspberrypi systemd[1]: Stopping dhcpcd on all interfaces...
May 14 23:01:41 raspberrypi dhcpcd[2553]: dhcpcd[2553]: sending signal TERM to pid 2547
May 14 23:01:41 raspberrypi dhcpcd[2553]: sending signal TERM to pid 2547
May 14 23:01:41 raspberrypi dhcpcd[2553]: waiting for pid 2547 to exit
May 14 23:01:41 raspberrypi dhcpcd[2547]: received signal TERM from PID 2553, stopping
May 14 23:01:41 raspberrypi dhcpcd[2547]: eth0: removing interface
May 14 23:01:41 raspberrypi dhcpcd[2553]: dhcpcd[2553]: waiting for pid 2547 to exit
May 14 23:01:41 raspberrypi dhcpcd[2547]: exited
May 14 23:01:41 raspberrypi systemd[1]: dhcpcd.service: main process exited, code=exited, status=1/FAILURE
May 14 23:01:41 raspberrypi systemd[1]: Stopped dhcpcd on all interfaces.
May 14 23:01:41 raspberrypi systemd[1]: Unit dhcpcd.service entered failed state.
So I decided to go one step forward and disable it:
Code:
root@raspberrypi:/home/pi# systemctl disable dhcpcd.service
Synchronizing state for dhcpcd.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d dhcpcd defaults
Executing /usr/sbin/update-rc.d dhcpcd disable
insserv: warning: current start runlevel(s) (empty) of script `dhcpcd' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (0 1 2 3 4 5 6) of script `dhcpcd' overrides LSB defaults (0 1 6).
By looking at the status, I can see service is not only failed but also still enabled
Code:
root@raspberrypi:/home/pi# systemctl status dhcpcd.service
● dhcpcd.service - dhcpcd on all interfaces
Loaded: loaded (/lib/systemd/system/dhcpcd.service; enabled)
Drop-In: /etc/systemd/system/dhcpcd.service.d
└─wait.conf
Active: failed (Result: exit-code) since Sun 2017-05-14 23:01:41 UTC; 1min 8s ago
Main PID: 2547 (code=exited, status=1/FAILURE)
May 14 22:47:44 raspberrypi dhcpcd[2543]: forked to background, child pid 2547
May 14 22:47:44 raspberrypi systemd[1]: Started dhcpcd on all interfaces.
May 14 23:01:41 raspberrypi systemd[1]: Stopping dhcpcd on all interfaces...
May 14 23:01:41 raspberrypi dhcpcd[2553]: dhcpcd[2553]: sending signal TERM to pid 2547
May 14 23:01:41 raspberrypi dhcpcd[2553]: sending signal TERM to pid 2547
May 14 23:01:41 raspberrypi dhcpcd[2553]: waiting for pid 2547 to exit
May 14 23:01:41 raspberrypi dhcpcd[2547]: received signal TERM from PID 2553, stopping
May 14 23:01:41 raspberrypi dhcpcd[2547]: eth0: removing interface
May 14 23:01:41 raspberrypi dhcpcd[2553]: dhcpcd[2553]: waiting for pid 2547 to exit
May 14 23:01:41 raspberrypi dhcpcd[2547]: exited
May 14 23:01:41 raspberrypi systemd[1]: dhcpcd.service: main process exited, code=exited, status=1/FAILURE
May 14 23:01:41 raspberrypi systemd[1]: Stopped dhcpcd on all interfaces.
May 14 23:01:41 raspberrypi systemd[1]: Unit dhcpcd.service entered failed state.
Now, the question is:
in systemd - is normal that once service is set to disable, it still shows its enable and failed?
That makes no sense but maybe there is some hidden logic behind it?
And by looking at other example, eg. sudo.service which is disabled by default, it seems that dhcpcd.service is not completely disabled or at least not in a clear state:
Code:
root@raspberrypi:/home/pi# systemctl status sudo.service
● sudo.service - Provide limited super user privileges to specific users
Loaded: loaded (/lib/systemd/system/sudo.service; disabled)
Active: inactive (dead)
You should probably track down the error, it sounds like the service may have a problem. Maybe you can start it from the command line and see if any helpful info shows up.
Quote:
Originally Posted by ondoho
i'd be more worried that it stays off, i.e. other services can't restart it. maybe you have to mask it.
Under debian I tend to use the service method. About the only thing I used systemctl for aside from multi-user.target, is ModemManager, which lacks any entries under service, and seems to exist/run for no apparently good reason.
# service --status-all
# service dhcpcd stop
Although I think it has it's own method to stop it.
# dhcpcd -x
Not sure if that's the right option, I tend towards the dhclient from the isc option(not available under arch). The dhcpcd thing is like a not so attractive overly assertive girlfriend. Honey, not right now.
oh i keep forgetting that debian jessie is running a hybrid systemd/sysvinit system; so if the dhcpcd systemd service just passes the requests on to a sysvinit script, the failure message could be a carry-over from there.
Thanks for replies.
I just left it in a failed state. Process seems to be killed, which means dhcpcd is gone (although systemd shows it as "enable").
Im not really sure where to look for systemd logs. Not much hints in syslog and messages.
The systemd version of logs, all logs, or whatever applies. In debian jessie the /var/log/syslog and other individual ones still exist and in human readable form, not binary whatevers.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.