Dne út 25. února 2014 François Andriot napsal(a):
Hello, I've just found out some changes in the "starttde" script, see commit 77aed4a4 http://www.trinitydesktop.org/patches/1393268197:77aed4a4eba63e760c40cc 5b3d1ad556cad5c40f.diff
I do not agree with what that patch for 2 reasons:
- The principe: on my computer, I'm using TDE both on local session
and in remote session at the same time, using the same user account. So when I login remotely, this patch will probably kill my locally-opened session ...
- The way it is written: there are several piped commands (why not
using a single awk or simply use bash ?) and the code is not robust at all. What is my user is called "greppy" for example ? (ok this is unlikely, but not impossible). The "grep -v grep" will eliminate this line ...
Please avoid using a full-featured "ps" output then trying to parse the output! The "ps" command can already filter on user (ps -u $USER) and select output format (ps -o field1,field2 ...)
So, at very least, the command could look like :
ps -u ${USER} -o pid,cmd h | while read pid command args; do case "${command##*/}" in "dcopserver"|"gam_server") kill $pid ;; esac done
Another approach would be to parse the /proc/[0-9]*/ folders, to avoid using any "ps" command at all...
Francois
Sure - it confirms my concerns mentioned in mail http://trinity-devel.pearsoncomputing.net/?0::12960
In this mail are also my suggestions for using ps. However, since it was confirmed that killing kdesktop_lock and dcopserver "is dangerous", I propose to revert this commit completely.
Any objections?