How to fix RPMLINT W: suse-missing-rclink

replay-sorcery.x86_64: W: suse-missing-rclink replay-sorcery-kms
The package contains an init script or systemd service file but lacks the
symlink /usr/sbin/rcFOO -> /usr/sbin/service

Hi, I got the warning for my replay-sorcery package.
https://build.opensuse.org/package/show/home:andythe_great:branches:games:tools/replay-sorcery

I’m not sure what I suppose to do. Do I ln -s something?

Thanks.

Hi
Yes :wink:


pushd %{buildroot}%{_sbindir}
ln -s service rcreplay-sorcery
popd

Hi,

I could not figured out where to put this macro.
I always get this.

/usr/sbin: No such file or directory

I tried placing it under cmake_build, pre, post, preun, postun, same error.

I reduce it to
pushd %{_sbindir}
ln -s service rcreplay-sorcery-kms
popd

and put it above %files and it work.

However, I got another error.
It said file already exist, but still complain.
What do I do?
32s] … running 98-revert-uname-hack
32s] … running 99-check-remove-rpms
32s] … removing all built rpms
32s] (order: reverse replay-sorcery)
32s] /usr/sbin /
32s] ln: failed to create symbolic link ‘rcreplay-sorcery-kms’: File exists
32s] /
32s]
32s] RPMLINT report:
32s] ===============
32s] replay-sorcery.x86_64: W: suse-missing-rclink replay-sorcery-kms
32s] The package contains an init script or systemd service file but lacks the
32s] symlink /usr/sbin/rcFOO -> /usr/sbin/service
32s]
32s] 2 packages and 0 specfiles checked; 0 errors, 1 warnings.

Hi
In the %install section

Hi,

I add it like this.

%install
%cmake_install

pushd %{_sbindir}
ln -s service rcreplay-sorcery-kms
popd

But I got this.
14s] make: Leaving directory ‘/home/abuild/rpmbuild/BUILD/ReplaySorcery-0.6.0/build’
14s] + pushd /usr/sbin
14s] /usr/sbin ~/rpmbuild/BUILD/ReplaySorcery-0.6.0
14s] + ln -s service rcreplay-sorcery-kms
14s] ln: failed to create symbolic link ‘rcreplay-sorcery-kms’: Permission denied
14s] error: Bad exit status from /var/tmp/rpm-tmp.cVaCSa (%install)

Hi
You missed the %{buildroot} from the pushd part…

Hi,

I got the same error as before.

   14s] + pushd /home/abuild/rpmbuild/BUILDROOT/replay-sorcery-0.6.0-0.x86_64/usr/sbin 
   14s] /var/tmp/rpm-tmp.YhHhKa: line 36: pushd: /home/abuild/rpmbuild/BUILDROOT/replay-sorcery-0.6.0-0.x86_64/usr/sbin: No such file or directory 
   14s] error: Bad exit status from /var/tmp/rpm-tmp.YhHhKa (%install)


With this.

%install
%cmake_install

pushd %{buildroot}%{_bindir}
ln -s service rcreplay-sorcery
popd

Is /usr/sbin created by your Makefile? If not, you need to create this directory manually, as part of %install section.

With this.

%install
%cmake_install

pushd %{buildroot}%{_bindir}

There is no way %{_bindir} can expand to /usr/sbin, so you cannot get this error with this code. For the umpteenth time - never manually write computer code and output, always copy and paste.

Thanks, I mkdir and it is fix now.