You have been subscribed to a public bug:

I have a script that is triggered by a udev rule, and that needs to
connect to a remote host.

The example below works fine in 16.04, but fails in 18.04. It seems that
the process executing the script is somehow limited wrt. network access.
The script works fine when started from a shell prompt.

To reproduce:


- create /tmp/myscript:

#/bin/sh
wget -o /tmp/wget.log -O /tmp/index.html http://www.google.com


- create /etc/udev/rules.d/52-netaccess.rules

ACTION=="add", ATTRS{idVendor}=="cafe", MODE="0660", GROUP="root",
SUBSYSTEM=="usbmisc", RUN+="/tmp/myscript"


- Plugin a USB device with vendor ID 0xcafe, and check the wget output in 
/tmp/wget.log. 

On ubuntu 18.04 wget fails with this output:

--2019-08-19 14:49:43--  http://www.google.com/
Resolving www.google.com (www.google.com)... failed: Name or service not known.
wget: unable to resolve host address 'www.google.com'


If I use an IP address in the URL there is no resolve error, but then wget 
blocks in the socket connect() syscall (according to strace). At some point the 
script is killed.

** Affects: systemd (Ubuntu)
     Importance: Undecided
         Status: New

-- 
Script cannot access network when triggered by udev rule
https://bugs.launchpad.net/bugs/1840772
You received this bug notification because you are a member of Ubuntu Touch 
seeded packages, which is subscribed to systemd in Ubuntu.

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to