You are not logged in.

#1 2012-11-06 23:38:36

dlin
Member
From: Taipei,Taiwan
Registered: 2005-09-21
Posts: 265

How to build systemd script for usb network card?

My network card is usb0, is there any method to let systemd workable?


Running 4 ArchLinux including sh4twbox,server,notebook,desktop. my AUR packages

Offline

#2 2012-11-06 23:53:19

progandy
Member
Registered: 2012-05-17
Posts: 5,192

Re: How to build systemd script for usb network card?

How exactly do you want to use the network card?
- manual configuration: create a service file
- dhcp (enable/start dhcpd@usb0.service with systemctl)
- netcfg: simply create a static or dynamic profile
- other network managers: just configure it.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2012-11-06 23:59:30

dlin
Member
From: Taipei,Taiwan
Registered: 2005-09-21
Posts: 265

Re: How to build systemd script for usb network card?

I use netcfg.
eg.

netcfg g1usb
systemctl enable netcfg
systemctl start netcfg
# now network workable

when I reboot, it can not work.

The content of /etc/network.d/g1usb

CONNECTION='ethernet'
DESCRIPTION='A basic dhcp ethernet connection using iproute'
INTERFACE='usb0'
IP='dhcp'

Running 4 ArchLinux including sh4twbox,server,notebook,desktop. my AUR packages

Offline

#4 2012-12-28 09:39:46

dlin
Member
From: Taipei,Taiwan
Registered: 2005-09-21
Posts: 265

Re: How to build systemd script for usb network card?

Is it possible to let Arch run 'netcfg -r usb0_network' when I plug in my usb_wireless card on USB0 automatically?


Running 4 ArchLinux including sh4twbox,server,notebook,desktop. my AUR packages

Offline

#5 2012-12-28 11:56:19

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: How to build systemd script for usb network card?

dlin wrote:

I use netcfg.
eg.

netcfg g1usb
systemctl enable netcfg
systemctl start netcfg
# now network workable

when I reboot, it can not work.

Where are you getting the idea that this should work? You didn't set up /etc/conf.d/netcfg, did you?

Alternatively, you could use netcfg@.service, but as with the above, you need to read about how it works first.

If you only want it when you plug the device in, write a udev rule.

Offline

#6 2012-12-28 12:58:04

dlin
Member
From: Taipei,Taiwan
Registered: 2005-09-21
Posts: 265

Re: How to build systemd script for usb network card?

> Alternatively, you could use netcfg@.service, but as with the above, you need to read about how it works first.

I've done by this method, but sometimes my usb card is not ready, then the boot sequence failed on the network connection.

> If you only want it when you plug the device in, write a udev rule.

I think I should change to use this method.
Is the add udev rule method still in
https://wiki.archlinux.org/index.php/Ud … ork_device

I'm afraid it should replaced by systemd method because I want when network connecting will trigger other systemd scripts enable.


Running 4 ArchLinux including sh4twbox,server,notebook,desktop. my AUR packages

Offline

Board footer

Powered by FluxBB