Fedora-Remix-for-WSL icon indicating copy to clipboard operation
Fedora-Remix-for-WSL copied to clipboard

Using `upgrade.sh` inserts an 'invalid' sudoers line and breaks sudo

Open ElvenSpellmaker opened this issue 2 years ago • 6 comments

Describe the bug Running upgrade.sh results in the following line inside the /etc/sudoers.d/start-systemd file:

%wheel ALL=NOPASSWD: /usr/local/bin/start-systemd

This then causes further sudo commands to fail like the following:

# sudo
>>> /etc/sudoers.d/start-systemd: syntax error near line 6 <<<
sudo: parse error in /etc/sudoers.d/start-systemd near line 6
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

Also I don't have /usr/local/bin/start-systemd on this system at all:

# ls /usr/local/bin/
activate-global-python-argcomplete  pip3.8
az                                  pkginfo
az.bat                              __pycache__
az.completion.sh                    pygmentize
chardetect                          pyjwt
fab                                 pysemver
humanfriendly                       python-argcomplete-check-easy-install-script
inv                                 python-argcomplete-tcsh
invoke                              register-python-argcomplete
jdiff                               sshtunnel
jp.py                               tabulate
jsondiff                            terraform
kubectl                             update.sh
pbr                                 upgrade.sh
pip                                 wheel
pip3                                wsdump.py

I can continue to upgrade by getting into root through wsl.exe and then commenting out this line and just continue the upgrade process as shown in the blog posts which appears to work.

To Reproduce Steps to reproduce the behavior:

  1. Run upgrade.sh

Expected behavior upgrade.sh should work without errors.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context My WSL install is an older version which is now on Fedora 35, but it probably was installed as something like version 32 initially, from Github, not through the Windows Store.

Basic Troubleshooting Checklist

[x] I have searched Google for the error message. [x] I have checked official WSL troubleshooting documentation: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#confirm-wsl-is-enabled. [x] I have searched the official Microsoft WSL issues page: https://github.com/Microsoft/WSL/issues. [x] I have searched the WLinux issues page: https://github.com/WhitewaterFoundry/WLinux/issues. N/A - [ ] I have reset WLinux: Settings->Apps->Apps & features->WLinux->Advanced Options->Reset. [ ] I have disabled and re-enabled WSL in Windows Features. [x] I have run Windows 10 updates and restarted.

What other troubleshooting have you attempted?

Insert here:

WLinux Version

Find: Settings->Apps->Apps & features->WLinux->Advanced Options->Version.

I have nothing under that name in that screen.

Insert here:

Windows Build

Run 'systeminfo | findstr /C:"OS"' in Command Prompt and insert here:

OS Name:                   Microsoft Windows 10 Enterprise
OS Version:                10.0.19043 N/A Build 19043
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
BIOS Version:              Dell Inc. 1.24.0, 10/08/2021

ElvenSpellmaker avatar Jul 06 '22 07:07 ElvenSpellmaker

Hello @ElvenSpellmaker,

The upgrade.sh script has changed a lot among versions, and it fails the first time is run. Please run the upgrade.sh script until you don't see any error.

We are now updating the upgrade.sh script in a way that it won't generate errors when it updates itself. But everyone needs to update the script to this version, and the way is running over and over (usually twice) until you see no errors.

Regards

crramirez avatar Jul 19 '22 08:07 crramirez

Hello @ElvenSpellmaker,

We fixed the /etc/sudoers.d/start-systemd file to avoid this error.

Regards, Carlos

crramirez avatar Jul 31 '22 12:07 crramirez

Hello @ElvenSpellmaker,

We fixed the /etc/sudoers.d/start-systemd file to avoid this error.

Regards, Carlos

Hey, thanks for getting back again. If I re-run the upgrade.sh file now will this erorr be resolved, or should I do something else to resolve it please?

ElvenSpellmaker avatar Jul 31 '22 12:07 ElvenSpellmaker

Make sure that sudo is working before running upgrade.sh. Then run it, the error should go away

crramirez avatar Jul 31 '22 12:07 crramirez

@crramirez Excellent thanks, that's made the error go away and sudo is now usable again. Thanks again!

EDIT: Just followed the instructions to upgrade to 36 from 35 and it upgraded flawlessly with no problems, thanks. 🙂

ElvenSpellmaker avatar Jul 31 '22 12:07 ElvenSpellmaker

Excellent!

crramirez avatar Jul 31 '22 13:07 crramirez