From 0db35d38c56dcad87103e291057656d0c7769df2 Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Wed, 3 Aug 2005 08:14:29 +0000 Subject: - Fixed bug of warning being issued when autosetupprintqueues is triggered while no one is logged in on the X console (bug #17264). - Removed logging into a file with constant name. This was only there as an aid for the development. --- perl-install/standalone/autosetupprintqueues | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/perl-install/standalone/autosetupprintqueues b/perl-install/standalone/autosetupprintqueues index c8c3d54fd..45684cfac 100755 --- a/perl-install/standalone/autosetupprintqueues +++ b/perl-install/standalone/autosetupprintqueues @@ -32,14 +32,14 @@ $gui ||= "auto"; if ($gui ne "nogui") { # Auto-detect whether we go in non-X mode or not - my $desktopuser = `cat /var/run/console.lock`; + my $desktopuser = `cat /var/run/console.lock 2>/dev/null`; if (!$desktopuser) { if ($gui eq "auto") { # Non-X mode $gui = "nogui"; } elsif ($gui eq "waitforgui") { # Wait until a user logs in on the system's X console - while (!($desktopuser = `cat /var/run/console.lock`)) { + while (!($desktopuser = `cat /var/run/console.lock 2>/dev/null`)) { sleep(5); } # Wait for the window manager to start @@ -58,7 +58,8 @@ if ($gui ne "nogui") { # Allow root's windows to be opened on the user's display and # start printerdrake then, in a mode to do nothing else than # automatically setting up print queues. - system "export DISPLAY=\"localhost:0.0\"; USER=$desktopuser; /bin/su $desktopuser -c \"/usr/X11R6/bin/xhost +localhost > /tmp/pderror 2>&1\"; /usr/sbin/printerdrake --onlyautoqueue >> /tmp/pderror 2>&1; /bin/su $desktopuser -c \"/usr/X11R6/bin/xhost -localhost >> /tmp/pderror 2>&1\""; + my $errfile = "/dev/null"; + system "export DISPLAY=\"localhost:0.0\"; USER=$desktopuser; /bin/su $desktopuser -c \"/usr/X11R6/bin/xhost +localhost > $errfile 2>&1\"; /usr/sbin/printerdrake --onlyautoqueue >> $errfile 2>&1; /bin/su $desktopuser -c \"/usr/X11R6/bin/xhost -localhost >> $errfile 2>&1\""; exit 0; } } -- cgit v1.2.1