jpetazzo / pipework

Software-Defined Networking tools for LXC (LinuX Containers)
Apache License 2.0
4.22k stars 727 forks source link

Pipework with systemd fails when ovs-vsctl is missing #62

Closed f0 closed 10 years ago

f0 commented 10 years ago

Hi, when ovs-vsctl tools are not installed, using pipework with systemd fails, as systemd exists if some commad coms back with $?=1

regards f0

jpetazzo commented 10 years ago

I am sorry, I don't understand; can you elaborate a bit? Thank you!

f0 commented 10 years ago

Hi,

this code:

elif $(which ovs-vsctl >/dev/null) && $(ovs-vsctl list-br|grep -q ^$IFNAME$)
    then
IFTYPE=bridge
        BRTYPE=openvswitch
    else IFTYPE=phys
    fi

checks if ovs-vctl is installed , if i run this via systemd on my coreos system, the systemd fails because the return code from which ovs-vsctl >/dev/null is 1.

If i comment out this, it works without problems

regards f0

bcicen commented 10 years ago

So you're presumably specifying on a physical interface with the intention of pipework creating a virtual subinterface? Can you post what's in your .service file where you're using it?

f0 commented 10 years ago

this for e.g

[Unit]
Description =  Jenkins Instance
After= network.service

[Service]
ExecStart=/bin/bash -c '/usr/bin/docker run --rm --net=none --name jenkins-test index.dvag.com:5000/jenkins:1.532.3-1'
ExecStartPost=/bin/bash -c '/srv/tools/pipework enp16s0f0 -i eth0 jenkins-test 10.61.12.133/32@10.61.12.1'
ExecStop=/usr/bin/docker stop jenkins-test
Restart=always
MemoryLimit=8G

[Install]
WantedBy=local.target
jpetazzo commented 10 years ago

Do you still have this problem? Were you able to work around it, per chance?

f0 commented 10 years ago

i can check this next week

f0 commented 10 years ago

ok i have checked this, i can not reproduce with the latest pipework, whyever the code for this does not have changed.