I've also encountered this bug in Ubuntu 22.04 LTS. I'd get an error in
/etc/network/if-up.d/resolved unless I change 'return' to 'exit' in the
affected line. After the change I'd no longer encounter an error.

I have /bin/sh symlinked to bash as requirement to build some software.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to ifupdown in Ubuntu.
https://bugs.launchpad.net/bugs/2004003

Title:
  /etc/network/if-up.d/resolved: line 20: return: can only `return' from
  a function or sourced script

Status in ifupdown package in Ubuntu:
  Confirmed

Bug description:
  Just found the following errors in "systemctl status networking"

  × networking.service - Raise network interfaces
       Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor 
preset: enabled)
       Active: failed (Result: exit-code) since Fri 2023-01-27 12:26:29 MSK; 
3min 10s ago
         Docs: man:interfaces(5)
      Process: 3963 ExecStart=/sbin/ifup -a --read-environment (code=exited, 
status=1/FAILURE)
     Main PID: 3963 (code=exited, status=1/FAILURE)
          CPU: 147ms

  янв 27 12:26:29 gerbera systemd[1]: Starting Raise network interfaces...
  янв 27 12:26:29 gerbera ifup[3976]: /etc/network/if-up.d/resolved: line 12: 
mystatedir: command not found
  янв 27 12:26:29 gerbera ifup[3973]: /etc/network/if-up.d/resolved: line 20: 
return: can only `return' from a function or sourced script
  янв 27 12:26:29 gerbera ifup[3969]: run-parts: /etc/network/if-up.d/resolved 
exited with return code 2
  янв 27 12:26:29 gerbera ifup[3963]: ifup: failed to bring up lo
  янв 27 12:26:29 gerbera systemd[1]: networking.service: Main process exited, 
code=exited, status=1/FAILURE
  янв 27 12:26:29 gerbera systemd[1]: networking.service: Failed with result 
'exit-code'.
  янв 27 12:26:29 gerbera systemd[1]: Failed to start Raise network interfaces.

  The error with mystatedir has been already reported as bug#1907878.
  However, patches there do not fix unexpected return statement.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/2004003/+subscriptions


-- 
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