Bug 337913

Summary: Yast2 Profile Manager ignores sysconfig file and writes translated entries into SCPM DB
Product: [openSUSE] openSUSE 10.3 Reporter: Martin Kunz <martin.kunz>
Component: YaST2Assignee: Jiří Suchomel <jsuchome>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P5 - None CC: coolo, martin.kunz, petr.m
Version: Final   
Target Milestone: ---   
Hardware: i586   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: Yast2-logs for 'profile manager' starts, modifications of resource_group network
Screenshot of empty resource-group "network" shown by Yast2
yastlog
patch for /usr/share/YaST2/modules/ProfileManager.ycp
patch for /usr/share/YaST2/include/profile-manager/dialogs.ycp
directory /var/lib/scpm
yastlog

Description Martin Kunz 2007-10-30 17:58:55 UTC
Start scpm via /sbin/yast2 'profile-manager', activate it and modify the resource-group "network". I wanted to add some files like /etc/sysconfig/network/ifcfg-eth0 and /etc/sysconfig/network/routes and so on.
After saving this and trying to create different profiles these additional files are note safed in /var/lib/scpm/profiles/PROFILENAME/file/_etc_sysconfig_network_ifcfg-eth0
and so on.
The reason perhaps seemes to be in the used language-environment "German". If i take a look into the file  /var/lib/scpm/resource_groups/network the word "Datei" has to be changed into "file":
> cat /var/lib/scpm/resource_groups/network
description Grundlegende Netzwerkeinstellungen
 network
 /etc/hosts
 /etc/resolv.conf
 /etc/sysconfig/network
 /etc/sysconfig/network/config
 /etc/sysconfig/network/dhcp
 /etc/sysconfig/network/if-down.d
 /etc/sysconfig/network/if-up.d
 /etc/sysconfig/network/wireless
 /etc/host.conf
 /etc/HOSTNAME
 /etc/sysconfig/proxy
Datei /etc/sysconfig/network/ifcfg-eth0
Datei /etc/sysconfig/network/ifcfg-eth1
Datei /etc/sysconfig/network/ifcfg-lo
Datei /etc/sysconfig/network/ifroute-lo
Datei /etc/sysconfig/network/routes
>
Also /sbin/yast2 'profile-manager' did not accept any changes in the settings of for example "switch mode". A look into file /etc/sysconfig/scpm always saves the same.
Comment 1 Cyril Hrubis 2007-10-30 18:55:05 UTC
Please attach y2logs. If you are in doubt follow:

http://en.opensuse.org/Bugs/YaST

Thanks!
Comment 2 Martin Kunz 2007-10-31 21:33:28 UTC
Created attachment 181568 [details]
Yast2-logs for 'profile manager' starts, modifications of resource_group network

It takes some time, because i have to reinstall my opensuse 10.3, because of some strange misdemeanour.
I reproduced the testcase. 1) start yast2 'profile manager', activate it, try to change the switch mode to "force", what did not work. The switch mode is always "normal".

2) Then create a new profile named "PROFILE-TEST-COPY" by using the Copy-command of the Profile Chooser of kde. 

3) Then start yast2 'profile-manager' again and add the file /home/kunzm/.kde/share/config/kioslaverc to resource-group "network" (includes the proxy-information for Konqueror), save it, close yast2 'profile-manager'. result: The file /var/lib/scpm/resource_group/network was created and looked like this:
mklaptop:/var/lib/scpm/resource_groups # cat network
description Grundlegende Netzwerkeinstellungen
Dienst network
Datei /etc/hosts
Datei /etc/resolv.conf
Datei /etc/sysconfig/network
Datei /etc/sysconfig/network/config
Datei /etc/sysconfig/network/dhcp
Datei /etc/sysconfig/network/if-down.d
Datei /etc/sysconfig/network/if-up.d
Datei /etc/sysconfig/network/wireless
Datei /etc/host.conf inactive
Datei /etc/HOSTNAME inactive
Datei /etc/sysconfig/proxy inactive
file /home/kunzm/.kde/share/config/kioslaverc

4) start yast2 'profile manager' and resave the changes of resource-group "network". -> result: The file /var/lib/scpm/resource_group/network now lookes like this:
mklaptop:/var/lib/scpm/resource_groups # cat network
description Grundlegende Netzwerkeinstellungen
 network
 /etc/hosts
 /etc/resolv.conf
 /etc/sysconfig/network
 /etc/sysconfig/network/config
 /etc/sysconfig/network/dhcp
 /etc/sysconfig/network/if-down.d
 /etc/sysconfig/network/if-up.d
 /etc/sysconfig/network/wireless
 /etc/host.conf inactive
 /etc/HOSTNAME inactive
 /etc/sysconfig/proxy inactive
Datei /home/kunzm/.kde/share/config/kioslaverc

5) start yast2 'profile-manager' and try to take a look at the resource-group "network". Result: It is empty!!! (see attached screenshot).
Comment 3 Martin Kunz 2007-10-31 21:40:38 UTC
Created attachment 181569 [details]
Screenshot of empty resource-group "network" shown by Yast2

This screenshot shows the empty resource-group "network" finally shown by Yast2 and on the left side the cat-output of /var/lib/scpm/resource_groups/network in the difference testcases.
Comment 4 Petr Matula 2007-11-03 15:50:30 UTC
Created attachment 181926 [details]
yastlog
Comment 5 Jiří Suchomel 2007-11-05 22:11:53 UTC
Oops, there's definitelly a bug that causes not reading/writing the sysconfig file. I hope other issues are a consequences of this one.
Comment 6 Jiří Suchomel 2007-11-05 22:14:33 UTC
Created attachment 182136 [details]
patch for /usr/share/YaST2/modules/ProfileManager.ycp

Please patch your /usr/share/YaST2/modules/ProfileManager.ycp, than call 'ycpc -c /usr/share/YaST2/modules/ProfileManager.ycp' and try again if also other issues occur.
Comment 7 Jiří Suchomel 2007-11-06 08:53:58 UTC
No, it is not enough. Investigating...
Comment 8 Jiří Suchomel 2007-11-06 10:12:57 UTC
Created attachment 182182 [details]
patch for /usr/share/YaST2/include/profile-manager/dialogs.ycp

OK, so this additional patch for /usr/share/YaST2/include/profile-manager/dialogs.ycp should fix the rest. Please test and report your result.
Comment 10 Stephan Kulow 2007-11-06 16:58:18 UTC
Anja, please provide a tracker ID
Comment 11 Petr Matula 2007-11-06 21:28:03 UTC
i applied patches.
When i changed profiles
Dates from resource groups not saved.
"backup network resource group files" are not saved to /var/lib/scpm/profiles.
the file network is missing at directory /var/lib/scpm/profiles/default/service ??
The file /var/lib/scpm/resource_group/network now lookes
like this:
description Základní nastavení sítě
Služba network
Soubor /etc/hosts
Soubor /etc/resolv.conf
Soubor /etc/sysconfig/network
Soubor /etc/sysconfig/network/config
Soubor /etc/sysconfig/network/dhcp
Soubor /etc/sysconfig/network/if-down.d
Soubor /etc/sysconfig/network/if-up.d
Soubor /etc/sysconfig/network/wireless
Soubor /etc/host.conf
Soubor /etc/HOSTNAME
Soubor /etc/sysconfig/proxy
Comment 12 Petr Matula 2007-11-06 21:30:16 UTC
Created attachment 182302 [details]
directory /var/lib/scpm
Comment 13 Petr Matula 2007-11-06 22:01:28 UTC
Created attachment 182308 [details]
yastlog
Comment 14 Jiří Suchomel 2007-11-07 07:54:08 UTC
Hm, strange. I assume this may be caused by the fact that resource groups were broken before applying the patch. Could you try fresh setup?
Comment 15 Petr Matula 2007-11-07 11:35:48 UTC
i  uninstalled scpm,yast profil-manager; deleted directory /var/lib/scpm; again installed and patched
and the reason seems to be eliminated.
Comment 16 Jiří Suchomel 2007-11-07 12:47:10 UTC
you mean that "the problem seems to be eliminated", right?
Comment 17 Martin Kunz 2007-11-07 13:09:01 UTC
Hi @ALL,
sorry, but i'm just engaged with some other work now. I hope that this evening i have the time to reproduce and hopefully can confirm what Patr Matual says.
Greetings Martin
Comment 19 Stephan Kulow 2007-11-07 14:08:19 UTC
ok, no fix - no update
Comment 20 Jiří Suchomel 2007-11-07 14:16:45 UTC
Well, it was tested by at least 2 persons, me and Petr Matula (comment 15), but let's wait for original requester as well...
Comment 21 Martin Kunz 2007-11-07 22:53:47 UTC
I have checked it now. It seems to work. 
@Petr: It was not necessary to uninstall and install all again. I only need to reset the broken resource_group after the patch and save it and close the profile-manager. Than i can reopen the profile-manager again and i am possible to modify the resource-groups now.
@Jiri: Something is a little bit mistakable in the dialogs of the profile-manager. I first thought, that i should add the files like /etc/sysconfig/network/ifcfg-eth0 to the resource-group "network".
In fact i don't need to add them, because they are already monitored by the default "file" /etc/sysconfig/network (which is a folder, not a file). Perhaps it is possible to point that out in the helps (or better parse the added files if they are already watch by another "file" ;-) )
Also the cross is not described, for which the file is active or inactive.

Another little problem: I'm not able to add a folder to be monitored via the dialog of the profile-manager (not by the search-function, only by typing it into the field).
But the patch works.

Thanks Martin
Comment 22 Jiří Suchomel 2007-11-08 13:01:18 UTC
Martin, could you please open the rest of issues (no check for duplicate entries and entering directories) as a separate bug report? There are not really severe, and I would like to have this one released asap. Thanks.
Comment 24 Jiří Suchomel 2007-11-08 13:47:31 UTC
(In reply to comment #22 from Jiří­ Suchomel)
> Martin, could you please open the rest of issues (no check for duplicate
> entries and entering directories) as a separate bug report? There are not
> really severe, and I would like to have this one released asap. Thanks.
> 

Well, i can do it myself: bug 340182

Comment 25 Martin Kunz 2007-11-08 15:12:26 UTC
(In reply to comment #21 from Martin Kunz)
> I have checked it now. It seems to work. 
> @Petr: It was not necessary to uninstall and install all again. I only need to
> reset the broken resource_group after the patch and save it and close the
> profile-manager. Than i can reopen the profile-manager again and i am possible
> to modify the resource-groups now.
> @Jiri: Something is a little bit mistakable in the dialogs of the
> profile-manager. I first thought, that i should add the files like
> /etc/sysconfig/network/ifcfg-eth0 to the resource-group "network".
> In fact i don't need to add them, because they are already monitored by the
> default "file" /etc/sysconfig/network (which is a folder, not a file). Perhaps
> it is possible to point that out in the helps (or better parse the added files
> if they are already watch by another "file" ;-) )
> Also the cross is not described, for which the file is active or inactive.
> 
> Another little problem: I'm not able to add a folder to be monitored via the
> dialog of the profile-manager (not by the search-function, only by typing it
> into the field).
> But the patch works.
> 
> Thanks Martin
> 
@Petr: I have to correct myself. Cause of my resource-groups-tests yesterday evening, this morning all my profiles are broken. The ip-address did not change, when i switch the profile. So i have to reconfigure all the ip-addresses in my profiles and save them again.
These are one of my (bad) experiences already known from older (open)suse-releases. If you began to change some "files" in one resource-group _after_ you have already created some profiles, this malfunction could happen. Is this a bug or a feature? ;-)
Comment 26 Jiří Suchomel 2007-11-08 15:19:23 UTC
(In reply to comment #25 from Martin Kunz)

> @Petr: I have to correct myself. Cause of my resource-groups-tests yesterday
> evening, this morning all my profiles are broken. The ip-address did not
> change, when i switch the profile. So i have to reconfigure all the
> ip-addresses in my profiles and save them again.
> These are one of my (bad) experiences already known from older
> (open)suse-releases. If you began to change some "files" in one resource-group
> _after_ you have already created some profiles, this malfunction could happen.
> Is this a bug or a feature? ;-)

I'm not sure - anyway it looks like bug or feature targeted for scpm, not for the YaST GUI (you may want to open a new report for it, please stick to original problem here). 

Comment 27 Petr Matula 2007-11-08 15:54:33 UTC
In suse 8 (?)  yast profile manager had capability as you can tell SCPM to launch pre-start and post-start or pre-stop and post-stop scripts when loading or unloading a profile (http://www.linux-user.de/ausgabe/2004/04/069-scpm/scpm_yast3.png). 
This capability was removed from gui. 
Why ?
Comment 28 Jiří Suchomel 2007-11-08 20:22:49 UTC
Please do not bring even more topics to this bug. 

yast2-profile-manager was changed to configuration tool of scpm and the rest of actions scpm does were moved to different progrom (SUMF). If you think something is still missing, or you have any other furhter questions, please use the opensuse-factory mailing list or open another bug report.
Comment 30 Jiří Suchomel 2007-11-12 22:11:56 UTC
The fixed version for 10.3 is yast2-profile-manager-2.15.1.
Comment 31 Anja Stock 2007-11-15 15:15:50 UTC
released