diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2005-03-13 13:53:24 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2005-03-13 13:53:24 +0000 |
commit | 47daa9f39584a3a693993108bf15d87e6ba3888a (patch) | |
tree | 9e5f49f576273ff083e681f0d0cf86e6fb9073e2 | |
parent | 0dfb48e107b01eecbbe777df597a9aaedd18ec7f (diff) |
turn off accounting when switching to single user;
report bluhm at genua.de; ok henning, krw, deraadt
-rw-r--r-- | sbin/init/init.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sbin/init/init.c b/sbin/init/init.c index 5a23245bdc9..c6cd51a9d17 100644 --- a/sbin/init/init.c +++ b/sbin/init/init.c @@ -1,4 +1,4 @@ -/* $OpenBSD: init.c,v 1.35 2004/03/16 01:11:09 tedu Exp $ */ +/* $OpenBSD: init.c,v 1.36 2005/03/13 13:53:23 markus Exp $ */ /* $NetBSD: init.c,v 1.22 1996/05/15 23:29:33 jtc Exp $ */ /*- @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)init.c 8.2 (Berkeley) 4/28/95"; #else -static char rcsid[] = "$OpenBSD: init.c,v 1.35 2004/03/16 01:11:09 tedu Exp $"; +static char rcsid[] = "$OpenBSD: init.c,v 1.36 2005/03/13 13:53:23 markus Exp $"; #endif #endif /* not lint */ @@ -1300,6 +1300,9 @@ nice_death(void) kill(sp->se_process, SIGHUP); } + /* terminate the accounting process */ + acct(NULL); + /* NB: should send a message to the session logger to avoid blocking. */ logwtmp("~", "shutdown", ""); @@ -1370,6 +1373,9 @@ death(void) pid_t pid; static const int death_sigs[3] = { SIGHUP, SIGTERM, SIGKILL }; + /* terminate the accounting process */ + acct(NULL); + for (sp = sessions; sp; sp = sp->se_next) sp->se_flags |= SE_SHUTDOWN; |