Bug 12802 - Each KDE session starts a new copy of autorun
Each KDE session starts a new copy of autorun
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: autorun (Show other bugs)
6.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Harald Hoyer
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-06-22 00:07 EDT by Aleksey Nogin
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-07-12 06:05:10 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Aleksey Nogin 2000-06-22 00:07:31 EDT
Each time a user loggs in and starts a KDE session, KDE would start a new
autorun process. For some reason the small nash script that is supposed to
check whether autorun is already running does not work properly.

bash$ ps uxww|grep autorun
nogin    10858  0.0  0.2  1364  520 pts/7    S    00:02   0:00 grep autorun
bash$ tt=`/sbin/pidof autorun`;if test -O /dev/console -a x$tt=x -a -x
/usr/bin/autorun;then /usr/bin/autorun --interval=1000 
--cdplayer=/usr/bin/kscd & fi
[1] 10861
bash$ tt=`/sbin/pidof autorun`;if test -O /dev/console -a x$tt=x -a -x
/usr/bin/autorun;then /usr/bin/autorun --interval=1000
--cdplayer=/usr/bin/kscd & fi
[2] 10865
bash$ !ps
ps uxww|grep autorun
nogin    10861  1.1  0.2  1524  696 pts/7    S    00:02   0:00
/usr/bin/autorun --interval=1000 --cdplayer=/usr/bin/kscd
nogin    10865  1.2  0.2  1524  696 pts/7    S    00:02   0:00
/usr/bin/autorun --interval=1000 --cdplayer=/usr/bin/kscd
nogin    10868  0.0  0.2  1364  520 pts/7    S    00:02   0:00 grep autorun
Comment 1 Harald Hoyer 2000-07-12 06:05:09 EDT
You may use this Autorun.kdelnk ... will make an errata.
# KDE Config File
[KDE Desktop Entry]
SwallowTitle=
SwallowExec=
BinaryPattern=
Name=Autorun
MimeType=
Exec=/bin/bash -c "tt=`/sbin/pidof autorun`;if test -O /dev/console -a x$tt=x -a
 -x /usr/bin/autorun;then /usr/bin/autorun --interval=1000 --cdplayer=/usr/bin/k
scd & fi"
Icon=cd.xpm
Path=
Type=Application
Comment 2 Andrei Ivanov 2000-08-16 21:19:05 EDT
Guess, the following is related to discussion above:

My home directory is mounted on demand by automounter (autofs-3.1.4-4),
but when I close KDE session, home directory remains mounted endlessly,
ignoring any options in auto.master map. The only process remining after
KDE session ended (started in my name, of course) is /usr/bin/autorun
Comment 3 Itai Nahshon 2000-08-22 23:23:11 EDT
Is there a security problem? Autorun may run things with
the permission of a user that's already logged out!
Comment 4 Harald Hoyer 2000-08-23 08:39:41 EDT
True, true... users should use kautorun or magicdev.  But the user may not have
access to the cdrom anymore, cause the ownership will change for /dev/cdrom.
Comment 5 Stephen Walton 2000-11-13 12:23:28 EST
The modified Autorun.kdelnk which Harald posted here is missing the real
correction, I think:  the "x$tt=x" needs to be "x$tt = x" with a space before
and after the equal sign.

Is there any way to ensure that autorun is killed when a KDE user logs out?  I
wasn't able to find anything called kautorun in any of the 6.2 RPMS.  Is
magicdev perferable?
Comment 6 Gilles Detillieux 2001-04-05 12:53:09 EDT
The fix suggested by swalton is still not quite enough, because it seems
the $tt gets swallowed up even before bash sees it.  I found by trial and
error that you need to double up the dollar-sign to pass it to the shell.
I also added a -s option to pidof, just in case there are already more than
one of the autorun processes running.  Here's my patch...

--- /etc/skel/Desktop/Autostart/Autorun.kdelnk.orig	Mon Feb 14 11:03:46 2000
+++ /etc/skel/Desktop/Autostart/Autorun.kdelnk	Thu Apr  5 10:54:19 2001
@@ -5,7 +5,7 @@ SwallowExec=
 BinaryPattern=
 Name=Autorun
 MimeType=
-Exec=/bin/bash -c "tt=`/sbin/pidof autorun`;if test -O /dev/console -a x$tt=x
-a -x /usr/bin/autorun;then /usr/bin/autorun --interval=1000
--cdplayer=/usr/bin/kscd & fi"
+Exec=/bin/bash -c "tt=`/sbin/pidof -s autorun`;if test -O /dev/console -a x$$tt
= x -a -x /usr/bin/autorun;then /usr/bin/autorun --interval=1000
--cdplayer=/usr/bin/kscd & fi"
 Icon=cd.xpm
 Path=
 Type=Application
Comment 7 Harald Hoyer 2001-04-06 09:53:17 EDT
you may try autorun-2.65-1

Note You need to log in before you can comment on or make changes to this bug.