[SOLVED] Can's start netctl via systemd

This forum is for topics dealing with problems with software specifically in the ARMv5 repo.

[SOLVED] Can's start netctl via systemd

Postby 71GA » Sun Dec 14, 2014 11:22 am

Hello, I am trying to start/enable my eth0 interface via the systemd. I put my profile named eth0 in the /etc/netctl folder and it looks like this:
$this->bbcode_second_pass_code('', 'Description='Povezava Raspberry PI z namiznim racunalnikom'
Interface=eth0
Connection=ethernet
IP=static
AutoWired=yes
Address=('169.254.39.201/16')
Gateway=('169.254.39.200')
DNS=('193.2.1.66' '193.2.1.71')')
I then disabled/stopped systemd-networkd.service and enabled/started netctl.service. Now the weird stuff comes in. Everything is fine if I start netctl interface using command:
$this->bbcode_second_pass_code('', 'netctl start eth0')
This command brings up eth0 interface and assigns it a correct IP address. I can check this using ifconfig:
$this->bbcode_second_pass_code('', 'eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 169.254.39.201 netmask 255.255.0.0 broadcast 169.254.255.255
inet6 fe80::ba27:ebff:fe15:8ec9 prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:15:8e:c9 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 55 bytes 4098 (4.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0')
Then I stop this interface using stop instead of start. Once eth0 is stopped I try to start it using systemd:
$this->bbcode_second_pass_code('', 'systemctl start netctl-ifplugd@eth0.service')
Command executes ok, but when I check the services using systemctl command, I can see that service did not start like it should. Furthermore there are more netctl interfaces:
$this->bbcode_second_pass_code('', '* netctl-ifplugd@eth0.service loaded failed failed Automatic wired network connection using netctl profiles
netctl.service loaded active exited (Re)store the netctl profile state
system-netctl.slice loaded active active system-netctl.slice
system-netctl\x2difplugd.slice loaded active active system-netctl\x2difplugd.slice
UNIT LOAD ACTIVE SUB DESCRIPTION
proc-sys-fs-binfmt_misc.automount loaded active waiting Arbitrary Executable File Formats File System Automount Point
sys-devices-dev:f1-tty-ttyAMA0.device loaded active plugged /sys/devices/dev:f1/tty/ttyAMA0
sys-devices-platform-bcm2708_usb-usb1-1\x2d1-1\x2d1.1-1\x2d1.1:1.0-net-eth0.device loaded active plugged SMSC9512/9514 Fast Ethernet Adapter
sys-devices-platform-bcm2708_usb-usb1-1\x2d1-1\x2d1.3-1\x2d1.3:1.0-host0-target0:0:0-0:0:0:0-block-sda-sda1.device loaded active plugged Micro_Line 1
sys-devices-platform-bcm2708_usb-usb1-1\x2d1-1\x2d1.3-1\x2d1.3:1.0-host0-target0:0:0-0:0:0:0-block-sda.device loaded active plugged Micro_Line
sys-devices-platform-bcm2835_AUD0.0-sound-card0.device loaded active plugged /sys/devices/platform/bcm2835_AUD0.0/sound/card0
sys-devices-platform-mmc\x2dbcm2835.0-mmc_host-mmc0-mmc0:b368-block-mmcblk0-mmcblk0p1.device loaded active plugged /sys/devices/platform/mmc-bcm2835.0/mmc_host/mmc0/mmc0:b368/block/mmcblk0/mmcblk0p1
sys-devices-platform-mmc\x2dbcm2835.0-mmc_host-mmc0-mmc0:b368-block-mmcblk0-mmcblk0p2.device loaded active plugged /sys/devices/platform/mmc-bcm2835.0/mmc_host/mmc0/mmc0:b368/block/mmcblk0/mmcblk0p2
sys-devices-platform-mmc\x2dbcm2835.0-mmc_host-mmc0-mmc0:b368-block-mmcblk0.device loaded active plugged /sys/devices/platform/mmc-bcm2835.0/mmc_host/mmc0/mmc0:b368/block/mmcblk0
sys-devices-virtual-block-zram0.device loaded active plugged /sys/devices/virtual/block/zram0
sys-devices-virtual-tty-ttyprintk.device loaded active plugged /sys/devices/virtual/tty/ttyprintk
sys-module-configfs.device loaded active plugged /sys/module/configfs
sys-subsystem-net-devices-eth0.device loaded active plugged SMSC9512/9514 Fast Ethernet Adapter
-.mount loaded active mounted /
boot.mount loaded active mounted /boot
dev-mqueue.mount loaded active mounted POSIX Message Queue File System
mnt.mount loaded active mounted /mnt
run-user-0.mount loaded active mounted /run/user/0
sys-kernel-config.mount loaded active mounted Configuration File System
sys-kernel-debug.mount loaded active mounted Debug File System
tmp.mount loaded active mounted Temporary Directory
systemd-ask-password-console.path loaded active waiting Dispatch Password Requests to Console Directory Watch
systemd-ask-password-wall.path loaded active waiting Forward Password Requests to Wall Directory Watch
session-c1.scope loaded active running Session c1 of user root
dbus.service loaded active running D-Bus System Message Bus
getty@tty1.service loaded active running Getty on tty1
haveged.service loaded active running Entropy Harvesting Daemon
kmod-static-nodes.service loaded active exited Create list of required static device nodes for the current kernel
* netctl-ifplugd@eth0.service loaded failed failed Automatic wired network connection using netctl profiles
netctl.service loaded active exited (Re)store the netctl profile state
serial-getty@ttyAMA0.service loaded active running Serial Getty on ttyAMA0
sshd.service loaded active running OpenSSH Daemon
systemd-journal-flush.service loaded active exited Trigger Flushing of Journal to Persistent Storage
systemd-journald.service loaded active running Journal Service
systemd-logind.service loaded active running Login Service
systemd-modules-load.service loaded active exited Load Kernel Modules
systemd-random-seed.service loaded active exited Load/Save Random Seed
systemd-remount-fs.service loaded active exited Remount Root and Kernel File Systems
systemd-resolved.service loaded active running Network Name Resolution
systemd-sysctl.service loaded active exited Apply Kernel Variables
systemd-timesyncd.service loaded active running Network Time Synchronization
systemd-tmpfiles-setup-dev.service loaded active exited Create Static Device Nodes in /dev
systemd-tmpfiles-setup.service loaded active exited Create Volatile Files and Directories
systemd-udev-trigger.service loaded active exited udev Coldplug all Devices
systemd-udevd.service loaded active running udev Kernel Device Manager
systemd-update-utmp.service loaded active exited Update UTMP about System Boot/Shutdown
systemd-user-sessions.service loaded active exited Permit User Sessions
systemd-vconsole-setup.service loaded active exited Setup Virtual Console
user@0.service loaded active running User Manager for UID 0
-.slice loaded active active Root Slice
system-getty.slice loaded active active system-getty.slice
system-netctl\x2difplugd.slice loaded active active system-netctl\x2difplugd.slice
system-serial\x2dgetty.slice loaded active active system-serial\x2dgetty.slice
system.slice loaded active active System Slice
user-0.slice loaded active active user-0.slice
user.slice loaded active active User and Session Slice
dbus.socket loaded active running D-Bus System Message Bus Socket
dm-event.socket loaded active listening Device-mapper event daemon FIFOs
lvm2-lvmetad.socket loaded active listening LVM2 metadata daemon socket
systemd-initctl.socket loaded active listening /dev/initctl Compatibility Named Pipe
systemd-journald-dev-log.socket loaded active running Journal Socket (/dev/log)
systemd-journald.socket loaded active running Journal Socket
systemd-shutdownd.socket loaded active listening Delayed Shutdown Socket
systemd-udevd-control.socket loaded active running udev Control Socket
systemd-udevd-kernel.socket loaded active running udev Kernel Socket
basic.target loaded active active Basic System
cryptsetup.target loaded active active Encrypted Volumes
getty.target loaded active active Login Prompts
graphical.target loaded active active Graphical Interface
local-fs-pre.target loaded active active Local File Systems (Pre)
local-fs.target loaded active active Local File Systems
multi-user.target loaded active active Multi-User System
paths.target loaded active active Paths
remote-fs.target loaded active active Remote File Systems
slices.target loaded active active Slices
sockets.target loaded active active Sockets
sound.target loaded active active Sound Card
swap.target loaded active active Swap
sysinit.target loaded active active System Initialization
time-sync.target loaded active active System Time Synchronized
timers.target loaded active active Timers
logrotate.timer loaded active waiting Daily rotation of log files
man-db.timer loaded active waiting Daily man-db cache update
shadow.timer loaded active waiting Daily verification of password and group files
systemd-tmpfiles-clean.timer loaded active waiting Daily Cleanup of Temporary Directories

LOAD = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB = The low-level unit activation state, values depend on unit type.

85 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.')
Can anyone tell me, what am I doing wrong?
Last edited by 71GA on Sun Dec 14, 2014 10:49 pm, edited 1 time in total.
71GA
 
Posts: 10
Joined: Fri Dec 12, 2014 5:17 pm

Re: Can's start netctl via systemd

Postby pepedog » Sun Dec 14, 2014 11:39 am

You never tried systemctl enable netctl@eth0
systemctl enable netctl-ifplugd@eth0 should have been goo too
Note first case actually refers to the filename, second case (ifplugd) all files where Interface=eth0
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Can's start netctl via systemd

Postby 71GA » Sun Dec 14, 2014 12:17 pm

Command:
$this->bbcode_second_pass_code('', 'systemctl start netctl@eth0')
works and this is what I needed. But on the other hand command:
$this->bbcode_second_pass_code('', 'systemctl start netctl-ifplugd@eth0')
does not work. Why is that? Is package ifpluggd even included in the installation file?

ADD:

What kind of a symbolic link do I have to create in order to achieve same results as with command?
$this->bbcode_second_pass_code('', 'systemctl enable netctl@eth0')
Last edited by 71GA on Sun Dec 14, 2014 8:25 pm, edited 1 time in total.
71GA
 
Posts: 10
Joined: Fri Dec 12, 2014 5:17 pm

Re: Can's start netctl via systemd

Postby pepedog » Sun Dec 14, 2014 2:11 pm

If you disable and enable again, it will tell you all the symlinks made.
I don't know why ifplugd doesn't work, it used to be very reliable.
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Can's start netctl via systemd

Postby 71GA » Sun Dec 14, 2014 8:32 pm

Oh sorry I corrected my reply above. Command:

$this->bbcode_second_pass_code('', '
systemctl start netctl@eth0
')

works, but I need to allso enable it at boot, so I allso need command:

$this->bbcode_second_pass_code('', '
systemctl enable netctl@eth0
')

to work. But it doesn't. It returns an error:

$this->bbcode_second_pass_code('', '
The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
.wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
D-Bus, udev, scripted systemctl call, ...).
')

which is weird, because this is a fresh install of Archlinux-ARM.

$this->bbcode_second_pass_quote('', 'I')f you disable and enable again, it will tell you all the symlinks made.


Ok thanks, but as stated above - "systemctl enable" returns an error while "systemctl start" does its job,
so I can't get the symlink... I really need to somehow create a symlink to start eth0 at boot...
71GA
 
Posts: 10
Joined: Fri Dec 12, 2014 5:17 pm

Re: Can's start netctl via systemd

Postby pepedog » Sun Dec 14, 2014 8:46 pm

Sorry, it should be
netctl enable eth0
Wiki is marvellous https://wiki.archlinux.org/index.php/Netctl
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Can's start netctl via systemd

Postby 71GA » Sun Dec 14, 2014 9:08 pm

$this->bbcode_second_pass_quote('', '
')Sorry, it should be
netctl enable eth0

This works and I mentioned it in my 1st post. But this is starting it directly. But what I need is to start it using systemd...

The only case where I wouldn't need eth0 to be started by systemd is if command netctl enable eth0 could be enabled via somesort of a symlink...

ADD:
OK so thanks to your last post I figured this one out! 1st you need to use systemd, to enable netcfg. Then you use netcfg to enable eth0. Some sort of a chain. =) And this also can be done using symlinks. =)

SOLVED!
71GA
 
Posts: 10
Joined: Fri Dec 12, 2014 5:17 pm

Re: [SOLVED] Can's start netctl via systemd

Postby WarheadsSE » Mon Dec 15, 2014 2:10 pm

netctl has interfacing to systemd. Simply `netctl enable eth0` `netctl start eth0` would have done it.
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm


Return to ARMv5

Who is online

Users browsing this forum: No registered users and 2 guests