schweikert / fping

High performance ping tool
https://fping.org
Other
1.03k stars 251 forks source link

The exit code of the RPM installation process is not 0 #231

Closed zdyxry closed 2 years ago

zdyxry commented 2 years ago

When installing RPM, use setcap to set cap_net_raw capability in %post stage.

setap exit code with 1 . Maybe we should use setcap to specify specific files?

OS Version: CentOS 7
[root@node1 08:11:43 sbin]$rpm -qf `which setcap`
libcap-2.32-1.ky10.x86_64
[root@node1 08:11:56 sbin]$/usr/sbin/setcap cap_net_raw+ep /usr/sbin/fping*
fatal error: Invalid argument
usage: setcap [-q] [-v] [-n <rootid>] (-r|-|<caps>) <filename> [ ... (-r|-|<capsN>) <filenameN> ]

 Note <filename> must be a regular (non-symlink) file.
[root@node1 08:12:07 sbin]$/usr/sbin/setcap cap_net_raw+ep /usr/sbin/fping
[root@node1 08:12:10 sbin]$/usr/sbin/setcap cap_net_raw+ep /usr/sbin/fping6
[root@node1 08:12:12 sbin]$echo $?
0