Bug 1226986

Summary: Valkey migration enables bogus valkey@basename services
Product: [openSUSE] openSUSE Tumbleweed Reporter: Georg Pfuetzenreuter <georg.pfuetzenreuter>
Component: OtherAssignee: Antonio Teixeira <antonio.teixeira>
Status: NEW --- QA Contact: E-mail List <qa-bugs>
Severity: Normal    
Priority: P5 - None CC: antonio.teixeira, danilo.spinella, dominik, ngompa13, pallaswept, suse-beta, toganm
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: openSUSE Tumbleweed   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Georg Pfuetzenreuter 2024-06-26 06:16:55 UTC
I never had a "redis@basename" instance! Yet after todays dup to 20240624 which replaced redis with valkey-7.2.5-2.1.x86_64 the migration logic enabled these bogus services, which naturally failed during boot:

```
~> ll /etc/systemd/system/multi-user.target.wants/valkey*
lrwxrwxrwx 1 root root 39 Jun 26 08:10 '/etc/systemd/system/multi-user.target.wants/valkey@basename.service' -> '/usr/lib/systemd/system/valkey@.service'
lrwxrwxrwx 1 root root 48 Jun 26 08:10 '/etc/systemd/system/multi-user.target.wants/valkey-sentinel@basename.service' -> '/usr/lib/systemd/system/valkey-sentinel@.service'
```
Comment 1 Georg Pfuetzenreuter 2024-06-26 06:20:28 UTC
It's still early so I might be missing something, but I think there are missing dollar signs in lines 5 and 6?

https://build.opensuse.org/projects/server:database/packages/valkey/files/migrate_redis_to_valkey.bash?expand=1

As of revision 4 these lines look like this:

```
redisunits=(basename $(find /etc/systemd/system -maxdepth 1 -name "redis@*.service"))
sentinelunits=(basename $(find /etc/systemd/system -maxdepth 1 -name "redis-sentinel@*.service"))
```
Comment 2 Georg Pfuetzenreuter 2024-06-26 06:27:42 UTC
I made a patch, please check - don't have means to test myself - Redis is gone from my system. :-)

https://build.opensuse.org/request/show/1183296
Comment 3 pallas wept 2024-06-27 11:40:42 UTC
(In reply to Georg Pfuetzenreuter from comment #2)
> I made a patch, please check - don't have means to test myself - Redis is
> gone from my system. :-)
> 
> https://build.opensuse.org/request/show/1183296

Thanks for looking into this and reporting it. I'm seeing the same errors.

I have not tested this patch either, it's too late for this system, I just disabled the two services. I'd like to know if that was the correct course of action? Should they be deleted? Repaired? Do replacements need to be created?

Any advice appreciated.