Re: [LINUX:1458] Linux'da logoff olduktan sonra...

Murat Arslan (arslanm@arslanm.linux-tr.EU.org)
Fri, 27 Mar 1998 13:22:22 +0000 (GMT)


On Fri, 27 Mar 1998, Selimcan Dalgic wrote:

> Selam,
>
> Acaba linux'da kullanicilarin logoff olduktan sonra sistemde proses
> birakamamalarini saglayabilirmiyim, sagalayabilirsem nasil?
> kullandigimiz linux RedHat 4.2

Basit shell scripting iLe bunu yapabiLirsiniz..

SheLL'i csh/tcsh oLanLar iCin /etc/csh.logout'un iCine Sunu yazIn..

set kim = `whoami`
if ($kim != root) then
echo "Terminating all processes of user $kim"
sleep 1
kill -9 -1
endif

ve Shell'i bash oLan kullanicilarin home dizinLerine de
.bash_logout diye bir dosya bIrakIn, iCinde de aSaGIdakiLer oLsun:
unutmadan home dizinlere biraktiginiz dosyalarin ownerini root yapIn
ve sadece root'a permission verin
(bunu chown root.root .bashlogout ve chmod go-rw .bash_logout
komutlariyla yapabilirsiniz) ornek:

-rw------- 2 root root 102 Oct 27 22:05 .bash_logout

ve bu .bash_logout dosyasInI /etc/skel dizinine de kopyaLayIn ki
sonrasInda acacaGInIz userLarIn home dizinLErine de bu dosya gonderiLsin.

--- .bash_logout: --
kim=`whoami`
if [ $kim != "root" ]; then
echo "Terminating all processes of user $kim"
sleep 1
kill -9 -1
fi

KoLay geLsin,
__
Murat Arslan
PGP KeyID : 2047/673351F1
For PGPkey: finger arslanm@gate.marketweb.net.tr
Key FPrint: F1C6 E3F2 91C2 CD98 440B 4073 DFBC 532F