Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the solutions to the failure of startx to start the graphical interface?

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article focuses on "what are the solutions to the failure of startx to start the graphical interface", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn what are the solutions to the failure of startx to start the graphical interface.

Many linux users have had such a painful experience. When you log in and enter this lovely startx as usual, you just receive an error message.

Many of us gnu/linux users have had such a terrible experience. When you

Many linux users have had such a painful experience. When you

Login and type the sweet startx as usual, you only receive scrolling lines

When you log in and enter this lovely startx as usual, you just receive

Of error messages. One copy of the error message is usually stored in

Error message. Errors are usually stored in the

/ var/log/XFree86.0.log. If you can access the log file, you will notice

/ var/log/XFree86.0.log . If you read this log file, you will notice

The last lines of the file may look like this:

The last line of the file usually looks like this:

Could not init font path element unix/:7100, removing from list!

Fatal server error:

Could not open default font 'fixed'

I have to admit that I was in panic when I saw this message in the first

I have to admit that I panicked when I saw these messages for the first few times.

Several times. As an intermediate user of linux system, I was not so

As an intermediate linux user, I feel that dialing with the command console and surfing with lynx is not possible.

Comfortable using text console for modem dialup and surfing with lynx. So

Comfortable surfing. So

I had to spend a lot of time on another box and use Google to search for

I have to spend a lot of time on another computer using Google to search for help on the Internet.

Help on web. It was amazing that so many people like me have this exact

It's surprising that so many people have it like me.

Terrible experience and those replies in web forums and mailing lists

Horrific experiences and responses to online forums and mailing lists

Generally offer more sympathy than real help. Using our common sense and

Generally offer more compassion than real help. With our general understanding and

Some research, most of us can figure out this failure has something to do

According to the research, most of us can judge that this is the failure of X font service.

With X font server.

After having done a little more research, now I believe that this failure

After further research, I now believe that

May not be so serious as it looks. Please follow me by doing the steps

It's not as serious as people think. Please follow me to do the following steps

Below, in most of the cases you will get your X windows starting up again.

In most cases you will be able to re-enter X windows.

Note: The following examples run on my Red Hat box. But I believe they are

Note: these examples are on my Red Hat system. But I trust them.

General enough to be used for other distributions.

It is usually sufficient to apply to other distributions.

1. Check if the X font server is running.

1. Check whether the X font service is running.

Some people like me tend to suspect it is caused by bugs in the X font

Some people, like me, tend to suspect that this is caused by bugs, the X font service.

Server, but it turned out that X font server is quite robust. We can run

But it proves that the X font service is good. We can run it.

The xfs script under / etc/init.d to see if the font server is running.

The xfs folder is in / etc/init.d to see if the font service is running.

[root@localhost / root] # / etc/init.d/xfs status

Xfs (pid 1385) is running...

In some cases, the only reason for the failure is that the font server is

In some cases, the only reason for failure is that the font service stops.

Dead. So, you need to restart font server like this:

So, you need to restart the font service like this:

[root@localhost / root] # / etc/init.d/xfs start

Starting xfs: [OK]

Well, my learned lesson is don't take this'[OK] 'for granted. You have to

Well, my study course does not recognize that OK is real. You must

Check the status again to see if it is running. If it does run, you can

Check the status again to see if it is running. If it doesn't work, you can try

Try startx to see if you can start X windows. If you still cannot start X

Startx to see if you can start X windows. When the font service is running, if you still can't run X

Server when the font server runs, it means you are having more serious

Service, which means you have more serious mistakes.

Trouble. You need to waste a little more time reading on the following

You need to spend a little more time reading the following steps.

Steps.

Note: In a weird case, my root partition was fully filled by two huge log

Note: in an odd case, my root directory is full of two information files larger than 2GB.

Files occupying more than 2 GB. The font server dies when it cannot write

When it is not possible to write into / tmp font service stops.

To / tmp. So the simple solution was finding the huge files and deleting

So the solution for some examples is to find huge files to delete them.

Them.

2. Check if the font 'fixed' is accessible.

Check that the font "fixed" is understandable.

Now it is time to ensure that the font 'fixed' is accessible. First, we

Now is the time to make sure the font "fixed" is affected. First

Can use command fslsfonts to see if font 'fixed' exists in the search

We can run the command fslsfonts to see if the font exists in the path we are looking for:

Path:

[root@localhost alex] # fslsfonts-server unix/:7100-ll-fn fixed

DIR MIN MAX EXIST DFLT ASC DESC NAME

-- > 0 255 some 0 11 2 fixed

FONTNAME_REGISTRY

FOUNDRY Misc

FAMILY_NAME Fixed

WEIGHT_NAME Medium

SLANT R

SETWIDTH_NAME SemiCondensed

ADD_STYLE_NAME

PIXEL_SIZE 13

POINT_SIZE 120

RESOLUTION_X 75

RESOLUTION_Y 75

SPACING C

AVERAGE_WIDTH 60

CHARSET_REGISTRY ISO8859

CHARSET_ENCODING 1

COPYRIGHT Public domain font. Share and enjoy.

CAP_HEIGHT 9

X_HEIGHT 6

FONT-Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1

WEIGHT 10

RESOLUTION 103

QUAD_WIDTH 6

This is the normal output when 'fixed' is available. Here, we can see that

When "fixed" is available, which is the usual case of output, we can see

'fixed' is actually an alias for the font

Fixed is actually an alias for a font.

'- Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1. If

There is no font 'fixed', we first need to gain knowledge of the search

If it is not the font "fixed", we first need to get more information on the path of the font.

Path for fonts. We can use command chkfontpath to look at those paths:

We can use the command chkfontpath to look at those paths:

[root@localhost alex] # / usr/sbin/chkfontpath

Current directories in font path:

1: / usr/X11R6/lib/X11/fonts/misc:unscaled

2: / usr/X11R6/lib/X11/fonts/75dpi:unscaled

3: / usr/X11R6/lib/X11/fonts/100dpi:unscaled

4: / usr/X11R6/lib/X11/fonts/misc

5: / usr/X11R6/lib/X11/fonts/Type1

6: / usr/X11R6/lib/X11/fonts/Speedo

7: / usr/X11R6/lib/X11/fonts/CID

8: / usr/X11R6/lib/X11/fonts/75dpi

9: / usr/X11R6/lib/X11/fonts/100dpi

10: / usr/share/fonts/default/Type1

11: / usr/share/fonts/default/TrueType

12: / usr/share/fonts/ja/TrueType

13: / usr/X11R6/lib/X11/fonts/latin2/100dpi:unscaled

14: / usr/X11R6/lib/X11/fonts/latin2/100dpi

15: / usr/share/fonts/ISO8859-7/misc:unscaled

16: / usr/share/fonts/ISO8859-7/75dpi:unscaled

17: / usr/share/fonts/ISO8859-7/100dpi:unscaled

18: / usr/share/fonts/ISO8859-7/misc

19: / usr/share/fonts/ISO8859-7/Type1

20: / usr/share/fonts/ISO8859-7/75dpi

21: / usr/share/fonts/ISO8859-7/100dpi

22: / usr/share/fonts/ISO8859-9/misc:unscaled

23: / usr/share/fonts/ISO8859-9/100dpi:unscaled

24: / usr/share/fonts/ISO8859-9/misc

25: / usr/share/fonts/ISO8859-9/100dpi

26: / usr/share/fonts/KOI8-R/100dpi:unscaled

27: / usr/share/fonts/KOI8-R/100dpi

28: / usr/share/fonts/zh_CN/TrueType

29: / usr/share/fonts/zh_TW/TrueType

30: / usr/share/AbiSuite/fonts

These are the font paths on my box. It shows that xfs looks into these

These font paths are on my computer. It shows that xfs looks at these paths to find a special font when it is fixed.

Paths seeking a specific font when it is required. There are two types of

There are two types of important files:

Important files: fonts.dir in each of these paths, and fonts.alias in some

Fonts.dir is in each path, and fonts.alias is in some path.

Of the paths. For example, let's go to / usr/X11R6/lib/X11/fonts/100dpi

For example, let's enter / usr/X11R6/lib/X11/fonts/100dpi

And open the files. The files look like this:

And open the file. The file looks like this:

[fonts.dir]

seven hundred and seventy five

UTI___14.pcf.gz-adobe-utopia-regular-i-normal--19-140,100-100-p-104-iso10646-1

UTBI__14.pcf.gz-adobe-utopia-bold-i-normal--19-140,100-100-p-109-iso10646-1

UTI___12.pcf.gz-adobe-utopia-regular-i-normal--17-120-100-100-p-89-iso10646-1

UTI___24.pcf.gz-adobe-utopia-regular-i-normal--33-240,100-100-p-179-iso10646-1

CourO08.pcf.gz-adobe-courier-medium-o-normal--11-80-100-100-m-60-iso10646-1

UTBI__12.pcf.gz-adobe-utopia-bold-i-normal--17-120-100-100-p-93-iso10646-1

...

The first line specifies the number of fonts under current directory.

This first line details the number of fonts in the current directory.

Following lines map file names to font names.

The following lines are the names of the font files.

[fonts.alias]

Lucidasans-bolditalic-8-b&h-lucida-bold-i-normal-sans-11-80-100-100-p-69-iso8859-1

Lucidasans-bolditalic-10-b&h-lucida-bold-i-normal-sans-14-100-100-100-p-90-iso8859-1

Lucidasans-bolditalic-12-b&h-lucida-bold-i-normal-sans-17-120-100-100-p-108-iso8859-1

Lucidasans-bolditalic-14-b&h-lucida-bold-i-normal-sans-20-140,100-100-p-127-iso8859-1

Lucidasans-bolditalic-18-b&h-lucida-bold-i-normal-sans-25-180-100-100-p-159-iso8859-1

Lucidasans-bolditalic-24-b&h-lucida-bold-i-normal-sans-34-240,100-100-p-215-iso8859-1

...

This file maps font alias to font names. So it is clear that once font

This file displays the alias and original name of the font file. Therefore, it is clear that the "fixed" of the previous font is needed.

'fixed' is needed, the font server search fonts.alias in each font path

The font service looks for font aliases in each font path in the competition.

For a match. If the match exists, the corresponding font file is specified

If the competition exists, then the corresponding font file is specified in fonts.dir.

In fonts.dir. If no match exists, which is a rare situation, the X server

If the competition does not exist, it is very rare that the font service cannot be run and we need to rebuild the font list.

Cannot start and we need to rebuild the font lists. The rebuilding process

The process of reconstruction

Will generate new fonts.dir and fonts.alias files.

New fonts.dir and fonts.alias files will be generated.

3. Rebuild font list.

Rebuild the font list.

Font list can be rebuilt using the script file xfs under / etc/init.d.

Using the grid file xfs under / etc/init.d, the font list can be rebuilt

Following is an excerpt of the script:

The following is an excerpt from the Geben document:

...

Buildfontlist () {

Pushd. & > / dev/null

For d in $(/ usr/sbin/chkfontpath-- list | cut-f 2-d':'); do

If [- d "$d"]; then

Cd $d

# Check if we need to rerun mkfontdir

NEEDED=no

If! [- e fonts.dir]; then

NEEDED=yes

Elif ["$(find.-type f-cnewer fonts.dir 2 > / dev/null)"! = "]; then

NEEDED=yes

Fi

If ["$NEEDED" = "yes"]; then

...

}

...

Start () {

If [- L / usr/X11R6/bin/X]; then

Echo-n $"Starting $prog:"

[- x / usr/sbin/chkfontpath] & & buildfontlist

Rm-fr / tmp/.font-unix

Daemon xfs-droppriv-daemon

Ret=$?

[$ret-eq 0] & & touch / var/lock/subsys/xfs

Echo

Return $ret

Fi

}

...

For readers not familiar with shell programming, this excerpt means that

Because the reader is not familiar with running the command program, this file means that every time xfs is running

Each time xfs script is run, it will check whether there is a fonts.dir

It will check to see if there is a fonts.dir in each text path in the list.

File in each listed font path. If fonts.dir is missing in a path, font

When fonts.dir disappears in the path, the font list needs to be rebuilt.

List needs to be rebuilt. If a fonts.dir does exist for each path, it will

If fonts.dir does not exist in every path, it will

Check if the status of any file in the font directory is changed after the

Check to see if all files in the font directory are changed last time in fonts.dir.

Last change of fonts.dir. If this is true, the font list also needs to be

If this is true, the font list also needs to be rebuilt.

Rebuilt.

For newbies not interested in learning shell programming, we play a small

As novices to the Internet are not interested in learning commands, we play a little trick in the subroutine buildfontlist ().

Trick in the subroutine buildfontlist (). We can set "NEEDED=yes" in the

We can set "NEEDED=yes" to force the font list to be rebuilt in the first case.

First instance to force the rebuilding of font list.

4. Fonts really missing?

Is the font really missing?

If all steps above fail. My last suggestion is to check if the font file

If all the above steps fail. My last submission is to check whether the font file

Is really removed by some processes. Then you need to reinstall the font.

Really deleted by some programs. Then you need to reset the font.'

At this point, I believe you have a deeper understanding of the solution to the failure of startx to start the graphical interface. You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report