From 5c483a011299a83e190db81e52e11ca844b07d23 Mon Sep 17 00:00:00 2001 From: braam Date: Tue, 11 Jan 2000 16:04:18 +0000 Subject: [PATCH] A few steps forward towards a working daemon. Why is the process name "insmod" instead of "pupd"? --- lustre/obdfs/flushd.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lustre/obdfs/flushd.c b/lustre/obdfs/flushd.c index 8a3eaf4..2732e44 100644 --- a/lustre/obdfs/flushd.c +++ b/lustre/obdfs/flushd.c @@ -108,9 +108,14 @@ static int pupdate(void *unused) struct task_struct * tsk = current; int interval; + pupdated = current; + + exit_files(current); + exit_mm(current); + tsk->session = 1; tsk->pgrp = 1; - strcpy(tsk->comm, "pupdate"); + sprintf(tsk->comm, "pupd"); pupdated = current; printk("pupdate() activated...\n"); @@ -136,16 +141,17 @@ static int pupdate(void *unused) printk("pupdate() stopped...\n"); tsk->state = TASK_STOPPED; MOD_DEC_USE_COUNT; - schedule(); /* wait for SIGCONT */ + printk("RETURN from PUPD\n"); + return 0; } /* check for sigstop */ if (signal_pending(tsk)) { int stopped = 0; spin_lock_irq(&tsk->sigmask_lock); - if (sigismember(&tsk->signal, SIGSTOP)) + if (sigismember(&tsk->signal, SIGTERM)) { - sigdelset(&tsk->signal, SIGSTOP); + sigdelset(&tsk->signal, SIGTERM); stopped = 1; } recalc_sigpending(tsk); @@ -163,7 +169,8 @@ int flushd_init(void) { /* kernel_thread(bdflush, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND); */ MOD_INC_USE_COUNT; - kernel_thread(pupdate, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND); + kernel_thread(pupdate, NULL, 0); + printk("flushd inited\n"); return 0; } -- 1.8.3.1