Bug 28318 - vnc-server starts VNC in root directory, not home directory
Summary: vnc-server starts VNC in root directory, not home directory
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: vnc   
(Show other bugs)
Version: 7.1
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: David Lawrence
Depends On:
TreeView+ depends on / blocked
Reported: 2001-02-19 16:50 UTC by David Konerding
Modified: 2007-04-18 16:31 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-06-05 09:19:52 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
/etc/init.d/vncserver (1.65 KB, text/plain)
2001-02-19 22:29 UTC, Tim Waugh
no flags Details

Description David Konerding 2001-02-19 16:50:11 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.73 [en] (Win98; U)

starting the vnc-server at boot time for a user starts VNC in the root (/) directory, rather than the user's
home directory.  Whenever a user connects to the VNC server and opens a shell, it will open in
/ (I'm using fvwm2 as my window managed and rxvt as my shell) rather than the user's hme dir.

Reproducible: Always
Steps to Reproduce:
install vnc and vnc-server.  edit /etc/sysconfig/vncservers to add a user.  Start vnc using /etc/rc.d/init.d/vnc start.
Then, connect to the VNC session and start a shell.
This problem isn't exhibited with GNOME or KDE shells, presumably because they try to cd to the user's home
dir when they start.

Actual Results:  The rxvt shell starts in / instead of ~.

Expected Results:  VNC should be started from the user's home directory.  Any application that it started but
does not cd to the home dir will run from the root directory.

Comment 1 Tim Waugh 2001-02-19 22:29:01 UTC
Thanks for the report.  Please try out the attached replacement for
/etc/init.d/vncserver.  'service vncserver stop' should also now work.

Comment 2 Tim Waugh 2001-02-19 22:29:26 UTC
Created attachment 10420 [details]

Comment 3 Tim Waugh 2001-02-20 16:19:43 UTC
Fixed in 3.3.3r2-14.

Comment 4 Curtis Doty 2001-06-04 19:39:32 UTC
But the initscript still starts up in /root as evident by the message 
syslogged 'su: bash: /root/.bashrc: Permission denied'. Here's how I worked 

--- vncserver-3.3.3r2-14        Mon Feb 19 10:27:06 2001
+++ vncserver   Mon Jun  4 12:30:22 2001
@@ -26,7 +26,7 @@
         echo -n "${display} "
         initlog $INITLOG_ARGS -c \
-            "su ${display##*:} -c \"cd && [ -f .vnc/passwd ] && 
vncserver :${display%%:*}\""
+            "su ${display##*:} -c \"cd ~${display##*:} && [ -f .vnc/passwd ] 
&& vncserver :${display%%:*}\""
         [ "$RETVAL" -ne 0 ] && break

Comment 5 Tim Waugh 2001-06-05 13:18:18 UTC
Patch applied in 3.3.3r2-16.  Thanks.

Note You need to log in before you can comment on or make changes to this bug.