Skip to content

nc: invalid option -- 'U' #6645

@harmonydzen-blip

Description

@harmonydzen-blip

Bug report

We are using cloud-init with openstack. On previous version cloud-init 23.4.1, everything worked fine. But after update cloud-init on version 25.1.1, our vm in openstack stop to recieve ip adress that was configured in openstack. And We are not able to connect by ssh to the server after updating on cloud-init 25.1.1.

In logs we see next messages:

[[0;32m  OK  [0m] Reached target [0;1;39mMulti-User System[0m.
         Starting [0;1;39mCloud-init: Final Stage[0m...
[  126.055067] sh[728]: nc: invalid option -- 'U'
[  126.056537] sh[728]: Try `nc --help' for more information.

We are using netcat GNU version 0.7.1.
We are tried to change netcat on netcat-openbsd 1.195 but it didn't help we start to recieve next logs:

[[0;32m  OK  [0m] Started [0;1;39mCloud-init: Single Process[0m.
         Starting [0;1;39mCloud-init: Local Stage (pre-network)[0m...
[    3.446701] sh[391]: usage: nc [-46CDdFhklNnrStUuvZz] [-I length] [-i interval] [-M ttl]
[    3.448029] sh[391]:       [-m minttl] [-O length] [-P proxy_username] [-p source_port]
[    3.449241] sh[391]:       [-q seconds] [-s source] [-T keyword] [-V rtable] [-W recvlimit] [-w timeout]
[    3.450565] sh[391]:       [-X proxy_protocol] [-x proxy_address[:port]]       [destination] [port]
[[0;32m  OK  [0m] Finished [0;1;39mCloud-init: Local Stage (pre-network)[0m.

We have read this issues:
#6499
mperham/inspeqtor#163
And we don't understand how package nmap can help ? If We decide to try to use nmap package what we need to changes in our services files?

Also for example if we decide to use socat instead netcat what we need to change in service files?
Change from nc to socat in all services files something like this?

cloud-config.service
ExecStart=sh -c 'echo "start" | socat /run/cloud-init/share/config.sock -s /run/cloud-init/share/config-return.sock | sh'

cloud-final.service
ExecStart=sh -c 'echo "start" | socat /run/cloud-init/share/final.sock -s /run/cloud-init/share/final-return.sock | sh'

cloud-init-local.service.tmpl
ExecStart=sh -c 'echo "start" | socat /run/cloud-init/share/local.sock -s /run/cloud-init/share/local-return.sock | sh'


cloud-init-network.service
ExecStart=sh -c 'echo "start" | socat /run/cloud-init/share/network.sock -s /run/cloud-init/share/network-return.sock | sh'

Environment details

  • Cloud-init version: 25.1.1
  • Operating System Distribution: Custom distributive build with yocto
  • netcat-openbsd 1.195
  • netcat GNU version 0.7.1
  • Installer type: rpm

cloud-init logs

netcat GNU version 0.7.1.

[[0;32m  OK  [0m] Reached target [0;1;39mMulti-User System[0m.
         Starting [0;1;39mCloud-init: Final Stage[0m...
[  126.055067] sh[728]: nc: invalid option -- 'U'
[  126.056537] sh[728]: Try `nc --help' for more information.

netcat-openbsd 1.195

[[0;32m  OK  [0m] Started [0;1;39mCloud-init: Single Process[0m.
         Starting [0;1;39mCloud-init: Local Stage (pre-network)[0m...
[    3.446701] sh[391]: usage: nc [-46CDdFhklNnrStUuvZz] [-I length] [-i interval] [-M ttl]
[    3.448029] sh[391]:       [-m minttl] [-O length] [-P proxy_username] [-p source_port]
[    3.449241] sh[391]:       [-q seconds] [-s source] [-T keyword] [-V rtable] [-W recvlimit] [-w timeout]
[    3.450565] sh[391]:       [-X proxy_protocol] [-x proxy_address[:port]]       [destination] [port]
[[0;32m  OK  [0m] Finished [0;1;39mCloud-init: Local Stage (pre-network)[0m.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working correctlybug: downstreamThis issue was filed against the upstream bug tracker but is a downstream issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions