UTMP: Only account for getty processes

This patch removes accounting for all processes to instead implement the
traditional SysV getty accounting.  (Telnet/SSH et al maintain their own
accounding for UTMP.)

TODO: WTMP support

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2016-08-17 18:43:49 +02:00
1 parent b6bf8bf518
commit 5bab329178
3 files changed
+4 -11

No files matched your search

-8
View File
@@ -152,7 +152,6 @@ static int service_start(svc_t *svc)
pid = fork();
if (pid == 0) {
int status;
char id[5];
char *home = NULL;
#ifdef ENABLE_STATIC
int uid = 0; /* XXX: Fix better warning that dropprivs is disabled. */
@@ -161,10 +160,6 @@ static int service_start(svc_t *svc)
#endif
char *args[MAX_NUM_SVC_ARGS];
/* Set INIT_PROCESS UTMP entry */
snprintf(id, sizeof(id), "%d", svc->job);
utmp_set_init(ttyname(0), id);
/* Set desired user */
if (uid >= 0) {
setuid(uid);
@@ -667,9 +662,6 @@ void service_monitor(pid_t lost)
svc_t *svc;
char pidfile[MAX_ARG_LEN];
/* Set DEAD_PROCESS UTMP entry */
utmp_set_dead(lost);
if (fexist(SYNC_SHUTDOWN) || lost <= 1)
return;