2

The command netplan apply returns some errors when I execute it as root user.

root@szyf1272:/etc/netplan# netplan apply

System has not been booted with systemd as init system (PID 1). Can't operate. System has not been booted with systemd as init system (PID 1). Can't operate. Traceback (most recent call last): File "/usr/sbin/netplan", line 23, in <module> netplan.main() File "/usr/share/netplan/netplan/cli/core.py", line 50, in main self.run_command() File "/usr/share/netplan/netplan/cli/utils.py", line 186, in run_command self.func() File "/usr/share/netplan/netplan/cli/commands/apply.py", line 46, in run self.run_command() File "/usr/share/netplan/netplan/cli/utils.py", line 186, in run_command self.func() File "/usr/share/netplan/netplan/cli/commands/apply.py", line 116, in command_apply utils.systemctl_networkd('stop', sync=sync, extra_services=wpa_services) File "/usr/share/netplan/netplan/cli/utils.py", line 86, in systemctl_networkd subprocess.check_call(command) File "/usr/lib/python3.6/subprocess.py", line 311, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['systemctl', 'stop', '--no-block', 'systemd-networkd.service', 'netplan-wpa-*.service']' returned non-zero exit status 1.

Lorenz Keel
  • 8,905
LeonardoEzio
  • 21
  • 1
  • 2

1 Answers1

0

This error is returned from systemd in response to the command:

systemctl stop --no-block systemd-networkd.service 'netplan-wpa-*.service'

This checks whether /run/systemd/system exists and is accessible.

This is always true on a correctly booted Ubuntu 20.04 system.

I don't know what you might have done to cause this directory to be absent, but such a system is badly broken and unsupportable.

slangasek
  • 5,562