Bug 12802 - Each KDE session starts a new copy of autorun
Summary: Each KDE session starts a new copy of autorun
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: autorun
Version: 6.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Harald Hoyer
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-06-22 04:07 UTC by Aleksey Nogin
Modified: 2008-05-01 15:37 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-07-12 10:05:10 UTC
Embargoed:


Attachments (Terms of Use)

Description Aleksey Nogin 2000-06-22 04:07:31 UTC
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 10:05:09 UTC
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-17 01:19:05 UTC
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-23 03:23:11 UTC
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 12:39:41 UTC
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 17:23:28 UTC
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 16:53:09 UTC
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 13:53:17 UTC
you may try autorun-2.65-1



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