/srv/irclogs.ubuntu.com/2019/11/29/#ubuntu-server.txt

linuxperiahi all. i have a strange problem with ubuntu server. when i try to compile a programm i get this error here => "error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory" libtinfo however exist on my system and is located at /usr/lib/x86_64-linux-gnu/libtinfo.so What is wrong and how can i fix this Problem ?00:41
mybalzitchdo you have a so.5 symlink to libtinfo ?00:49
mybalzitchlinuxperia: ^00:51
linuxperiamybalzitch: thank you very much for your helpfull tip. i just looked it up and this is how it looks like on my side => it points to version 6 instead 5 => /usr/lib/x86_64-linux-gnu/libtinfo.so -> /lib/x86_64-linux-gnu/libtinfo.so.600:52
mybalzitchyes, create another symlink pointing libtinfo.so.5 to libtinfo.so.600:52
linuxperiaso i need change then the version in the code to use 6 instead 5 and then everything should be perfect. ahh okey this will work also. thank you very much will do it and report back00:53
mybalzitchor recompile, yeah00:53
linuxperiaYes got one step further. now it complains that /lib/x86_64-linux-gnu/libtinfo.so.5: version `NCURSES_TINFO_5.0.19991023' not found looks like need older ncurses hmmm00:56
linuxperiamybalzitch: thank you very much for your helpfull tip with the symlink. you helped me recognize the problem!00:58
mybalzitchno problem! hope you get it sorted00:58
=== mIk3_09 is now known as mIk3_08
=== mIk3_09 is now known as mIk3_08
=== im0nde_ is now known as im0nde
vlmhow can i bind sshd to an address that works through reboots? If i bind to address and manually restart daemon it works but it doesnt manage to bind to address upon booting,journalctl shows failed: "Cannot assign requested address fatal: Cannot bind to any address"10:49
tomreyn this sounds like the ip address you're having sshd listen on isn't bound to an interface by the time sshd is starting.11:03
tomreynyou could either bind sshd to a different systemd target which ensures that the ip address has been bound to the interface, or make sshd listen on ANY and set up firewall restrictions to limit where inbound copnnections will be accepted from / to11:04
tomreynvlm: ^11:05
vlmtomreyn: ill try those options thanks11:28
rbasakvlm: if you're using netplan with networkd or networkd on its own, then "systemctl list-units" will show you the After= target to use. For example mine is sys-subsystem-net-devices-enp0s31f6.device.12:39
vlmrbasak: nice tip ill give it ago aswell!13:17
vlmseems had it right first time only i had a spelling error, network.online.target instead of network(-)online.target,would it be any advantages with your approach rbasak?13:37
rbasakvlm: network-online.target is vague if you have multiple NICs.13:42
rbasakOr hotplug any NICs.13:42
rbasakvlm: see https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/13:42
rbasakSo if you're binding to an address on a specific device and need to start a service only when that address is ready, the best thing is to start the service only when that specific device is up.13:44
rbasakBut as tomreyn said, better to avoid that situation altogether.13:44
rbasakWhy do you need to bind ssh to a specific address anyway?13:44
vlmI was reading the link earlier on but missed that,seems its not so dependable,it works on a test system but on the server i need it doesnt,i just want to restrict traffic,i knew i could do it in firewall but got curious to how come sshd  wouldnt14:21
vlmbind on reboot so started researching14:21
rbasakIdeally sshd would adapt dyamically as the systemd documentation page describes14:27
rbasakFailing that, I'm not sure I would trust the firewall configuration on its own14:27
rbasakMaybe use Match, DenyUsers and AllowUsers directives in sshd_config and test that independently to ensure it's working as expected.14:28
rbasakAnd then add a firewall configuration on top of that14:28
vlmrbasak: seems like a good idea indeed,more layers of security is nice so if the one fails we got backup,started poke around pam access.conf and host.deny aswell15:43
rbasakvlm: I would pick two only. More complexity means more likelyhood of a mistake :)15:50
sdezielvlm: to build on rbasak's suggestion, "Match LocalAddress" would probably be useful to you15:54
vlmrbasak: it could get too much also, usually i document stuff i do when it get complexed so common faults that may occur in such situations i can easily resolve,have helped me alot when things go wrong16:21
vlmsdeziel: yes that was what i was thinking aswell thanks for chime in16:21
vlmsdeziel: or i was thinking might be an option to Match ThisIp or so ,its nice to have options atleast to secure in many ways is my thought16:21
rbasakbryce: around?19:36
rbasakbryce: I implemented the mk_commit refactoring you requested19:36
rbasakBut I ended up doing it as a constructor method (a classmethod) in repo_builder.Commit.19:37
rbasakQuestion: do you want a test for that? It's entirely within the test infrastructure so not used in production, and it's being fully exercised by the tests.19:37
rbasakHere's the implementaton: https://git.launchpad.net/~racb/usd-importer/diff/gitubuntu/repo_builder.py?h=importer-add-tests&id=a0f087ec7539a909ee01bdb68820693fc301212219:38
rbasak(the branch is still a work in progress)19:38
rbasakIn general I'm not sure what our policy needs to be for testing the test helpers19:39
mbeierlHello.  I am looking to find the difference between Ubuntu cloud images (from https://cloud-images.ubuntu.com/bionic/20191127/ ) with .img and .vmdk extensions.  When I use the .vmdk under VMware vCloud Director, it boots, but converting the .img to .vmdk causes it to hang.  I have other .imq and .qcow2 images that I want to convert and they all exhibit the same behaviour.20:31
crodriguezHello, I have a question regarding netplan in ubuntu 20.04. For a server with 3 interfaces with each their own gateway, how does networkd determines the default gateway? It seems like ip route get always returns the right interface,  I'm trying to understand how it chooses the correct interface as its default gateway. I haven't defined any route in the netplan config.20:32
brycerbasak, yep just back from lunch20:39
brycehmm good question on testing test helpers20:39
brycein other projects I've not tended to worry about testing test helpers, since the testsuite itself exercises the code adequately most of the time20:40
brycebut for more complex helpers, or if it helps in doing the development, I suppose no reason not to allow them20:41
brycerbasak, that said, since this code would live in the main code rather than purely in a *_test.py file, a test case would probably be appropriate20:45
rbasakOK, thanks. I'll add some tests for it.20:45
rbasak...on Monday. Enjoy your weekend :)20:47
bryceI imagine monkeypatch could be an alternate way to do it.  No idea how easy/hard that'd be though.20:48
brycerbasak, right, cya monday!20:48
brycebtw I (might) have jury duty next week20:49
rbasakOK20:50
ericlafontaineHi, my name is Eric Lafontaine and I was told that some people over here could help me understand a behaviour with the networking/kernel21:47
ericlafontaineI'm having a server with 3 NIC using DHCP and all having gateways.  The behaviour I'm seeing is that the kernel is able to know that the last interface should always be the default gateway interface, whatever bouncing of the interface I do.  This seems like magic to me and I'm trying to understand how come.  all 3 default routes are present, but it's always the last interface that is used by21:53
ericlafontaine the kernel as the route to internet.21:53
ericlafontaine(I have this behaviour with the base image of Ubuntu 20.04 )21:54
ericlafontaine(on an openstack environment)21:54
=== ysch_ is now known as ysch
crodriguezericlafontaine: hi ! I think rbasak will be able to help you out. Maybe he's EOD though, might have to wait for Monday22:04
rafaeldtinocoericlafontaine: why would u have 3 gateways ?!22:07
ericlafontaineHi @crodriguez, thanks.  If anyone else want more details/are curious, please contact me directly :)22:07
ericlafontaineI'm putting a router in place to abstract network complexity.22:08
rafaeldtinocook but what is the purpose of having 3 gateways ?22:08
rafaeldtinocoyou want to load balance traffic among all 3 ?22:08
ericlafontaineIt's my first time using an IRC, so I'm not sure if I should try to summarize or go all out on explanations...22:11
rafaeldtinocojust answer the question22:12
rafaeldtinocoits easier =)22:12
rafaeldtinocoericlafontaine: you have 3 net providers and want to load balance among them ? is that it ?22:12
rafaeldtinocoor something like it ?22:12
ericlafontainebasically, I have an intranet for which my "router" will be acting as the gateway (ubuntu server) for other servers on the intranet.  The second network is another intranet for which some routes are provided (this one doesn't actually have a gateway, but dhcp put's one in anyway... bug? maybe, didn't get time).  The third interface is the real external network and should stick to being my de22:14
ericlafontainefault gateway whatever happens.22:14
ericlafontaineI get the behaviour I want, but I can't explain how it works, which is troubling me.22:15
rafaeldtinocoericlafontaine: dhclient can drop gateway22:15
rafaeldtinocofor example22:15
rafaeldtinocoits not because dhcp server gives you HAVE to use =)22:16
rafaeldtinococheck /etc/dhcp/dhclient.conf22:16
rafaeldtinocoyou can configure an interface not to "request" routers, for example, but request everything else22:16
rafaeldtinocoyou can request only IP, or IP and NTP, IP and DNS, etc22:16
ericlafontaineI found that it's using the systemd-networkd and whatever bouncing of interface I do, my last interface stays the default interface.  I would have expected this to be like dhclient behavior you're describing, but it wasn't dhclient22:16
rafaeldtinocoah gotcha22:17
rafaeldtinocoso you're using netplan22:17
ericlafontaineyes22:17
rafaeldtinocowith systemd-networkd backend22:17
ericlafontainedefault 20.04 ubuntu server22:17
rafaeldtinocook lets check how to drop dhcp options in systemd22:17
rafaeldtinoco20.04 ? (focal ?)22:17
rafaeldtinocoits -devel22:17
ericlafontaineI know :)22:17
ericlafontainestill it does what I need it to do22:17
rafaeldtinocook22:17
ericlafontainewhich is why I was looking at it22:17
ericlafontainemy problem is that I don't understand how it can keep the last interface whatever "bouncing" I do...22:18
ericlafontaineIt's an happily nice behaviour :) I just can't explain it22:19
rafaeldtinocolooks like22:19
rafaeldtinocohttps://github.com/systemd/systemd/issues/513422:19
rafaeldtinocothe feature you're looking for was in this issue22:19
rafaeldtinocohttp://man7.org/linux/man-pages/man5/systemd.network.5.html22:22
rafaeldtinococheck [DHCP] section22:22
rafaeldtinocoUseRoutes=22:22
rafaeldtinoco           When true (the default), the static routes will be requested from22:22
rafaeldtinoco           the DHCP server and added to the routing table with a metric of22:22
rafaeldtinoco           1024, and a scope of "global", "link" or "host", depending on the22:22
rafaeldtinoco           route's destination and gateway. If the destination is on the22:22
rafaeldtinoco           local host, e.g., 127.x.x.x, or the same as the link's own22:22
rafaeldtinoco           address, the scope will be set to "host". Otherwise if the22:22
rafaeldtinoco           gateway is null (a direct route), a "link" scope will be used.22:22
rafaeldtinoco           For anything else, scope defaults to "global".22:22
rafaeldtinocoyou can change the generated systemd file22:22
rafaeldtinocoand UseRouters=false22:22
rafaeldtinocoUseRoutes=false22:22
rafaeldtinocofor the interfaces you don't want a gateway set22:22
rafaeldtinoco(for example)22:23
ericlafontainemy network configuration only had [DHCP] active, nothing else22:23
rafaeldtinocolet me check if netplan supports it22:23
rafaeldtinocohttps://netplan.io/examples22:23
rafaeldtinocoit shows an option22:23
rafaeldtinoco"dhcp4-overrides22:23
rafaeldtinocoConnecting multiple interfaces with DHCP22:23
rafaeldtinococheck this there ^22:24
rafaeldtinocosuggestion they give is to raise the route metric22:24
rafaeldtinocoso the default router is used by your main interface22:24
rafaeldtinocoand the other gateways are "ignored"22:24
rafaeldtinocobecause they have a big metric22:24
rafaeldtinocodid you check that ? have you tried ?22:24
ericlafontaineyes, all my interfaces turned out to have the same metric...22:25
rafaeldtinocoeven using the override ?22:25
ericlafontaineI haven't tried any change, I just tried to understand how the kernel knew...22:25
ericlafontainecan i send you the routes and netpan?22:25
ericlafontaineI have those with me.22:26
rafaeldtinocoericlafontaine: if you put 3 gateways with same weight22:26
rafaeldtinocoor metric in this case22:26
rafaeldtinocokernel will round robin among them22:26
rafaeldtinocoso you will use tcp retransmissions22:26
ericlafontainethat's what I would've had expected22:26
rafaeldtinocoah thats the default behaviour22:26
rafaeldtinocoand its designed that way22:26
rafaeldtinocobecause you are using the same routing table22:26
rafaeldtinoco(without knowing)22:26
rafaeldtinocokernel has multiple routing tables you could use22:26
ericlafontaineyeah, I would have expected that, but it didn't do that22:26
rafaeldtinocoit didnt ?22:27
ericlafontainewhich is why I don't understan22:27
rafaeldtinocowhat did it do ?22:27
ericlafontaineit stuck with the "highest" interface in the order "ens5" > "ens4" > "ens3"22:27
ericlafontaineI've been starting to read about the kernel internal structure to understand22:28
ericlafontainefib_tree, etc.22:28
ericlafontaineso trying to see what am I missing22:28
rafaeldtinocoso it always used the latest default router22:29
ericlafontaineI was expecting to be kicked out of the server when I restarted "ens4" but that didn't happen22:29
rafaeldtinocoroutes are cached for existing connections22:29
ericlafontaineip route show cache is always empty22:29
ericlafontainemaybe I didn't bound the interface the right way?22:30
rafaeldtinocowell you didnt assign them weights22:30
ericlafontaine"ip link set down dev ens4" ?22:30
rafaeldtinocoso im not sure the correct behavior nowadays22:30
ericlafontaineI didn't and cloud-init gave them 100 I believe by default22:30
rafaeldtinocothe old behavior was:22:30
rafaeldtinocohttps://www.tldp.org/HOWTO/Adv-Routing-HOWTO/lartc.rpdb.multiple-links.html22:30
rafaeldtinocoahhhhhhh actually22:31
rafaeldtinocothe old behavior without weights22:31
rafaeldtinocowas not to load balance at all22:31
rafaeldtinocowas to use latest default gateway22:31
rafaeldtinoco#)22:31
ericlafontaine?22:31
rafaeldtinocoso if you're using the same routing table22:31
rafaeldtinocowhich likely you are22:31
ericlafontaine(by the way, I really appreciate :) I spent 1-2 days on this, and curiosity was killing me )22:31
rafaeldtinocoand you add 3 routes to 0.0.0.022:31
rafaeldtinocoonly the last one will work22:31
rafaeldtinocothat is what happened to you right ?22:31
rafaeldtinocoBUT if you have different routing tables22:32
rafaeldtinocothen you can assign them weights22:32
rafaeldtinocoand load balance among them22:32
rafaeldtinocobut you have to have different routing tables22:32
rafaeldtinoconot the same one22:32
rafaeldtinocobecause the rules have hierarchy22:32
rafaeldtinocoif you satisfied the route, you dont need another22:32
ericlafontaineit's rules over route tables, right?22:32
rafaeldtinocoyep22:32
ericlafontaine30 sec22:33
ericlafontaineI'll go on the server22:33
rafaeldtinocosure22:33
ericlafontaineI might lose my connectivity...22:33
rafaeldtinoco#(22:33
ericlafo_Alright, I'm back22:39
rafaeldtinocook22:40
ericlafo_so I can send you the all the routing I have on the server22:40
rafaeldtinocoso.. 1st things 1st22:40
rafaeldtinocoyou're using netplan to configure its nics22:40
rafaeldtinococorrect ?22:40
ericlafo_yes22:40
rafaeldtinococan I see your /etc/netplan/* files ?22:40
rafaeldtinocoin order for that22:40
rafaeldtinocoyou can pastebin them22:41
rafaeldtinocoits easer =)22:41
ericlafo_here?22:41
rafaeldtinocopaste.ubuntu.com22:41
rafaeldtinocopaste there and get me a likn22:41
ericlafo_https://paste.ubuntu.com/p/mw9fGR3QtK/22:42
ericlafo_I'll get you the routing table as well22:42
rafaeldtinocoalright22:43
ericlafo_https://paste.ubuntu.com/p/Z5t9qhzn4V/22:43
ericlafo_routing ^22:43
rafaeldtinocodefault via 198.18.200.1 dev ens5 proto dhcp metric 10022:46
rafaeldtinocodefault via 192.168.128.1 dev ens4 proto dhcp metric 10022:46
rafaeldtinocodefault via 192.168.129.1 dev ens3 proto dhcp metric 10022:46
rafaeldtinocoso they're all in the same routing table22:47
rafaeldtinocowith the same metric22:47
rafaeldtinocoonly the latest interface (to get dhcp)22:47
ericlafo_yup22:47
rafaeldtinocowill have an operatinal gateway22:47
rafaeldtinocoyou should drop the gateways you dont need22:47
ericlafo_The behaviour I have is the ens5 can be the only interface not bounced and it still would be the default gateway used.22:48
rafaeldtinocowhat do you mean by bounced ?22:48
ericlafo_"ip link set down ens3"22:49
ericlafo_"ip link set up ens3"22:49
rafaeldtinocoah gotcha22:49
rafaeldtinocoso a reset22:49
rafaeldtinocoif you reset a nic then you lose the default gw22:49
rafaeldtinocoand then you lose conectivity22:49
rafaeldtinocobecause the other one becomes operational22:49
rafaeldtinocois that it ?22:50
ericlafo_nope, I'm not losing my connectivity...22:50
rafaeldtinocolose conectivity meaning nic down / nic up again22:50
ericlafo_ens5 stays my default gateway in the server22:50
rafaeldtinocobecause its your last added gateway22:50
ericlafo_which is the behaviour I wanted but I don't get how it works22:50
ericlafo_what do you mean by "last added"?22:51
rafaeldtinocoif you do this:22:51
rafaeldtinocoroute add default gw 1.1.1.122:51
rafaeldtinocoroute add default gw 2.2.2.122:51
rafaeldtinocoroute add default gw 3.3.3.122:51
rafaeldtinocoall 3 have the same metric22:51
rafaeldtinocokernel will only reach 2.2.2.1 if 3.3.3.1 can't be reached22:51
rafaeldtinocono ?22:51
ericlafo_well that wasn't what I would have expected since I removed the dhcp interface, no?22:53
ericlafo_so I would have expected the route to be re-applied when I was bringing the interface up again22:53
rafaeldtinocoooooooooooo22:53
rafaeldtinocono you did not remove the ip22:53
rafaeldtinocoits a real nic22:53
rafaeldtinocoif it was a virtual nic.. you would have dropped the nick22:54
rafaeldtinocolike veth0 for example22:54
rafaeldtinocobut for a real one22:54
rafaeldtinocoIP stays there if you up/down22:54
rafaeldtinocohave u shutdown the networkd for that nic ?22:54
ericlafo_nope, I didn't find individual interface services22:55
ericlafo_   26  systemctl status sys-subsystem-net-devices-ens3.device22:55
ericlafo_   27  systemctl restart sys-subsystem-net-devices-ens3.device22:55
ericlafo_I did try this though;22:55
ericlafo_but it was denied as an operation22:55
rafaeldtinocoare you root ?22:56
rafaeldtinoco=)22:56
ericlafo_yup22:56
rafaeldtinocothis is the device itself22:56
rafaeldtinocoits a .device unit file22:56
rafaeldtinocoso it wont restart22:56
rafaeldtinocoits internal to systemd22:56
ericlafo_so what would the service be named?  I only found the "systemd-networkd" service which seemed to manage all interfaces22:56
ericlafo_(did I say that I really appreciate?  I really do :) I've been struggling to understand )22:58
rafaeldtinocolet me get one example here22:59
rafaeldtinocodamn, all my machines are using ifupdown currently22:59
rafaeldtinoco:o)22:59
ericlafo_XD22:59
rafaeldtinocoim unsure you can control the interfaces like a systemd unit23:00
ericlafo_I'll setup my other non-work computer to be able to continue discussing here while having the server connected to tryout stuff23:00
rafaeldtinocoi think you would change your .network files23:00
rafaeldtinocoand restart networkd23:00
rafaeldtinocoand it would reconfig as you want23:00
rafaeldtinoconetworkctl shows the configured nics23:01
ericlafo_I didn't find the .network file in /etc/systemd/network23:01
rafaeldtinocothats the netplan secret23:01
ericlafo_I'll try the networkctl23:01
rafaeldtinocoif you had create the .network files on your own23:01
ericlafo_ha ha !, thanks23:01
rafaeldtinocoyou could put into /etc/systemd/network23:01
rafaeldtinocofor example23:01
rafaeldtinocoyours is probably at23:01
rafaeldtinoco /var/run/systemd/network23:01
rafaeldtinocogive it a try23:02
rafaeldtinococd /var/run/systemd23:02
rafaeldtinocofind . | grep -i network23:02
rafaeldtinocoi gotta go now (dinner time here)23:03
rafaeldtinocoericlafo_: rafaeldtinoco@ubuntu.com23:03
rafaeldtinocodrop me an email if you have any other questios23:03
rafaeldtinocoill try to address if I can23:03
rafaeldtinocoor hang around here23:04
rafaeldtinocowe're always over here =)23:04
ericlafo_alright, thanks :) I'll look through what you provided an email you the conclusions :)23:04
ericlafo_thanks a lot!23:04
rafaeldtinocosure. good luck23:04
rafaeldtinocomy pleasure. take care o/23:04
ericlafo_o/23:04

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!