Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 21417 - Add xfs port to XF86Config.example
Summary: Add xfs port to XF86Config.example
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-21 08:39 UTC by Marsh Ray
Modified: 2004-03-17 11:32 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
shows xfsinfo at least can't work with std init.d/xfs or xfs -port -1 (test_xfs_patch_log.txt,2.10 KB, text/plain)
2003-05-23 09:34 UTC, Marsh Ray
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marsh Ray 2003-05-21 08:39:55 UTC
The xfs that comes with XFree86 didn't work for me in the default configuration.
The conf file /etc/conf.d/xfs defines XFS_PORT="-1" so it should only listen on
unix-domain sockets. In practice, it seems specifying '-port -1' on the command
line confuses xfs and he can't listen on _any_ socket. The -port switch is meant
to apply only to tcp port numbers, and tcp listening is turned off by default in
/etc/X11/fs/config.
The following patch eliminates the -port switch if XFS_PORT is -1.

*** /etc/init.d/xfs.r0  Sun May 18 22:23:59 2003
--- /etc/init.d/xfs     Wed May 21 07:56:02 2003
***************
*** 272,286 ****
                setup_font_dirs
        fi
   
        ebegin "Starting X Font Server"
        if [ "`grep -e "^xfs:" /etc/passwd`" ] ; then
                start-stop-daemon --start --quiet --exec /usr/X11R6/bin/xfs \
                        -- -daemon -config /etc/X11/fs/config \
!                               -droppriv -user xfs -port ${XFS_PORT} 1>&2
        else
                start-stop-daemon --start --quiet --exec /usr/X11R6/bin/xfs \
                        -- -daemon -config /etc/X11/fs/config \
!                               -port ${XFS_PORT} 1>&2
        fi
        eend $?
  }
--- 272,294 ----
                setup_font_dirs
        fi
   
+       # xfs seems to choke on the bogus port number -1, which is also the
+       # default.
+       if [ "${XFS_PORT}" -le 0 ] ; then
+               xfs_port_switch=""
+       else
+               xfs_port_switch="-port ${XFS_PORT}"
+       fi
+
        ebegin "Starting X Font Server"
        if [ "`grep -e "^xfs:" /etc/passwd`" ] ; then
                start-stop-daemon --start --quiet --exec /usr/X11R6/bin/xfs \
                        -- -daemon -config /etc/X11/fs/config \
!                               -droppriv -user xfs ${xfs_port_switch} 1>&2
        else
                start-stop-daemon --start --quiet --exec /usr/X11R6/bin/xfs \
                        -- -daemon -config /etc/X11/fs/config \
!                               -${xfs_port_switch} 1>&2
        fi
        eend $?
  }
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2003-05-21 14:11:43 UTC
Looks fine here:

--------------------------------------------------------------
nosferatu root # lsof /tmp/.font-unix/fs-1
COMMAND  PID USER   FD   TYPE     DEVICE SIZE NODE NAME
xfs     7457  xfs    3u  unix 0xf6e994bc      7738 /tmp/.font-unix/fs-1
xfs     7457  xfs    5u  unix 0xf5150d2c      9997 /tmp/.font-unix/fs-1
nosferatu root # ps aux --cols 220 | grep xfs
xfs       7457  0.0  0.6  7264 5640 ?        S    May20   0:00 /usr/X11R6/bin/xfs -daemon -config /etc/X11/fs/config -droppriv -user xfs -port -1
root     32667  0.0  0.0  1576  484 pts/9    S    20:12   0:00 grep xfs
nosferatu root # 
Comment 2 Marsh Ray 2003-05-23 09:34:04 UTC
Created attachment 12334 [details]
shows xfsinfo at least can't work with std init.d/xfs or xfs -port -1

This log shows that xfs on my machine isn't usable from unix/:7100 when invoked
with -port -1, at least by xfsinfo. I am also unable to use it from X when
invoked that way.
In the log, note that /etc/init.d/xfs.r0 is the original script, while .r1 had
my submitted patch applied.
Thanks,
- Marsh
Comment 3 Seemant Kulleen (RETIRED) gentoo-dev 2003-06-02 19:14:13 UTC
foser found this link -- please look at it: http://www.geocrawler.com/archives/3/69/2000/3/0/3377232/
Comment 4 Seemant Kulleen (RETIRED) gentoo-dev 2003-06-04 04:17:58 UTC
Marsh, thoughts?
Comment 5 foser (RETIRED) gentoo-dev 2003-06-04 06:03:58 UTC
i'd say it's a permissions problem on your side, maybe /tmp has the wrong permissions or maybe you are using some security enhanced kernel that is in the way here ?
Comment 6 Rod May 2003-06-06 01:43:55 UTC
seems to me that both xfree and xfs are just opening the unix domain socket:

/tmp/.font-unix/fsXXX

for xfree: XXX is the *text* in 'Fontpath unix/:XXX'
for xfs:   XXX is the *text* in the '-port XXX' argument,
           but xfs defaults XXX to 7100 if the port arg not specified

so...with current gentoo setup i.e. 'port -1' is used, then use
unix:/:-1 in your xfree config. It works (without the patch).

but yeah the terms '-1' '7100' and 'tcp default' are mentioned and mixed
up in so many docs ... seems very confusing.... had me for a while.

and as you say, when xfs man page says port argument is *only* for tcp,
but it *does* affect which unix domain socket is used even if tcp not used.

I assume most authors assumed tcp will be used when writing docs,
but thats an assumption :)
Comment 7 Rod May 2003-06-06 01:51:52 UTC
PS:

I'd also say an entry (even if commented out) of

#FontPath     "unix/:-1"

should be in the XF86Config.example, as "unix/:7100" doesnt work.

thats if the xfs script is *not* going to be changed of course :)
Comment 8 Seemant Kulleen (RETIRED) gentoo-dev 2003-06-06 02:11:07 UTC
the commented entry in the example can be done, for sure
Comment 9 Donnie Berkholz (RETIRED) gentoo-dev 2003-09-06 19:50:26 UTC
A followup to comment #2, which had incorrect syntax. It should be apparent that if xfs is configured to listen on port -1, it won't be listening on port 7100.

# xfsinfo -server unix/:-1
name of server: unix/:-1
version number: 2
vendor string:  The XFree86 Project (experimental version)
vendor release number:  6600
maximum request size:   8192 longwords (32768 bytes)
number of catalogues:   1
        all
Number of alternate servers: 0
number of extensions:   0
Comment 10 Donnie Berkholz (RETIRED) gentoo-dev 2004-03-17 11:32:25 UTC
Fixed in 4.3.0-r6.