SLES15 SP4 | Installation of a rpm package fails when %post scriplet fails with "/usr/lib/1sb/install _initd: No such file or directory"
0
votes
1
answer
519
views
I have a
.spec
file to install a rpm. I have the following snippet in post install (%post scriplet)
%post -n %{package_name}
# Enable the service at boot time
%if %{?suse_version:1}0
/usr/lib/lsb/install_initd %{_initrddir}/%{package_name}
%else
chkconfig --add %{package_name}
%endi
During zypper install package_name
it fails at the post installation phase with the following error:
/var/tmp/rpm-tmp.Z5R29N: line 2: /usr/lib/1sb/install _initd: No such file or directory
warning: %post (package_name.sles15.x86_64) scriptlet failed, exit status 127
I am a novice in .spec files for rpm but this scriplet failed because /usr/lib/lsb/
directory doesn't exists in SLES 15 SP4
My Questions are:
1. What is this scriplet exactly doing?
2. Where to get this /lsb/
package from so that I can create this path in SLES 15 SP4? I check that SLES 15 SP4 pre-installed with lsb-xxx package but they are not working here ?
3. Do I need to do case checks here for sles 15 SP4 inside this scriplet? like:
%if 0%{?sle_version} == 150400 && 0%{?is_opensuse}
// do somthing
%endif
Asked by Abhishek Dasgupta
(113 rep)
Jan 18, 2023, 03:13 PM
Last activity: Jan 18, 2023, 04:19 PM
Last activity: Jan 18, 2023, 04:19 PM