[Bug 2017840] Re: ifupdown resolved script has typo
CH
2017840 at bugs.launchpad.net
Tue May 2 01:09:31 UTC 2023
After fixing those lines, there's yet another bug:
```
search example.org DOMAINS
```
Somehow it's deciding that the DNS search domains for static interfaces is "DOMAINS". Sample /etc/network/interface file:
```
auto enp3s0
iface enp3s0 inet static
address 172.16.198.5
netmask 255.255.255.0
```
and it creates this file:
```
# cat /run/systemd/resolve/netif/3
# This is private data. Do not parse.
LLMNR=yes
MDNS=no
SERVERS=DNS
DOMAINS=DOMAINS
```
Oh, and when you run `ifup enp3s0` by hand, you get this error:
```
# ifup enp3s0
ifup: interface enp3s0 already configured
# ifdown enp3s0
# ifup enp3s0
mkdir: missing operand
Try 'mkdir --help' for more information.
```
It looks like this error is from line 26 of /etc/network/if-up.d/resolved:
```
if [ ! "$ifindex" ]; then
return
fi
# mystatedir=/run/network
mkdir -p $mystatedir
statedir=/run/systemd/resolve/netif
mkdir -p $statedir
chown systemd-resolve:systemd-resolve $statedir
```
Not sure why mystatedir is commented out, but it looks like that's what's wrong this time.
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/2017840
Title:
ifupdown resolved script has typo
Status in systemd package in Ubuntu:
New
Bug description:
This error happens when you try to run ifup or ifdown:
```
# ifdown enp3s0
/etc/network/if-down.d/resolved: 12: mystatedir: not found
# ifup enp3s0
/etc/network/if-up.d/resolved: 12: mystatedir: not found
```
Here's the first 12 lines of those scripts:
```
# head -n 12 /etc/network/if-up.d/resolved
#!/bin/sh
#
# Script fragment to make ifupdown supply DNS infromation to resolved
#
case "$ADDRFAM" in
inet|inet6) : ;;
*) exit 0 ;;
esac
if systemctl is-enabled systemd-resolved > /dev/null 2>&1; then
mystatedir statedir ifindex interface
```
I'm thinking that the word `local` used to appear before `mystatedir`
on line 12, but that was when it was a function. When it was
converted back from being a function, the 'local' keyword was removed,
but the variables remained.
Either make it into a function again, or delete line 12.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2017840/+subscriptions
More information about the foundations-bugs
mailing list