summaryrefslogtreecommitdiff
path: root/src/selinux-setup.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-07-25 21:22:57 +0200
committerLennart Poettering <lennart@poettering.net>2011-07-25 21:22:57 +0200
commit871e580949b1417058da7f7e9fa0380d308ef708 (patch)
treecd8d308e7ab3c81c42259b3ed2a636334be9b367 /src/selinux-setup.c
parent41e4d6e9ace4f3b717af3c0419b69a2ac7935116 (diff)
selinux: log how much time it takes to load the SELinux policy and database
Diffstat (limited to 'src/selinux-setup.c')
-rw-r--r--src/selinux-setup.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/selinux-setup.c b/src/selinux-setup.c
index 9ff27dcd77..f400f416da 100644
--- a/src/selinux-setup.c
+++ b/src/selinux-setup.c
@@ -37,6 +37,7 @@
int selinux_setup(char *const argv[]) {
#ifdef HAVE_SELINUX
int enforce = 0;
+ usec_t n;
/* Already initialized? */
if (path_is_mount_point("/sys/fs/selinux") > 0 ||
@@ -48,8 +49,13 @@ int selinux_setup(char *const argv[]) {
* relabel things. */
touch("/dev/.systemd-relabel-run-dev");
+ n = now(CLOCK_MONOTONIC);
if (selinux_init_load_policy(&enforce) == 0) {
- log_debug("Successfully loaded SELinux policy, reexecuting.");
+ char buf[FORMAT_TIMESPAN_MAX];
+
+ n = now(CLOCK_MONOTONIC) - n;
+ log_info("Successfully loaded SELinux policy in %s, reexecuting.",
+ format_timespan(buf, sizeof(buf), n));
/* FIXME: Ideally we'd just call setcon() here instead
* of having to reexecute ourselves here. */