You are not logged in.

#1 2016-02-19 21:49:56

BigBrownHawk
Member
Registered: 2016-02-08
Posts: 41
Website

CLI on Startup Enable/Disable

Hi,
What is the fastest and cleanest way to enable/disable the Command Line Interface on startup? I got my bunsenlabs server configuration dialed in and wanted to disable the GUI for personal reasons. I prefer to not completely remove the packages.
Thanks,
BBH

Offline

#2 2016-02-19 23:15:22

el_koraco
Member
Registered: 2016-02-08
Posts: 307

Re: CLI on Startup Enable/Disable

sudo systemctl isolate multi-user.target

to get to CLI

sudo systemctl isolate graphical.target

to get to GUI

sudo systemctl set-default multi-user.target

to boot to CLi by default

Last edited by el_koraco (2016-02-22 21:38:44)

Offline

#3 2016-02-20 04:57:56

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: CLI on Startup Enable/Disable

addition:
if you like it that way (booting into cli, starting gui only when needed)
you won't really be needing your display manager, you can start X manually (startx); then only the last (of the previous three) commands is relevant.

Offline

#4 2016-02-20 13:09:47

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: CLI on Startup Enable/Disable

ohnonot wrote:

addition:
if you like it that way (booting into cli, starting gui only when needed)
you won't really be needing your display manager, you can start X manually (startx); then only the last (of the previous three) commands is relevant.

Hmm if one were to do this...but use startx without a dm, how would you then return to the cli only session? Would you have to manually stop X from running? Or would the systemctl isolates still work?


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#5 2016-02-20 13:18:25

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: CLI on Startup Enable/Disable

Horizon_Brave wrote:

would the systemctl isolates still work?

`systemctl isolate multi-user.target` works for me when not using a display manager.

Also, bl-exit still works without a display manager 8)

Offline

#6 2016-02-21 07:40:34

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: CLI on Startup Enable/Disable

Horizon_Brave wrote:

Hmm if one were to do this...but use startx without a dm, how would you then return to the cli only session?

killall openbox  ]:D

Offline

#7 2016-02-21 09:50:40

nobody
The Great
Registered: 2015-08-10
Posts: 3,655

Re: CLI on Startup Enable/Disable

ohnonot wrote:
Horizon_Brave wrote:

Hmm if one were to do this...but use startx without a dm, how would you then return to the cli only session?

killall openbox  ]:D

Well, it's not like SIGTERM is generally a bad thing. SIGTERM := Please exit gracefully, and I don't want to repeat myself.

Offline

#8 2016-02-22 16:45:55

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: CLI on Startup Enable/Disable

ohnonot wrote:
Horizon_Brave wrote:

Hmm if one were to do this...but use startx without a dm, how would you then return to the cli only session?

killall openbox  ]:D

Ahh, so basically once you startx, the main way to return to the cli is to kill whatever desktop/window manager is in use right? And if you're running with a display manager such as LightDM, you would kill the DM instead correct?  Why is there no "clean" script to stop whatever window manager/DM is in use...like a "Stopx" script?

Last edited by Horizon_Brave (2016-02-22 16:46:29)


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#9 2016-02-22 16:51:15

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: CLI on Startup Enable/Disable

Horizon_Brave wrote:

...  Why is there no "clean" script to stop whatever window manager/DM is in use...like a "Stopx" script?

Go to TTY1 and do

sudo systemctl stop lightdm.service

smile


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#10 2016-02-22 16:53:52

mf_social
Member
Registered: 2015-09-29
Posts: 7

Re: CLI on Startup Enable/Disable

^ in spectrwm shift+super+Q is the shortcut to close the wm. (dropping back to CLI).

I guess 'stopx' would be exactly that, Stop X, rather than shut down the wm (each of which will have different ways of doing things).

I presume there will be a stopOpenbox command somewhere, you just need to add it to a shortcut key combo. Or, kill openbox would suffice.

Edit: holy crap, this is my first post here! How unsocial of me...

Last edited by mf_social (2016-02-22 16:55:07)

Offline

#11 2016-02-22 19:13:28

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: CLI on Startup Enable/Disable

damo wrote:
Horizon_Brave wrote:

...  Why is there no "clean" script to stop whatever window manager/DM is in use...like a "Stopx" script?

Go to TTY1 and do

sudo systemctl stop lightdm.service

smile

hmm Actually I found something interesting with this...

Okay, I booted up BL, it prompts me to login with lightdm. I get into Openbox etc..
I then run

sudo systemctl stop lightdm.service

This kills the graphical session. No big surprise there. But the "problem" is that is at least for me, it drops you to a black screen. It's just a black cursor that is unresponsive.The only way I get back to the openbox session, is to switch to a new tty, like tty2 or 3, and then switch back to tty1. So if I do the systemctl stop lightdm, my session ends and 'freezes' at a prompt. THen I have to do ctl+alt+f2 to switch to another tty, then switch back to tty1. Once I do this, I'm back at my openbox session as if nothing happened. But I don't think that I should have to switch TTY's. If I use the systemctl command to stop lightdm.service, it should kill lightdm, but should it really send me to an unresponsive prompt? I'd expect to either be brought to a cli login prompt, or a cli prompt with me still logged in..

I'm using virtualbox so I'm not sure if this is a bug for V.Box or something larger


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#12 2016-02-22 19:47:24

damo
....moderator....
Registered: 2015-08-20
Posts: 6,734

Re: CLI on Startup Enable/Disable

Did you log in on tty1 first, then run the command?


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#13 2016-02-22 20:19:52

BigBrownHawk
Member
Registered: 2016-02-08
Posts: 41
Website

Re: CLI on Startup Enable/Disable

el_koraco wrote:
sudo systemctl isolate multi-user.target

to get to CLI

sudo systemctl isolate graphical.target

to get to GUI

sudo systemctl set-default multi.user-target

to boot to CLi by default




When I  do:

sudo systemctl set-default multi.user-target

To try to get CLI to launch up on default.
I received this message after executing the command:

Failed to set default target: No such file or directory

^^^ I tried it in TTY1. Same deal.






sudo systemctl isolate multi-user.target

Took away the GUI that's for sure but I'm stuck on a black screen that looks like this:

_









sudo systemctl isolate graphical.target

Works like a charm when I'm in TTY1 trying to get back to GUI! big_smile

Still trying to have it go to CLI without having to press ctrl+alt+f1 at logon (lightdm).
#FirstWorldProblems

Last edited by BigBrownHawk (2016-02-22 20:22:01)

Offline

#14 2016-02-22 20:31:29

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 9,093
Website

Re: CLI on Startup Enable/Disable

BigBrownHawk wrote:

When I  do:

sudo systemctl set-default multi.user-target

To try to get CLI to launch up on default.
I received this message after executing the command:

Failed to set default target: No such file or directory

^^^ I tried it in TTY1. Same deal.

There is a typo in your command -- you have a dash where there should be a dot and vice-versa:

systemctl set-default multi-user.target
BigBrownHawk wrote:

I'm stuck on a black screen

You're still on TTY7 but there is no X server running, you need to switch to another TTY with <Ctrl>+<Alt>+F{1..6}

Offline

#15 2016-02-22 20:34:57

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: CLI on Startup Enable/Disable

damo wrote:

Did you log in on tty1 first, then run the command?

actually.... I goof'd you're right, I was logged into TTY 7 as per normal graphical boot...le sigh!

Last edited by Horizon_Brave (2016-02-22 20:35:56)


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#16 2016-02-22 21:24:09

BigBrownHawk
Member
Registered: 2016-02-08
Posts: 41
Website

Re: CLI on Startup Enable/Disable

Head_on_a_Stick wrote:
BigBrownHawk wrote:

When I  do:

sudo systemctl set-default multi.user-target

To try to get CLI to launch up on default.
I received this message after executing the command:

Failed to set default target: No such file or directory

^^^ I tried it in TTY1. Same deal.

There is a typo in your command -- you have a dash where there should be a dot and vice-versa:

systemctl set-default multi-user.target
BigBrownHawk wrote:

I'm stuck on a black screen

You're still on TTY7 but there is no X server running, you need to switch to another TTY with <Ctrl>+<Alt>+F{1..6}

Good catch on the typo! Can you edit el_koraco's post to save people some trouble thanks.

Offline

#17 2016-02-22 21:41:18

el_koraco
Member
Registered: 2016-02-08
Posts: 307

Re: CLI on Startup Enable/Disable

I edited it myself

Offline

#18 2016-02-22 23:33:53

ohnonot
...again
Registered: 2015-09-29
Posts: 5,592

Re: CLI on Startup Enable/Disable

Horizon_Brave wrote:

Why is there no "clean" script to stop whatever window manager/DM is in use?

openbox --exit

but then again, as nobody said, killall isn't really "dirty", either.
unless you have miltiple Xsessions running, but that, too, is easily solved.

Offline

Board footer

Powered by FluxBB