Bug 171585

Summary: --workdir fails on symlink
Product: [Applications] konsole Reporter: Jonas Stein <news>
Component: generalAssignee: Konsole Developer <konsole-devel>
Status: RESOLVED WORKSFORME    
Severity: normal CC: news, robertknight
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: strace konsole --workdir CIP2 2> error-log
strace -f konsole --workdir CIP2 2> error-log

Description Jonas Stein 2008-09-24 13:25:50 UTC
Version:            (using KDE 3.5.9)
OS:                Linux
Installed from:    Debian testing/unstable Packages

/symdir is an symlink to /foo

konsole --workdir /symdir

will fail and it opens at the users homedir.
Comment 1 Robert Knight 2008-09-24 14:08:53 UTC
Hello,

Thank-you for the report.  I am not able to reproduce here with KDE 3.5.9 or KDE 4.1.  Konsole resolves the symlink and opens in the correct directory.
Comment 2 Jonas Stein 2008-09-24 20:48:25 UTC
(In reply to comment #1)
> Thank-you for the report.  I am not able to reproduce here with KDE 3.5.9 or
> KDE 4.1.  Konsole resolves the symlink and opens in the correct directory.

i have not been precise enough. I found out, that this error 
does not appear on my second pc. 

Both use the same version of konsole and KDE.
difference is, that the pc with the bug uses AFS (Andrew File System)
may be this is the problem? 
If there is anything i should run for log/testing please leave me a mail.

this bug is reproducable and not like Bug 94864 only from the second instance on.

$ konsole -v
Qt: 3.3.8b
KDE: 3.5.9
Konsole: 1.6.6
Comment 3 Robert Knight 2008-09-24 21:30:50 UTC
It might be helpful to see a log of the files accessed by Konsole on startup:

strace konsole --workdir /symlink 2> error-log
Comment 4 Jonas Stein 2008-09-24 23:04:11 UTC
Created attachment 27559 [details]
strace konsole --workdir CIP2 2> error-log

strace konsole --workdir CIP2 2> error-log
Comment 5 Robert Knight 2008-09-25 00:27:41 UTC
Hi Jonas,

I forgot to mention that you need to supply the -f argument to strace to get a trace from the shell as well:

strace -f konsole --workdir CIP2 2> error-log


Comment 6 Jonas Stein 2008-09-27 22:59:43 UTC
Created attachment 27596 [details]
strace -f konsole --workdir CIP2 2> error-log
Comment 7 Robert Knight 2008-09-28 13:46:58 UTC
From the second log it looks like Konsole is successfully changing the working directory to the one you specify, then starting bash.  At some point during bash's startup, after it has read  it is changing the directory back to your home directory.

(Process 16431 is your bash shell):

[pid 16431] stat64("/afs", {st_mode=S_IFDIR|0777, st_size=12288, ...}) = 0
[pid 16431] stat64("/afs/rrz.uni-koeln.de", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid 16431] stat64("/afs/rrz.uni-koeln.de/usr", {st_mode=S_IFDIR|0755, st_size=12288, ...}) = 0
[pid 16431] stat64("/afs/rrz.uni-koeln.de/usr/uninv", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid 16431] stat64("/afs/rrz.uni-koeln.de/usr/uninv/81", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
[pid 16431] stat64("/afs/rrz.uni-koeln.de/usr/uninv/81/jstein3", {st_mode=S_IFDIR|0750, st_size=8192, ...}) = 0
** [pid 16431] chdir("/afs/rrz.uni-koeln.de/usr/uninv/81/jstein3") = 0 **
[pid 16431] rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
[pid 16431] rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
[pid 16431] rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
[pid 16431] rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
[pid 16431] rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0
[pid 16431] stat64("/afs/rrz.uni-koeln.de/usr/uninv/81/jstein3/.bashrc.mine", 0xbfcc9d78) = -1 ENOENT (No such file or directory)
[pid 16431] rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0

Perhaps you have something in one of your init scripts which is doing this?  Try using a different terminal (eg. xterm) or a different shell and see if you get the same result.
Comment 8 Kurt Hindenburg 2009-02-22 05:10:06 UTC
Reopen if you can duplicate this with a KDE 4 version.  Thanks.