5

I, as I can believe anyone around, have been firing /usr/bin/startx for decades experiencing nothing but 100% satisfaction for the job it serves.

If it works… don't fix it !

The author of the script is however explicit :

Site administrators are STRONGLY urged to write nicer versions.

I am left just curious :

  • Does anyone know what historical reasons compelled the author to write such strong statement ?
  • Has anyone ever written any "nicer version", how and what for ?

Nota : I see a number of requests to close this question for the reason it would trigger opinion based answers.
I understand how the "nicer" qualifier could suggest taste judgements but I just can't imagine the author "STRONGLY urging" administrators to commit aesthetic changes.

Just lots of things are opened to changes in that script, from forcing client / server arguments, honoring / ignoring users .*rc to even incidentally forking whatever else than /usr/bin/xinit.

All these fiddlings + many more I don't even imagine particularly in the field of security, would certainly depend on perfectly reasonable motives and fit the purpose of special use cases. This is exactly what this question is about.

2
  • 1
    Not sure why the author wrote that, but sx is an attempt to write a "nicer" version as a very simple shell script. Commented Mar 18, 2022 at 4:39
  • 1
    It's a bit retrocomputing question, since the script was written many years ago, but on the other hand it's used daily by not so few people and will continue in the future. I actually typed it some minutes ago on the very same machine I'm writing this! To be honest, I had never checked the startx script, nice tickling @MC68020 ! Commented Mar 18, 2022 at 13:10

1 Answer 1

10
+50

startx was introduced in X11R3, in 1988, with the following changelog entry:

added a sample startx script that has conditionals for the appropriate systems.

This accompanied a number of improvements to xinit, such as support for user-specific .xserverrc and .xinitrc scripts to respectively start the server and client(s).

startx didn’t do much beyond that: it added support for system-wide xserverrc and xinitrc scripts (which could just as easily have been added to xinit itself), and cleans up after itself on A/UX Macintosh II systems (which were newly supported in R3) and Sun systems.

At the time, many systems would have had their own X startup scripts, whether to start the server, or start a default set of clients, if only because X11R2’s xinit was bare-bones and would require customization (or outright replacement) with a wrapper script at least, either provided by the system’s manufacturer (e.g. openwin on Sun systems) or by the local system administrator. startx was effectively a very simple template for system-specific startup scripts; it was extremely common for system administrators in the late 80s and early 90s to provide a lot of local content (scripts, man pages, etc.).

startx did include enough features to make it unnecessary in many cases to make any changes to it, since startup customization could be entirely handled by providing local xserverrc and xinitrc scripts. Its author presumably imagined that many system administrators already had better versions, or would “easily” write better versions reflecting their local constraints and preferences — e.g. many system administrators would not want users to be able to change the X server startup by providing their own .xserverrc.

One common change was to add more cleanup to the script, e.g. killing errant Netscape Navigator processes (at least on SPARCstations, Netscape Navigator 4.78 had a tendency to not exit when it lost its connection to the X11 server, going into a tight loop instead).

I don’t have archives of such scripts, but there were nicer versions, “nicer” as in “more appropriate for local usage” than the default version. Linux distributions also often carry startx patches, e.g. this one in Debian. More recently, sx is a replacement for both xinit and startx, with a number of improvements (hard-coded server startup, better xauth handling, more predictable tty handling). startx itself had many changes over the years, but the “Site administrators are STRONGLY urged to write nicer versions.” comment was never removed, even as reasons for them to do so were progressively removed.

The idea of startx being a sample, as mentioned in the changelog, fits with much of the rest of the X11 distribution; for example the X server was described as a “sample server”, with the idea that many manufacturers would provide their own implementation based on it:

The servers, libraries, and applications provided in this release are sample rather than reference implementations.

(quoting the X11R4 release notes; strictly speaking this is supposed to indicate that the implementations shouldn’t be used as a reference instead of the actual standards, not that the implementations are not intended to be used).

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.