<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - systemctl [reboot|shutdown] wronly believes root is still logged in on a tty"
href="https://bugs.freedesktop.org/show_bug.cgi?id=62676#c4">Comment # 4</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - systemctl [reboot|shutdown] wronly believes root is still logged in on a tty"
href="https://bugs.freedesktop.org/show_bug.cgi?id=62676">bug 62676</a>
from <span class="vcard"><a class="email" href="mailto:peter.weber@ttyhoney.com" title="Peter Weber <peter.weber@ttyhoney.com>"> <span class="fn">Peter Weber</span></a>
</span></b>
<pre><a href="http://cgit.freedesktop.org/systemd/systemd/tree/src/systemd/sd-login.h">http://cgit.freedesktop.org/systemd/systemd/tree/src/systemd/sd-login.h</a>
// from sd-login.h
/* Get all sessions, store in *sessions. Returns the number of
* sessions. If sessions is NULL only returns number of sessions. */
int sd_get_sessions(char ***sessions);
<a href="http://cgit.freedesktop.org/systemd/systemd/tree/src/login/sd-login.c">http://cgit.freedesktop.org/systemd/systemd/tree/src/login/sd-login.c</a>
// from sd-login.c
_public_ int sd_get_sessions(char ***sessions) {
return get_files_in_directory("/run/systemd/sessions/", sessions);
}
This directory contains a ASCII-File and a PIPE, after "root" has logged out
from the TTY the pipe is gone. But the ASCII-File is still there and contains:
# This is private data. Do not parse.
UID=0
USER=root
ACTIVE=0
STATE=closing
REMOTE=0
KILL_PROCESSES=0
TYPE=tty
CLASS=user
SEAT=seat0
TTY=tty2
SERVICE=login
VTNR=2
LEADER=12877
AUDIT=3
Well. This file remains there. It doesn't go away.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>