[sudo-users] troubleshooting with logs

Todd C. Miller Todd.Miller at courtesan.com
Tue Jul 19 14:50:01 EDT 2005

In message <42DD24BE.9020902 at ferma.fr>
	so spake Fabrice Schuler (fabrice.schuler):

> But I have problems wih a daemon calling sudo. This daemon has no tty.

Are you sure about that?  Unless the daemon disassociates from its
tty it will still have one.  This is usually accomplished via the
setsid() system call.  You should be able to tell via the ps command
whether a process has a tty associated with it.

> On the first times (I would say for a couple of weeks), the TTY logged 
> in sudo logs was "console"
> My problem is that this tty is reserved for the console, and, according 
> to all the documentation I could find on the web, it is not possible to 
> attach a process to this tty if not logged on the console (which is not 
> the case - I am certain of that)...
> I agree this may not come from sudo, but if somebody ever had the same 
> problem, or may know where it comes from or what I did for this to 
> happen, I prefer to ask.

Not necesarily, the daemon in question might have been started by
someone who was logged in on the console.  Just because there is a
process associated with a particular tty does not prevent a new
user from logging in on that tty.

> For the moment, the tty logged is "unknown". Is it correct for a daemon 
> to be logged with this TTY (I guess so, but as I said, I could not find 
> any documentation about this) ?

Sudo logs the console as "unknown" when the ttyname() function
returns NULL.  This usually means there is no tty associated with
the process.
 - todd

More information about the sudo-users mailing list