[PATCH 44/73] policycoreutils: mcstrans: creating a pid file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


   This patch looks good to me. acked.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9x3RoACgkQrlYvE4MpobPi7gCgjQU7joJW6Yyvm5o3dohF6jN0
7nUAoLFQGAJuK7dCav2pmvNYqbRgF3HP
=chfS
-----END PGP SIGNATURE-----
>From 6ede217c0f2db5c94a3a0303d684c0eefb04c4a7 Mon Sep 17 00:00:00 2001
From: Dan Walsh <dwalsh@xxxxxxxxxx>
Date: Fri, 3 Feb 2012 10:26:56 -0500
Subject: [PATCH 44/73] policycoreutils: mcstrans: creating a pid file

In order to work properly with systemd daemons should create a pid file.
So it for mcstransd.

Signed-off-by: Eric Paris <eparis@xxxxxxxxxx>
---
 policycoreutils/mcstrans/src/mcstransd.c |   26 --------------------------
 1 file changed, 26 deletions(-)

diff --git a/policycoreutils/mcstrans/src/mcstransd.c b/policycoreutils/mcstrans/src/mcstransd.c
index dd910bd..26d9be8 100644
--- a/policycoreutils/mcstrans/src/mcstransd.c
+++ b/policycoreutils/mcstrans/src/mcstransd.c
@@ -556,30 +556,6 @@ void dropprivs(void)
 	cap_free(new_caps);
 }
 
-static const char *pidfile = "/var/run/mcstransd.pid";
-
-static int write_pid_file(void)
-{
-	int pidfd, len;
-	char val[16];
-
-	len = snprintf(val, sizeof(val), "%u\n", getpid());
-	if (len < 0) {
-		syslog(LOG_ERR, "Pid error (%s)", strerror(errno));
-		pidfile = 0;
-		return 1;
-	}
-	pidfd = open(pidfile, O_CREAT | O_TRUNC | O_NOFOLLOW | O_WRONLY, 0644);
-	if (pidfd < 0) {
-		syslog(LOG_ERR, "Unable to set pidfile (%s)", strerror(errno));
-		pidfile = 0;
-		return 1;
-	}
-	(void)write(pidfd, val, (unsigned int)len);
-	close(pidfd);
-	return 0;
-}
-
 int
 main(int UNUSED(argc), char *argv[])
 {
@@ -606,8 +582,6 @@ main(int UNUSED(argc), char *argv[])
 	}
 #endif
 
-	write_pid_file();
-
 	syslog(LOG_NOTICE, "%s initialized", argv[0]);
 	process_connections();
 
-- 
1.7.9.3


[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux