Fedora Linux Support Community & Resources Center
Old 20th August 2012, 09:20 AM
chu887 Offline
Registered User
Join Date: Mar 2010
Posts: 3
help! how to register a systemd service for starting X-window

I 'm using fedora 17 but not used to GNOME 3 ,so I uninstalled gnome desktop environment (including GDM login manager ) . For now , when the system started, it can't enter the X-window(I'm using awesome WM without any desktop env) and the tty1 is absolutely black without any cursor or word ,thus I have to press ctrl+alt+f2 to enter tty2,then login , then issue the command : startx ..... it will jump to tty1 and show X...

so , my question is :how can I register a service in systemd to start X-window automatically ? I wrote a file named startx.service in /usr/lib/systemd/system with the following content:


User=bob #uncomment this to run startx as desired user (in example bob), otherwise it will run startx as root


but it does not work.... help! any suggestion would be appreciated.
Reply With Quote
Old 22nd August 2012, 03:30 AM
nsnbm Offline
Registered User
Join Date: Dec 2007
Location: Australia
Posts: 1,561
Re: help! how to register a systemd service for starting X-window

Hello chu,

I can't help on the creation of the systemd way of starting X, but if you want to just use your window manager starting in runlevel 3 then the following thread might be useful:


It involves configuring your machine to start in runlevel 3 rather than 5 which should take you to a login prompt on the console rather than the "absolutely black" screen you mentioned. The manual page for xinit has a number of other examples of how to start X so that might be a good place for some ideas. If you want to boot into runlevel 5 with just your window manager, you might need to look in the /etc/X11/prefdm file. ben.
Reply With Quote
Old 22nd August 2012, 04:25 AM
DBelton Offline
Join Date: Aug 2009
Posts: 8,460
Re: help! how to register a systemd service for starting X-window

when you removed GDM, did you tell it to use a different desktop manager?

create the file /etc/sysconfig/desktop and tell it what desktop manager to use.

For example, if you wish to use KDM as your desktop manager, create the /etc/sysconfig/desktop file with these contents:

If there is no desktop file in /etc/sysconfig, it defaults to trying to use GDM. If you want to use a different one, thn you need the desktop file to tell it what to use.


nsnbm was really close when telling you to look in your /etc/X11/prefdm file. That is what reads the /etc/sysconfig/desktop file and actually starts your desktop manager. You can scan through it and see what it is looking for in your /etc/sysconfig/desktop file to know what you need to put there for whichever DM you are using.

Last edited by DBelton; 22nd August 2012 at 04:27 AM.
Reply With Quote
Old 22nd August 2012, 06:18 PM
chu887 Offline
Registered User
Join Date: Mar 2010
Posts: 3
Re: help! how to register a systemd service for starting X-window

Thanks for your replies. I got a solution here:

This is a pretty answer though several little troubles to be resolved...

Thanks for u again , but I do not want to use a huge Desktop environment any longer...

Best Regards!
Reply With Quote

register, service, starting, systemd, xwindow

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to disable a systemd service? Japplo F16 Development 8 5th September 2011 01:11 AM
Simple display of systemd service sequence charlweed Using Fedora 2 13th July 2011 05:34 AM
how to register a service with initd metamp99 Using Fedora 6 19th March 2005 05:39 PM
How to register a service in linux mnguyen Using Fedora 2 1st December 2004 03:29 AM

Current GMT-time: 08:23 (Wednesday, 23-08-2017)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat