This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Writing new Fedora systemd service . How to STOP kdm daemon?

Tags: None
(comma "," separated)
charlweed
Registered Member
Posts
3
Karma
0
OS
I have headless servers (that means no gxf cards or monitors)
Bu these servers allow remote graphical desktops via XDMCP.
On Fedora < 15, this was no big deal. I merely changed the kdmrc file to not start the X server.
Of course with the move to systemD(isaster), this does not work, because graphical.target does much more then stopping-starting the display manager. So I'm going to try and write my own headless.target, and kdm.service.

Starting is easy.
kdm -daemon

The problem is stopping.
SIGINT, SIGQUIT effectively are the same as SIGKILL, they leave X and various other servers running, as well as the pid files.
SIGTERM ALMOST works, but it still leaves /var/run/kdm/kdm.pid file, and that prevents KDM from starting again.

Maybe I can explicitly delete the pid, but is that the best I can do?
Is there a command-line way to cleanly stop KDM?

I was also wondering if I would be better off NOT using the -daemon option, and instead using some other systemD(isaster) functionality to manage the kdm process.
Thanks!

BTW, the KDM man pages are missing Form Fedora 15. I read a version I found online, as well as "The KDM Handbook" . They explained how to start KDM, but nowhere how to cleanly stop it. Googeling got me nowhere, as everyone assumes some version of "service stop/start" works.
ozjd
Registered Member
Posts
38
Karma
0
OS
there is information in the Fedora wiki on systemd. Look at http://fedoraproject.org/wiki/Systemd#What_is_the_tool_to_manage_services_with_systemd.3F for info on services.
charlweed
Registered Member
Posts
3
Karma
0
OS
ozjd wrote:there is information in the Fedora wiki on systemd. Look at http://fedoraproject.org/wiki/Systemd#What_is_the_tool_to_manage_services_with_systemd.3F for info on services.


Yes, Ive read that.
That wikki is how to use SystemD. I need info on KDM, so I can create a systemD kdm.service file.
charlweed
Registered Member
Posts
3
Karma
0
OS
I went with SIGTERM. I'm not satisfied, but it mostly works.

This configuration explicitly deletes the kdm pid file before start, and after stopping. This means that systemd can incorrectly start another instance of kdm, even when a previous instance is already running.

I use a separate kdmrc_headless kdm config file that does not start a local X server. The headless.target replaces graphical.target.

**-kdm.service-**
[Unit]
Description=KDM Daemon, use XDMCP to connect
After=multi-user.target

[Service]
Type=forking
ExecStart=/usr/bin/kdm -config /etc/kde/kdm/kdmrc_headless -daemon
PIDFile=/run/kdm/kdm.pid
ExecStartPre=/bin/rm -f /run/kdm/kdm.pid
ExecStopPost=/bin/rm -f /run/kdm/kdm.pid
KillSignal=SIGTERM

[Install]
WantedBy=headless.target

**-headless.service-**
# See systemd.special(7) for details

[Unit]
Description=Remote Graphical Interface, Connect with xdmcp
Requires=multi-user.target
After=multi-user.target
Conflicts=rescue.target
AllowIsolate=yes

[Install]
Alias=default.target


Bookmarks



Who is online

Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]