From e83ba5eda7011bfc44a702e70f73f15c9607e4b0 Mon Sep 17 00:00:00 2001 From: Ross Lagerwall Date: Fri, 18 Oct 2024 16:22:14 +0100 Subject: [PATCH 1/2] Fix a build warning with GCC 12.3.0 GCC correctly reports "pointer targets differ in signedness". Signed-off-by: Ross Lagerwall --- .../libs/xapi-stdext/lib/xapi-stdext-zerocheck/zerocheck_stub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocaml/libs/xapi-stdext/lib/xapi-stdext-zerocheck/zerocheck_stub.c b/ocaml/libs/xapi-stdext/lib/xapi-stdext-zerocheck/zerocheck_stub.c index 776ef854849..4606cf95a4e 100644 --- a/ocaml/libs/xapi-stdext/lib/xapi-stdext-zerocheck/zerocheck_stub.c +++ b/ocaml/libs/xapi-stdext/lib/xapi-stdext-zerocheck/zerocheck_stub.c @@ -31,7 +31,7 @@ value is_all_zeros(value string, value length) for (i = len / 4; i > 0; i--) if (*p++ != 0) goto notallzero; - s = (unsigned char *) p; + s = (const char *) p; for (i = 0; i < len % 4; i++) if (s[i] != 0) goto notallzero; From e3f92131f8c689378a375d5e01d2a26ef395d339 Mon Sep 17 00:00:00 2001 From: Ross Lagerwall Date: Fri, 18 Oct 2024 16:51:23 +0100 Subject: [PATCH 2/2] Remove use of deprecated syslog Standard* type Newer systemd warns that the "syslog" StandardOutput/StandardError type is deprecated and automatically uses the journal instead. Fix this by removing the explicit setting of StandardOutput/StandardError. Instead, the service will use the default values configured in systemd (DefaultStandardOutput/DefaultStandardError) which for a XenServer system will result in the output going to rsyslog. Signed-off-by: Ross Lagerwall --- ocaml/forkexecd/lib/fe_systemctl.ml | 2 -- scripts/varstored-guard.service | 2 -- scripts/xapi-nbd.service | 1 - 3 files changed, 5 deletions(-) diff --git a/ocaml/forkexecd/lib/fe_systemctl.ml b/ocaml/forkexecd/lib/fe_systemctl.ml index cd76bede41a..b36ee6674ae 100644 --- a/ocaml/forkexecd/lib/fe_systemctl.ml +++ b/ocaml/forkexecd/lib/fe_systemctl.ml @@ -60,8 +60,6 @@ let start_transient ?(env = Array.of_list default_env) ?(properties = []) ) ; ("SyslogIdentifier", syslog_key) ; ("SyslogLevel", "debug") - ; ("StandardOutput", "syslog") - ; ("StandardError", "inherit") ; ("StartLimitInterval", "0") (* no rate-limit, for bootstorms *) ; ("ExecStart", String.concat " " (cmd :: List.map Filename.quote args)) ; ("Type", Type.to_string exec_ty) diff --git a/scripts/varstored-guard.service b/scripts/varstored-guard.service index c9d1b9bd939..d7cb838336f 100644 --- a/scripts/varstored-guard.service +++ b/scripts/varstored-guard.service @@ -9,8 +9,6 @@ Wants=message-switch.service syslog.target Type=simple Environment=OCAMLRUNPARAM=b ExecStart=/usr/sbin/varstored-guard -# Needed to ensure exceptions are logged when the program fails: -StandardError=syslog LimitNOFILE=4096 # restart but fail if more than 5 failures in 30s Restart=on-failure diff --git a/scripts/xapi-nbd.service b/scripts/xapi-nbd.service index bca7b551a14..fcbacd7cb37 100644 --- a/scripts/xapi-nbd.service +++ b/scripts/xapi-nbd.service @@ -11,7 +11,6 @@ Environment=OCAMLRUNPARAM=b # and the PathExists in xapi-nbd.path: any change must be made in all three files. ExecStart=/usr/sbin/xapi-nbd --certfile=/etc/xensource/xapi-ssl.pem StandardOutput=null -StandardError=syslog # restart but fail if more than 5 failures in 2s Restart=on-failure StartLimitBurst=5