Page MenuHomeFreeBSD

rup: Add verions 4 from Sun
Needs ReviewPublic

Authored by yanhaowang on Jul 31 2024, 7:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jan 13, 6:25 PM
Unknown Object (File)
Mon, Jan 13, 9:26 AM
Unknown Object (File)
Thu, Dec 26, 2:57 PM
Unknown Object (File)
Tue, Dec 24, 11:38 PM
Unknown Object (File)
Dec 10 2024, 6:22 PM
Unknown Object (File)
Nov 22 2024, 5:03 PM
Unknown Object (File)
Nov 21 2024, 6:34 AM
Unknown Object (File)
Nov 19 2024, 12:55 AM
Subscribers

Details

Reviewers
lwhsu
hrs
Summary
  1. Add version 4 structure (statsvar) in rstat.x. The new added structure has the similar members like the version 3 structure (statstime). The only difference is statsvar use len and pointer to represent the origin array member (cp_time and dk_xfer).

Also because of this, I can continue use union in "rstat_proc.c" because the member is not same as before. So I add stats_all_s4 variable.

  1. Use "netpath" with RPC function in rup and add version 4 RPC call.

Copmile

  1. cd /usr/src/include/rpcsvc && make all install // Header file
  2. cd /usr/src/lib/librpcsvc && make all install // Linker
  3. cd /usr/src/libexec/rpc.rstatd && make all install // RPC server
  4. cd /usr/src/usr.bin/rup && make all install // RPC client
Test Plan

I have test in localhost and in jail (for broadcast), from inetd to start from ourself. It seem it can work.

kola@freebsd:/usr/src/usr.bin/rusers $ sudo rup mytesthost
mytesthost      kola@freebsd:/usr/src/usr.bin/rusers $

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 58935
Build 55822: arc lint + arc unit

Event Timeline

This comment was removed by yanhaowang.

The RPC server code is fine but while I in rup.c RPC client. I can't compile it because the linker.

kola@freebsd:/usr/src/usr.bin/rup $ sudo make all install
... 
ld: error: undefined symbol: xdr_statsvar
>>> referenced by rup.c:301 (/usr/src/usr.bin/rup/rup.c:301)
>>>               rup.o:(main)
>>> referenced by rup.c:254 (/usr/src/usr.bin/rup/rup.c:254)
>>>               rup.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make: stopped in /usr/src/usr.bin/rup

I don't know why because it seem xdr_statsvar has already define in rstat.x and will exist in the header file (rstat.h) which compiled from .x file.

In D46188#1052994, @bses30074_gmail.com wrote:

The RPC server code is fine but while I in rup.c RPC client. I can't compile it because the linker.

kola@freebsd:/usr/src/usr.bin/rup $ sudo make all install
... 
ld: error: undefined symbol: xdr_statsvar
>>> referenced by rup.c:301 (/usr/src/usr.bin/rup/rup.c:301)
>>>               rup.o:(main)
>>> referenced by rup.c:254 (/usr/src/usr.bin/rup/rup.c:254)
>>>               rup.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make: stopped in /usr/src/usr.bin/rup

I don't know why because it seem xdr_statsvar has already define in rstat.x and will exist in the header file (rstat.h) which compiled from .x file.

It's newly added to rstat.x so you also need to build and install it, try make all install in src/include/rpcsvc?

In D46188#1052994, @bses30074_gmail.com wrote:

The RPC server code is fine but while I in rup.c RPC client. I can't compile it because the linker.

kola@freebsd:/usr/src/usr.bin/rup $ sudo make all install
... 
ld: error: undefined symbol: xdr_statsvar
>>> referenced by rup.c:301 (/usr/src/usr.bin/rup/rup.c:301)
>>>               rup.o:(main)
>>> referenced by rup.c:254 (/usr/src/usr.bin/rup/rup.c:254)
>>>               rup.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make: stopped in /usr/src/usr.bin/rup

I don't know why because it seem xdr_statsvar has already define in rstat.x and will exist in the header file (rstat.h) which compiled from .x file.

It's newly added to rstat.x so you also need to build and install it, try make all install in src/include/rpcsvc?

Yes I have done it but still meet the problem. I should add my compile step in summary.

yanhaowang retitled this revision from rstat: Add verions 4 from Sun to rup: Add verions 4 from Sun.Aug 1 2024, 1:01 PM
yanhaowang edited the summary of this revision. (Show Details)
In D46188#1053299, @bses30074_gmail.com wrote:
In D46188#1052994, @bses30074_gmail.com wrote:

The RPC server code is fine but while I in rup.c RPC client. I can't compile it because the linker.

kola@freebsd:/usr/src/usr.bin/rup $ sudo make all install
... 
ld: error: undefined symbol: xdr_statsvar
>>> referenced by rup.c:301 (/usr/src/usr.bin/rup/rup.c:301)
>>>               rup.o:(main)
>>> referenced by rup.c:254 (/usr/src/usr.bin/rup/rup.c:254)
>>>               rup.o:(main)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make: stopped in /usr/src/usr.bin/rup

I don't know why because it seem xdr_statsvar has already define in rstat.x and will exist in the header file (rstat.h) which compiled from .x file.

It's newly added to rstat.x so you also need to build and install it, try make all install in src/include/rpcsvc?

Yes I have done it but still meet the problem. I should add my compile step in summary.

Sorry, forgot that not only header files, you also need to rebuild and install librpcsvc under src/lib/librpcsvc, ld is actually looking for the symbol in that object.

yanhaowang edited the summary of this revision. (Show Details)

Test in localhost and jail