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
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
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
Is there a security problem? Autorun may run things with the permission of a user that's already logged out!
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.
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?
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
you may try autorun-2.65-1