diff options
author | Till Kamppeter <tkamppeter@mandriva.com> | 2005-08-03 08:14:29 +0000 |
---|---|---|
committer | Till Kamppeter <tkamppeter@mandriva.com> | 2005-08-03 08:14:29 +0000 |
commit | 0db35d38c56dcad87103e291057656d0c7769df2 (patch) | |
tree | 7ad72b4783528253d8da8b7b1e5680a2d103f2a0 /perl-install/standalone/autosetupprintqueues | |
parent | f0f245272fceee55c92b5daa3942927148d06a5d (diff) | |
download | drakx-backup-do-not-use-0db35d38c56dcad87103e291057656d0c7769df2.tar drakx-backup-do-not-use-0db35d38c56dcad87103e291057656d0c7769df2.tar.gz drakx-backup-do-not-use-0db35d38c56dcad87103e291057656d0c7769df2.tar.bz2 drakx-backup-do-not-use-0db35d38c56dcad87103e291057656d0c7769df2.tar.xz drakx-backup-do-not-use-0db35d38c56dcad87103e291057656d0c7769df2.zip |
- 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.
Diffstat (limited to 'perl-install/standalone/autosetupprintqueues')
-rwxr-xr-x | perl-install/standalone/autosetupprintqueues | 7 |
1 files 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; } } |