qports/qubes-db-vm/0001-create_pidfile.patch

51 lines
1.8 KiB
Diff
Raw Normal View History

From d20a9db122608e0992c9ab6f675920d4bb1ee88f Mon Sep 17 00:00:00 2001
From: "build@apk-groulx" <build@apk-groulx.praxis>
Date: Fri, 4 Mar 2022 22:50:19 +0000
Subject: [PATCH 1/1] create_pidfile
---
daemon/db-daemon.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/daemon/db-daemon.c b/daemon/db-daemon.c
index 9934d16..2b28995 100644
--- a/daemon/db-daemon.c
+++ b/daemon/db-daemon.c
@@ -618,11 +618,8 @@ int create_pidfile(struct db_daemon_data *d) {
mode_t old_umask;
struct stat stat_buf;
- /* do not create pidfile for VM daemon - service is managed by systemd */
- if (!d->remote_name)
- return 1;
snprintf(pidfile_name, sizeof(pidfile_name),
- "/var/run/qubes/qubesdb.%s.pid", d->remote_name);
+ "/var/run/qubes/qubes-db.pid");
old_umask = umask(0002);
pidfile = fopen(pidfile_name, "w");
@@ -643,10 +640,8 @@ void remove_pidfile(struct db_daemon_data *d) {
struct stat stat_buf;
/* no pidfile for VM daemon - service is managed by systemd */
- if (!d->remote_name)
- return;
snprintf(pidfile_name, sizeof(pidfile_name),
- "/var/run/qubes/qubesdb.%s.pid", d->remote_name);
+ "/var/run/qubes/qubes-db.pid");
if (stat(pidfile_name, &stat_buf) == 0) {
/* remove pidfile only if it's the one created this process */
@@ -754,7 +749,7 @@ int fuzz_main(int argc, char **argv) {
exit(1);
case 0:
close(ready_pipe[0]);
- snprintf(log_path, sizeof(log_path), "/var/log/qubes/qubesdb.%s.log", d.remote_name);
+ snprintf(log_path, sizeof(log_path), "/var/log/qubes/qubes-db.log");
close(0);
old_umask = umask(0);
--
2.34.1