Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How to terminate GUI in SunOS from a shell-script running it from the terminal.

share|improve this question
2  
What have you tried, so far? –  Kevdog777 Dec 10 '13 at 15:30
    
I have no clue on what command to use on Solaris and I don't have the machine available,in Ubuntu I found sudo stop lightdm –  Phil_Charly Dec 10 '13 at 15:57
2  
You should state the SunOS (Solaris) version used. –  jlliagre Dec 10 '13 at 20:32

2 Answers 2

up vote 2 down vote accepted

You can use the svcadm commands:

Disable the cde-login service:

svcadm disable svc:/application/graphical-login/cde-login:default

Enable it back:

svcadm enable svc:/application/graphical-login/cde-login:default

Or, if you want to do it old school:

Disable:

/usr/dt/bin/dtconfig -d

Enable:

/usr/dt/bin/dtconfig -e
share|improve this answer
    
On Solaris 11 & later, cde-login has been replaced by gdm, so it would be svcadm disable gdm and svcadm enable gdm instead. –  alanc Dec 11 '13 at 15:32
    
Yup, but we don't have more details about Solaris version, at the moment. –  ludiegu Dec 11 '13 at 17:05

Although it's been ages since the last time I had a SunOS workstation I would imagine that the GUI is typically part of the default runlevel 3 and changing to runlevel 2 would disable the GUI:

telinit 2 

The GUI (possibly Xorg) is most likely a service you can disable with svcadm disable <FMRI> The list of possble services can be found with svcs -a.

share|improve this answer
    
Nope, when Solaris used runlevels (prior to the switch to SMF in Solaris 10), the GUI was started in runlevel 2, as part of the "local system services" -- runlevel 3 was for running servers for other systems to connect to. –  alanc Dec 11 '13 at 15:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.