Bug#775608: shutdown-at-night: fails to shut down the system if gdm3 is used

2015-01-17 Thread Wolfgang Schweer
Package: shutdown-at-night
Version: 0.14
Severity: important
Tags: patch


The gdm3 greeter seems to be a special gnome-session running as a user 
with name '(unknown)'. shutdown-at-night uses 'who' to decide if users 
are still active but doesn't recognize this very case.

The patch has been tested and commited to git.

(wheezy is affected as well, version: 0.10+deb7u2)


diff --git a/shutdown-at-night b/shutdown-at-night
index 4427ef7..9411014 100755
--- a/shutdown-at-night
+++ b/shutdown-at-night
@@ -98,7 +98,7 @@ prepare_wakeonlan() {
 
 # Return true if local user is logged in, false otherwise
 is_local_user() {
-if [ "$(who)" ] ; then
+if [ "$(who | grep -v '\(unknown\)')" ] ; then
 return 0
 else
 return 1


Wolfgang



signature.asc
Description: Digital signature


Bug#775608: shutdown-at-night: fails to shut down the system if gdm3 is used

2015-01-18 Thread Petter Reinholdtsen
[Wolfgang Schweer]
> The gdm3 greeter seems to be a special gnome-session running as a user
> with name '(unknown)'. shutdown-at-night uses 'who' to decide if users
> are still active but doesn't recognize this very case.

Gah, I really wish gdm would make up its mind on how to handle utmp and
wtmp.

> The patch has been tested and commited to git.
>
> (wheezy is affected as well, version: 0.10+deb7u2)

Look good to me.  Should we try to get it into Jessie?  I can't upload
at the moment, so I hope someone can step up. :)

-- 
Happy hacking
Petter Reinholdtsen


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#775608: shutdown-at-night: fails to shut down the system if gdm3 is used

2015-01-19 Thread Wolfgang Schweer
On Sun, Jan 18, 2015 at 09:37:51AM +0100, Petter Reinholdtsen wrote:
> [Wolfgang Schweer]
> > The gdm3 greeter seems to be a special gnome-session running as a user
> > with name '(unknown)'. shutdown-at-night uses 'who' to decide if users
> > are still active but doesn't recognize this very case.
> 
> Gah, I really wish gdm would make up its mind on how to handle utmp and
> wtmp.
> 
> > The patch has been tested and commited to git.
> >
> > (wheezy is affected as well, version: 0.10+deb7u2)
> 
> Look good to me.  Should we try to get it into Jessie?

Yes. And it would be good to get it into wheezy-updates as well. 
Actually, the error was noticed on a wheezy workstation.

> I can't upload at the moment, so I hope someone can step up. :)

Wolfgang



signature.asc
Description: Digital signature