Bug 713760

Summary: yast installer doesn't install its own systemd .service file
Product: [openSUSE] openSUSE 12.1 Reporter: Frederic Crozat <fcrozat>
Component: InstallationAssignee: Jiří Suchomel <jsuchome>
Status: RESOLVED FIXED QA Contact: Jiri Srain <jsrain>
Severity: Major    
Priority: P5 - None    
Version: Factory   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Bug Depends on:    
Bug Blocks: 696902    
Attachments: second stage service
firstboot service
suseconfig service

Description Frederic Crozat 2011-08-23 15:24:12 UTC
Created attachment 447211 [details]
second stage service

to have working second phase when booting with systemd, yast2-installation package should ship its own systemd .service files.

I've created such files, based on what is happening in /etc/init.d/boot
-YaST2-Second-Phase.service
-YaST2-Firstboot.service

I've also created SuSEconfig.service but I'm not sure if it is still needed : on my test, /var/lib/YaST2/run_suseconfig was empty on a sysvinit install). If it is, the Yast2 output redirect should be done in a shell wrapper and this wrapper should be called in YaST2-* service files.
Comment 1 Frederic Crozat 2011-08-23 15:24:36 UTC
Created attachment 447212 [details]
firstboot service
Comment 2 Frederic Crozat 2011-08-23 15:25:02 UTC
Created attachment 447213 [details]
suseconfig service
Comment 3 Jiří Suchomel 2011-08-26 08:05:47 UTC
(In reply to comment #0)
> Created an attachment (id=447211) [details]
> second stage service
> 
> to have working second phase when booting with systemd, yast2-installation
> package should ship its own systemd .service files.
> 
> I've created such files, based on what is happening in /etc/init.d/boot
> -YaST2-Second-Phase.service
> -YaST2-Firstboot.service
> 


Where should it be installed? How other packages package thise service files?
Comment 4 Frederic Crozat 2011-08-26 13:22:02 UTC
Sorry, forgot this part :

specfile should have the following ;

%if 0%{suse_version} > 1210
BuildRequires: systemd-devel
%{systemd_requires}
%endif

#install the files in %_unitdir (ie /lib/systemd/system )
install -m644 file.service $RPM_BUILD_ROOT%_unitdir

and add to scripts :

%post 
%service_add YaST2-Second-Phrase.service Yast2-Firstboot.service
/bin/systemctl enable YaST2-Second-Phrase.service Yast2-Firstboot.service > /dev/null 2>&1 || :

%preun
if [ $1 -eq 0 ]; then
 /bin/systemctl disable YaST2-Second-Phrase.service Yast2-Firstboot.service > /dev/null 2>&1 || :
fi
%service_del_preun YaST2-Second-Phrase.service Yast2-Firstboot.service

%postun
%service_del_postun YaST2-Second-Phrase.service Yast2-Firstboot.service
Comment 5 Jiří Suchomel 2011-08-29 13:18:53 UTC
The postinstall script fails for me, I do not know why; do you have an idea?
I've probably done something wrong to my spec file:

https://build.suse.de/package/show?package=yast2-installation&project=home%3Ajsuchome
Comment 6 Jiří Suchomel 2011-08-30 09:39:38 UTC
OK, solved by mail.

Thanks for help. New package is yast2-installation-2.21.15
Comment 7 Bernhard Wiedemann 2011-08-30 12:00:10 UTC
This is an autogenerated message for OBS integration:
This bug (713760) was mentioned in
https://build.opensuse.org/request/show/80220 Factory / yast2-installation