Bug 171585 - --workdir fails on symlink
Summary: --workdir fails on symlink
Status: RESOLVED WORKSFORME
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-24 13:25 UTC by Jonas Stein
Modified: 2009-02-22 05:10 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
strace konsole --workdir CIP2 2> error-log (37.48 KB, application/x-gzip)
2008-09-24 23:04 UTC, Jonas Stein
Details
strace -f konsole --workdir CIP2 2> error-log (181.15 KB, application/x-gzip)
2008-09-27 22:59 UTC, Jonas Stein
Details

Note You need to log in before you can comment on or make changes to this bug.
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.