You are not logged in.
Pages: 1
Hi,
as explained in the wiki i would like to have dhcpcd start automatically using "systemctl enable dhcpcd@interface". My problem is, it doesn't work!
"Systemctl start dhcpcd@interface" works just fine aswell as "dhcpcd interface". (btw am I correct in assuming that the first command somehow tells systemd to do what you would do with the second command by yourself ? )
I already got the tip to install a networkmanager, but if possible I'd like to solve this problem directly. Does anyone know what i could do?
Felix
Offline
Doesn't work in what way? Error messages?
What does 'systemctl status dhcpcd@interface' tell you?
Last edited by WorMzy (2013-02-28 10:29:39)
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Hi,
it tells me :
dhcpcd@enp0s3.service - dhcpcd on enp0s3
Loaded: loaded (/usr/lib/systemd/system/dhcpcd@.service; enabled)
Active: inactive (dead)
Edit:
If it is of interest, AL runs as a guest in VB.
Last edited by 65lix (2013-02-28 10:44:29)
Offline
Okay, the service is already enabled, which is why you're not seeing any messages when you try to enable it again. Could you reboot, then run 'systemctl status dhcpcd@enp0s3.service' (as root) again.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Here is what i get (i used systemctl start dhcpcd@enp0s3 at the previous session):
dhcpcd@enp0s3.service - dhcpcd on enp0s3
Loaded: loaded (/usr/lib/systemd/system/dhcpcd@.service; enabled)
Active: inactive (dead)
Feb 28 12:44:41 arch systemd[1]: Stopping dhcpcd on enp0s3...
Feb 28 12:44:41 arch dhcpcd[1416]: sending signal 15 to pid 618
Feb 28 12:44:41 arch dhcpcd[1416]: waiting for pid 618 to exit
Feb 28 12:44:41 arch dhcpcd[618]: received SIGTERM, stopping
Feb 28 12:44:41 arch dhcpcd[618]: enp0s3: removing interface
Feb 28 12:44:41 arch dhcpcd[1416]: dhcpcd[1416]: sending signal 15 to pid 618
Feb 28 12:44:41 arch dhcpcd[1416]: dhcpcd[1416]: waiting for pid 618 to exit
Feb 28 12:44:42 arch systemd[1]: dhcpcd@enp0s3.service: main process exited...RE
Feb 28 12:44:42 arch systemd[1]: Stopped dhcpcd on enp0s3.
Feb 28 12:44:42 arch systemd[1]: Unit dhcpcd@enp0s3.service entered failed state
Offline
What target are you booting in to? If it's the default, what is that set to?
ls -l /usr/lib/systemd/system/default.targetAlso, which target is the dhcpcd service assigned to?
ls -l /etc/systemd/system/*/It should be in "multi-user.target.wants", if it's somewhere else for you, try moving it to there.
Last edited by WorMzy (2013-02-28 13:44:36)
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
You could try
# systemctl enable dhcpcdand then reboot. As far as I know it's a bug that makes the command 'systemctl enable dhcpcd@interface' look for "dhcpcd@eth0" which obviously doesn't make sense.
This thread is adressing this problem: https://bbs.archlinux.org/viewtopic.php?id=157320
Have a look at posting #7. There is a solution mentioned.
Last edited by swordfish (2013-02-28 16:44:09)
Arch_x64 on Thinkpad Edge E520 (Intel Core i5, 4 GB RAM, 128 GB Crucial M4 SSD) + ITX-Desktop (Asrock H77M-ITX, Intel Core i3-2120T, 8GB RAM, 64 GB Samsung 830 SSD)
Offline
As far as I know it's a bug that makes the command 'systemctl enable dhcpcd@interface' look for "dhcpcd@eth0" which obviously doesn't make sense.
That has been fixed now. 65lix's dhcpcd@enp0s3.service is enabled, systemd's just not starting it at boot which suggests he's not booting into multi-user.target.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
The default is set to graphical.target at least this is what i get from :
lrwxrwxrwx 1 root root 16 13. Jän 16:58 /usr/lib/systemd/system/default.target -> graphical.target
The second command gives me :
/etc/systemd/system/getty.target.wants/:
insgesamt 0
lrwxrwxrwx 1 root root 38 22. Jän 10:14 getty@tty1.service -> /usr/lib/systemd/system/getty@.service
/etc/systemd/system/local-fs.target.wants/:
insgesamt 0
/etc/systemd/system/multi-user.target.wants/:
insgesamt 0
lrwxrwxrwx 1 root root 39 28. Feb 11:42 dhcpcd@eth0.service -> /usr/lib/systemd/system/dhcpcd@.service
lrwxrwxrwx 1 root root 40 13. Jän 16:58 remote-fs.target -> /usr/lib/systemd/system/remote-fs.target
/etc/systemd/system/sysinit.target.wants/:
insgesamt 0
So dhcpcd@interface.service boots in the right target but it is the wrong interface ?!
Offline
Okay, it looks like Swordfish was right on the money after all. Try disabling the service, then re-enable it, that bug is fixed in the current version of systemd, so if it happens again, update your system, then try again.
If you enabled it during the installation process that would explain why it's still affected by the bug that Swordfish mentioned - hopefully it'll be fixed in the March iso.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Thanks a lot! It works now! Of course i tried to disable and enable again but obviously that was before the bug was fixed.
Just a question for better understanding:
1) What means booting into a particular target.
Ok I might be able to answer that myself: It is the target the OS is in after the boot process is completed. A target is roughly speaking a state of the system defined by the services it provides. ... Is that more or less correct?
2) What exactly is listed by the command "ls -l /etc/systemd/system/*/ " ?
Felix
Offline
A target is roughly speaking a state of the system defined by the services it provides.
You're more or less right there. Give 'systemctl list-units --type=target' a look and you'll see that you have a number of active targets during your current boot session (e.g. basic.target, getty.target, graphical.target). These are in alphabetical order, so pay no mind to the order they appear in. If you look in /usr/lib/systemd/system/ you'll see files defining these targets (e.g. basic.target), and folders named <name>.target.wants (e.g. basic.target.wants). Inside these *.wants folders is a number of symlinks to various systemd units (services, sockets, timers, etc).
Have a look at /usr/lib/systemd/system/multi-user.target, which is your current default target (default.target is a symlink to this file):
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Multi-User
Documentation=man:systemd.special(7)
Requires=basic.target
Conflicts=rescue.service rescue.target
After=basic.target rescue.service rescue.target
AllowIsolate=yes
[Install]
Alias=default.targetNotice that it "Requires" basic.target. Look at that target:
...
Requires=sysinit.target sockets.target
...That requires sysinit.target (and sockets.target), look at sysinit.target:
...
Wants=local-fs.target swap.target
...As far as I know, "Wants" works like "Requires", in that it will pull it into the list of targets to reach, but I think it's more of a soft dependency than an explicit one. That is to say, it'll carry on even if something goes wrong in local-fs.target or swap.target, sysinit.target won't fail. This is where it all goes a bit wibbly-wobbly. You'll probably have noticed that you have a lot more .targets listed in "systemctl list-units --type=target" than you get when you follow the chain of targets, that's partially because each one of these targets pulls in systemd units. Look in their wants folders:
$ ls /usr/lib/systemd/system/{multi-user,basic,sysinit,sockets,local-fs,swap}.target.wants
...
/usr/lib/systemd/system/multi-user.target.wants:
dbus.service getty.target systemd-ask-password-wall.path systemd-logind.service systemd-user-sessions.service
...You'll notice that multi-user.target.wants has a symlink to getty.target.
I'm afraid it gets a little more complicated than that, you see, it's not just .targets that have Requires or Wants, any systemd unit can have them. If you look at /usr/lib/systemd/system/local-fs.target.wants/systemd-remount-fs.service, you'll see that it Wants "local-fs-pre.target". And to further confuse matters, and in relation to your second question, /etc/systemd/system/ contains your local system's custom systemd config. For example, you've just enabled dhcpcd@enp0s3.service, which makes a symlink in /etc/systemd/system/multi-user.target.wants/, this gets pulled in (and if there's a conflicting service of the same name, overrides it) at the same time everything in /usr/lib/systemd/system/multi-user.target.wants/ gets pulled in.
So, when multi-user.target gets reached during the boot process, it pulls in all the units listed in the dependency chain files and folders, and then loads the units in /usr/lib/systemd/system/multi-user.target.wants and /etc/systemd/system/multi-user.target.wants.
Hopefully that all makes a certain amount of sense. It's certainly a lot to wrap your head around, and I recommend that you read the manpages for systemd.target, systemd.unit, systemd.service, and systemd.special if you're interested in the subject, they'll help you get a better understanding of the inner workings of systemd. They'll also help you create your own custom targets, if you feel inclined.
Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD
Making lemonade from lemons since 2015.
Offline
Have a look at /usr/lib/systemd/system/multi-user.target, which is your current default target (default.target is a symlink to this file):
Isn't it graphical.target ?!
Thank you a lot for your explanation, it was really helpfull! I also read over parts of the man pages. There are just a few questions if you have some more time answering them
:
1)For a given target (or unit in general) what is the difference between units listed in target.wants and those listed in the target file after wants= .... ? The man page for systemd.unit says that those specified in target.wants are "implicitly added as dependencies of type wanted=". What does that mean?
2) As far as I can see units of type target have no functionality that other units do not have. So theoretically it would be possible to substitute all the target units by let's say service units that do the same job ?
3) By what I know now I could assume that the boot process works as follows: At some point a first target gets loaded and via dependecies a chain reaction is started unitl the system reached the final state/target.
On the other hand this mechanism seems to be difficult to manipulate. I doubt that when changing the default.target to boot in, this is (directly or indirectly) done by changing dependencies. So my question is there another mechanism ?
I hope your not getting tired of me asking questions. It's just that I am completly new to Linux and although the wiki and the man pages are a valuable source of information, answers to such specific questions are an immense help to me.
Felix
Last edited by 65lix (2013-03-01 10:54:43)
Offline
Pages: 1