changing runlevels from 5 to 3 via systemctl does not stop the GUI in tty7/8 but reports it as dead and inactive. init 3 command works as expected and stops the GUI, however.
currently at runlevel 5
systemctl list-units -t target -a --no-pager | grep graphical
graphical.target loaded active active Graphical Interface
systemctl start runlevel3.target
or
systemctl isolate runlevel3.target
runlevel
5 3
ps -C Xorg
PID TTY TIME CMD
6200 tty7 00:00:00 Xorg
systemctl list-units -t target -a --no-pager | grep graphical
graphical.target loaded inactive dead Graphical Interface
changing runlevels from 5 to 3 via systemctl does not stop the GUI in tty7/8 but reports it as dead and inactive. init 3 command works as expected and stops the GUI, however.
currently at runlevel 5
# runlevel
N 5
# ps -C Xorg
PID TTY TIME CMD
6200 tty7 00:00:00 Xorg
# systemctl status graphical.target
graphical.target - Graphical Interface
Loaded: loaded (/lib/systemd/system/graphical.target)
Active: active since Tue, 11 Sep 2012 05:10:18 +0100; 25s ago
Thanks a lot. It was not my intention to let you repeat the whole post (sorry, if you got that impression), but to let you know for later posting. In any case, it is much better readable now.
And I also forgot to welcome you here (I now see these are your first posts).
And I hope you get some answer because we are all more or less new to systemd and want to learn about it.
On 2012-09-11 14:26, ian28223 wrote:
> changing runlevels from 5 to 3 via systemctl does not stop the GUI in
> tty7/8 but reports it as dead and inactive. init 3 command works as
> expected and stops the GUI, however.
I would suggest two actions: 1, post the issue in the factory mail list, because systemd
maintainers read there. 2, directly report in bugzilla.
–
Cheers / Saludos,
Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)
I cannot reproduce it. After “systemctl isolate multi-user.target” Xorg is gone and after “systemctl isolate graphical.target” it is restarted again. You may want to enable verbose systemd logging and compare difference between systemctl and init calls in your case. But I am very surprised you get different results - telinit should be redirected to systemd in any case (of course, it takes slightly different codepath …)
Alright. Thanks for all your input. I made some more test and it seems i might have overlooked something.
Commands below do work…
# systemctl isolate runlevel3.target
or
# systemctl isolate multi-user.target
or
# systemctl isolate default.target # Assuming default runlevel is 3
and what really didn’t work were:
# systemctl start runlevel3.target # i am wrong here.. this does put you in runlevel 3 but the appropriate way is to use isolate
# systemctl default #this one doesn't kill X
So the problem really is just “systemctl default” (assuming that runlevel3.target or multi-user.target is the default). According to the documentation in openSUSE 12.2: Chapter 6. The systemd daemon in 6.2.1.1. Commands to Change Targets, it should have been a valid way of changing runlevels.
Well, it is just shorthand for “systemctl start default.target” and we already know that this is the wrong way to change runlevel So yes, documentation is slightly misleading here. Arguably, “systemctl default” should be doing “isolate”, but that is something to discuss on systemd mailing list.