!20 [sync] PR-19: add macro WITHOUT_SYSTEMD to relieve dependence on systemd #I6PLP1
From: @openeuler-sync-bot Reviewed-by: @seuzw Signed-off-by: @seuzw
This commit is contained in:
commit
7d11612cbf
@ -1,33 +1,40 @@
|
||||
diff -up rpcbind-0.2.4/src/rpcbind.c.orig rpcbind-0.2.4/src/rpcbind.c
|
||||
--- rpcbind-0.2.4/src/rpcbind.c.orig 2017-03-21 10:12:35.005190509 -0400
|
||||
+++ rpcbind-0.2.4/src/rpcbind.c 2017-03-21 10:36:45.510507649 -0400
|
||||
@@ -144,6 +144,8 @@ static void rbllist_add(rpcprog_t, rpcve
|
||||
--- rpcbind-1.2.6/src/rpcbind.c 2023-03-27 15:17:28.116410124 +0800
|
||||
+++ rpcbind-1.2.6-dev/src/rpcbind.c 2023-03-27 15:37:14.215749666 +0800
|
||||
@@ -143,6 +143,10 @@ static void rbllist_add(rpcprog_t, rpcve
|
||||
static void terminate(int);
|
||||
static void parseargs(int, char *[]);
|
||||
|
||||
+#ifndef WITHOUT_SYSTEMD
|
||||
+char *systemdtmp = "/usr/bin/systemd-tmpfiles --create rpcbind.conf";
|
||||
+#endif
|
||||
+
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
@@ -151,13 +153,21 @@ main(int argc, char *argv[])
|
||||
@@ -150,13 +154,27 @@ main(int argc, char *argv[])
|
||||
void *nc_handle; /* Net config handle */
|
||||
struct rlimit rl;
|
||||
int maxrec = RPC_MAXDATASIZE;
|
||||
+#ifndef WITHOUT_SYSTEMD
|
||||
+ int once = 1;
|
||||
+#endif
|
||||
|
||||
parseargs(argc, argv);
|
||||
|
||||
+#ifndef WITHOUT_SYSTEMD
|
||||
+tryagain:
|
||||
+#endif
|
||||
/* Check that another rpcbind isn't already running. */
|
||||
if ((rpcbindlockfd = (open(RPCBINDDLOCK,
|
||||
- O_RDONLY|O_CREAT, 0444))) == -1)
|
||||
+ O_RDONLY|O_CREAT, 0444))) == -1) {
|
||||
+#ifndef WITHOUT_SYSTEMD
|
||||
+ if (once) {
|
||||
+ once = system(systemdtmp); /* set once to avoid a warning */
|
||||
+ once = 0;
|
||||
+ goto tryagain;
|
||||
+ }
|
||||
+#endif
|
||||
err(1, "%s", RPCBINDDLOCK);
|
||||
+ }
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
|
||||
Name: rpcbind
|
||||
Version: 1.2.6
|
||||
Release: 4
|
||||
Release: 5
|
||||
Summary: Universal addresses to RPC program number mapper
|
||||
License: BSD
|
||||
|
||||
@ -118,6 +118,12 @@ fi
|
||||
%{_mandir}/man8/*.8.gz
|
||||
|
||||
%changelog
|
||||
* Mon Mar 27 2023 wangqing <wangqing151@huawei.com> - 1.2.6-5
|
||||
- Type:bugfix
|
||||
- Id:NA
|
||||
- SUG:NA
|
||||
- DESC:add macro WITHOUT_SYSTEMD to relieve dependence on systemd
|
||||
|
||||
* Wed Mar 30 2022 kircher <majun65@huawei.com> - 1.2.6-4
|
||||
- Type:bugfix
|
||||
- Id:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user