Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SUSEConnect --cleanup does not cleanup all credentials and services files #242

Open
thimslugga opened this issue Jun 10, 2024 · 0 comments
Labels
help wanted Extra attention is needed

Comments

@thimslugga
Copy link

thimslugga commented Jun 10, 2024

Issue

The SUSEConnect --cleanup command doesn't appear to do as one would expect based on the description the man pages. Only the /etc/zypp/credentials.d/SCCcredentials file is cleaned up. The other credential files in /etc/zypp/credentials.d/ directory are left behind and so are the service(s) files in the /etc/zypp/services.d. As a side effect, this seems to cause the first run of the registercloudguest --force-new to not be able to register the other products on the first run, which requires running the command a second time.

From the man page i.e. man 8 SUSEConnect:

       --cleanup
              Remove old system credentials and all zypper services installed by SUSEConnect.
# SUSEConnect -h
...
        --cleanup            Remove old system credentials and all zypper
                             services installed by SUSEConnect.
...

Test system

ami-0d85a662720db9789 - suse-sles-12-sp5-v20240308-hvm-ssd-x86_64

ip-10-10-11-205:/etc/zypp/services.d # cat /etc/os-release
NAME="SLES"
VERSION="12-SP5"
VERSION_ID="12.5"
PRETTY_NAME="SUSE Linux Enterprise Server 12 SP5"
ID="sles"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:12:sp5"

ip-10-10-11-205:/etc/zypp/services.d # zypper up -y suseconnect-ng

ip-10-10-11-205:/etc/zypp/services.d # rpm -qa | grep -E 'zypper|suseconnect-ng|SUSEConnect|regionsrv-client|regionServiceClientConfig'
zypper-1.13.65-21.58.2.x86_64
regionServiceClientConfigEC2-4.1.1-4.23.1.noarch
cloud-regionsrv-client-plugin-ec2-1.0.4-52.108.1.noarch
cloud-regionsrv-client-10.1.7-52.108.1.noarch
suseconnect-ng-1.9.0-3.15.4.x86_64

Related Output

Run SUSEConnect --cleanup, no news is good news i.e. there's no output from this command.

ip-10-10-11-205:~ # SUSEConnect --cleanup

Only the SCCcredentials file is cleaned up:

ip-10-10-11-205:/etc/zypp/credentials.d # ls -al /etc/zypp/credentials.d
total 40
drwxr-xr-x 2 root root 4096 Jun 10 15:26 .
drwxr-xr-x 9 root root  202 Mar  7 12:45 ..
-rw------- 1 root root   72 Jun 10 15:22 Advanced_Systems_Management_Module_x86_64
-rw------- 1 root root   72 Jun 10 15:22 Containers_Module_x86_64
-rw------- 1 root root   72 Jun 10 15:22 HPC_Module_x86_64
-rw------- 1 root root   72 Jun 10 15:22 Legacy_Module_x86_64
-rw------- 1 root root   72 Jun 10 15:22 Public_Cloud_Module_x86_64
-rw------- 1 root root   72 Jun 10 15:22 SUSE_Linux_Enterprise_Server_x86_64
-rw------- 1 root root   72 Jun 10 15:22 SUSE_Linux_Enterprise_Software_Development_Kit_x86_64
-rw------- 1 root root   72 Jun 10 15:22 Toolchain_Module_x86_64
-rw------- 1 root root   72 Jun 10 15:22 Web_and_Scripting_Module_x86_64

Services files still exist:

ip-10-10-11-205:/etc/zypp/services.d # ls -al /etc/zypp/services.d/
total 40
drwxr-xr-x 2 root root 4096 Jun 10 15:22 .
drwxr-xr-x 9 root root  202 Mar  7 12:45 ..
-rw-r--r-- 1 root root  887 Jun 10 15:22 Advanced_Systems_Management_Module_x86_64.service
-rw-r--r-- 1 root root  708 Jun 10 15:22 Containers_Module_x86_64.service
-rw-r--r-- 1 root root  624 Jun 10 15:22 HPC_Module_x86_64.service
-rw-r--r-- 1 root root  660 Jun 10 15:22 Legacy_Module_x86_64.service
-rw-r--r-- 1 root root  732 Jun 10 15:22 Public_Cloud_Module_x86_64.service
-rw-r--r-- 1 root root  720 Jun 10 15:22 SUSE_Linux_Enterprise_Server_x86_64.service
-rw-r--r-- 1 root root  861 Jun 10 15:22 SUSE_Linux_Enterprise_Software_Development_Kit_x86_64.service
-rw-r--r-- 1 root root  592 Jun 10 15:22 Toolchain_Module_x86_64.service
-rw-r--r-- 1 root root  772 Jun 10 15:22 Web_and_Scripting_Module_x86_64.service

First attempt, only one is registered:

ip-10-10-11-205:/etc/zypp/services.d # registercloudguest --force-new
Registration succeeded

ip-10-10-11-205:/etc/zypp/services.d # SUSEConnect -s
[{"identifier":"SLES","version":"12.5","arch":"x86_64","status":"Registered"},{"identifier":"sle-module-adv-systems-management","version":"12","arch":"x86_64","status":"Not Registered"},{"identifier":"sle-module-containers","version":"12","arch":"x86_64","status":"Not Registered"},{"identifier":"sle-module-hpc","version":"12","arch":"x86_64","status":"Not Registered"},{"identifier":"sle-module-legacy","version":"12","arch":"x86_64","status":"Not Registered"},{"identifier":"sle-module-public-cloud","version":"12","arch":"x86_64","status":"Not Registered"},{"identifier":"sle-module-toolchain","version":"12","arch":"x86_64","status":"Not Registered"},{"identifier":"sle-module-web-scripting","version":"12","arch":"x86_64","status":"Not Registered"},{"identifier":"sle-sdk","version":"12.5","arch":"x86_64","status":"Not Registered"}]

Second attempt, all services are registered:

ip-10-10-11-205:/etc/zypp/services.d # registercloudguest --force-new
Registration succeeded

ip-10-10-11-205:/etc/zypp/services.d # SUSEConnect -s
[{"identifier":"SLES","version":"12.5","arch":"x86_64","status":"Registered"},{"identifier":"sle-module-adv-systems-management","version":"12","arch":"x86_64","status":"Registered"},{"identifier":"sle-module-containers","version":"12","arch":"x86_64","status":"Registered"},{"identifier":"sle-module-hpc","version":"12","arch":"x86_64","status":"Registered"},{"identifier":"sle-module-legacy","version":"12","arch":"x86_64","status":"Registered"},{"identifier":"sle-module-public-cloud","version":"12","arch":"x86_64","status":"Registered"},{"identifier":"sle-module-toolchain","version":"12","arch":"x86_64","status":"Registered"},{"identifier":"sle-module-web-scripting","version":"12","arch":"x86_64","status":"Registered"},{"identifier":"sle-sdk","version":"12.5","arch":"x86_64","status":"Registered"}]

ip-10-10-11-205:/etc/zypp/credentials.d # ls -al
total 44
drwxr-xr-x 2 root root 4096 Jun 10 15:39 .
drwxr-xr-x 9 root root  202 Mar  7 12:45 ..
-rw------- 1 root root   72 Jun 10 15:39 Advanced_Systems_Management_Module_x86_64
-rw------- 1 root root   72 Jun 10 15:39 Containers_Module_x86_64
-rw------- 1 root root   72 Jun 10 15:39 HPC_Module_x86_64
-rw------- 1 root root   72 Jun 10 15:39 Legacy_Module_x86_64
-rw------- 1 root root   72 Jun 10 15:39 Public_Cloud_Module_x86_64
-rw------- 1 root root   72 Jun 10 15:39 SCCcredentials
-rw------- 1 root root   72 Jun 10 15:39 SUSE_Linux_Enterprise_Server_x86_64
-rw------- 1 root root   72 Jun 10 15:39 SUSE_Linux_Enterprise_Software_Development_Kit_x86_64
-rw------- 1 root root   72 Jun 10 15:39 Toolchain_Module_x86_64
-rw------- 1 root root   72 Jun 10 15:39 Web_and_Scripting_Module_x86_64
@felixsch felixsch added the help wanted Extra attention is needed label Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants