You are not logged in.

#1 2015-11-21 12:51:19

theking2
Banned
From: Romanshorn Switzerland
Registered: 2009-03-04
Posts: 372

[SOLVED] systemctl instructions unclear

The instruction in https://wiki.archlinux.org/index.php/Ju … stemd_unit are unclear

After following the steps enabling or starting the service with

systemctl start setmtu@enp2s0.service 

A Failed to start error is displayed.

/etc/systemd/system/setmtu@.service
[Unit]
Description=Set mtu on device
Before=network.target

[Service]
Type=oneshot
EnvironmentFile=/etc/conf.d/setmtu
ExecStart=/usr/bin/ip link set dev %i up mtu ${%i}

[Install]
WantedBy=multi-user.target
/etc/conf.d/setmtu
enp1s0=9000
enp2s0=9000

Last edited by theking2 (2015-11-21 13:05:13)


archlinux on a Gigabyte C1037UN-EU, 16GiB
a Promise  PDC40718 based ZFS set
root on a Samsung SSD PB22-J
running LogitechMediaServer(-git), Samba, MiniDLNA, TOR

Offline

#2 2015-11-21 12:59:27

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,732
Website

Re: [SOLVED] systemctl instructions unclear

theking2 wrote:
ExecStart=/usr/bin/ip link set dev %i up mtu ${%i}

Does the command work in isolation?

Try binding the .sevice to the device:

[Unit]
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device

Please post the full error message and the output of:

systemctl status setmtu@enp2s0

Offline

#3 2015-11-21 13:00:00

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: [SOLVED] systemctl instructions unclear

`systemctl status setmtu@enp2s0.service` will tell you more, as will `journalctl -u setmtu@enp2s0.service`

Offline

#4 2015-11-21 13:04:55

theking2
Banned
From: Romanshorn Switzerland
Registered: 2009-03-04
Posts: 372

Re: [SOLVED] systemctl instructions unclear

Thanks Spider.007 and Head_on_a_Stick

I had put the setmtu@.service file in /etc/systemd/ instead. Moving it to /etc/systemd/system makes it working perfectly.

The instructions are clear. It was my mind that was clouded.

Although what is really confusing is what I find under
https://wiki.archlinux.org/index.php/Ne … eue_length

is the udev method preferable over systemd?

Last edited by theking2 (2015-11-21 13:06:45)


archlinux on a Gigabyte C1037UN-EU, 16GiB
a Promise  PDC40718 based ZFS set
root on a Samsung SSD PB22-J
running LogitechMediaServer(-git), Samba, MiniDLNA, TOR

Offline

Board footer

Powered by FluxBB