17

I have a small arm server that runs Arch. I wanted to use only dhcpcd for my ethernet connection so I disabled netctl.service and netctl-ifplugd.service. Turns out that didn't work and I have no means of connecting to the machine anymore. The server has it's root on a usb key which I can mount on my desktop and so the question is:

How can I systemctl enable netctl.service by manipulating files and/or symlinking files on that usb?

The equivalent alternative question is, what does systemctl enable netctl.service do?

SouravGhosh
  • 553
  • 5
  • 12
Azrael3000
  • 417
  • 1
  • 3
  • 11
  • netctl is the commandline equivalent to the Graphical NetworkManager. netctl starts dhcpd service if dhcpd.service isnt enabled. ifplugd monitors for cable connection loss. The only way that I know of since services are interdependent is to use `systemctl enable netctl && systemctl start netctl`, or `systemctl enable dhcpd && systemctl start dhcpd` from the machine you can't connect to. – eyoung100 Sep 26 '14 at 21:12
  • My dhcpcd remains enabled. I once changed the config so that I had a static ip but have reverted the changes in dhcpcd.conf. However, the server doesn't show up on my routers clients list. There is no way to interact with the arm server as there is neither a monitor nor a keyboard to be attached. – Azrael3000 Sep 26 '14 at 21:18
  • Is there a Serial Port? – eyoung100 Sep 26 '14 at 21:23
  • No there is not. – Azrael3000 Sep 26 '14 at 21:24
  • How'd you install it the first time... You'll need to reeable the netctl service since netctl tells dhcpd to use a static ip you've got to get to the terminal somehow – eyoung100 Sep 26 '14 at 21:29
  • Well I can just reinstall Arch on the usb and it would be working again. I just thought there might be a nicer solution – Azrael3000 Sep 26 '14 at 21:32
  • not w/ systemd lol. As I said all the Services operate in tandem. The tandem(links etc, that you thought you could fix) are controlled by the systemctl binary. – eyoung100 Sep 26 '14 at 21:34
  • Thanks for your help anyways. I'll see if somebody jumps on it otherwise I'll do a reinstall. – Azrael3000 Sep 26 '14 at 21:46
  • I hate that you need to reinstall... – eyoung100 Sep 26 '14 at 21:47
  • I have the same problem... This is a problem about Raspbery Pi running Archlinux ARM... – 71GA Dec 13 '14 at 09:07

1 Answers1

22

I have a small arm server that runs Arch. I wanted to use only dhcpcd for my ethernet connection so I disabled netctl.service and netctl-ifplugd.service. Turns out that didn't work and I have no means of connecting to the machine anymore.

Did you make sure to enable dhcpcd after disabling netctl?

How can I "systemctl enable netctl.service" by manipulating files and/or symlinking files on that usb?

The equivalent alternative question is, what does "systemctl enable netctl.service" do?

All systemctl enable does is create symlinks from /usr/lib/systemd/system/ or /etc/systemd/system/ to the appropriate target directories in /etc/systemd/system/, with services in the latter directory overriding ones in the former.

From the systemctl(1) manpage:

enable NAME...
    Enable one or more unit files or unit file instances, as
    specified on the command line. This will create a number 
    of symlinks as encoded in the "[Install]" sections of the
    unit files.

Instead of using systemctl enable you could enable the netctl service manually with the following command:

ln -s /usr/lib/systemd/system/netctl.service \
      /etc/systemd/system/multi-user.target.wants/netctl.service

And to disable it manually you could use the following command to remove the symlink created with the previous ln command:

rm /etc/systemd/system/multi-user.target.wants/netctl.service

The appropriate target directory can be found by looking for the WantedBy setting in the [Install] section of the service file in question, though older service files sometimes has Alias instead of WantedBy and you may want to switch to using WantedBy instead, but either will work just as well.

Instead of reverting to using netctl you could first check that the dhcpcd service was enabled properly, and if it was you can use journalctl's --directory or --root flags to check the logs of the dhcpcd service after mounting the filesystem on your other machine and see if that can give any clues as to why it failed to work properly.

remmy
  • 4,955
  • 1
  • 23
  • 30
  • Too bad I should've checked before reinstalling just now. Thanks for your answer. Even though I can't test it now I will accept your answer. – Azrael3000 Oct 05 '14 at 12:52
  • 1
    This is the best anwser! And this anwser is somehow obvious because every time you execute `systemctl enable netctl.service` you will get a CLI output showing you your anwser =) – 71GA Dec 13 '14 at 09:09