• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 802
  • Last Modified:

restart gnome for root from command line?

I access console via vnc... but it is stuck logging out... how could I restart gnome for root from command line?  (RedHat 6.1)
0
Xetroximyn
Asked:
Xetroximyn
  • 7
  • 5
  • 2
  • +4
4 Solutions
 
xDUCKxCommented:
/etc/init.d/gnome restart
0
 
farzanjCommented:
Did you try:
startx
0
 
Seaton007Commented:
Restart GNOME:
sudo /etc/init.d/gdm restart

Start GNOME:
sudo /etc/init.d/gdm start

Stop GNOME:
sudo /etc/init.d/gdm stop
0
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

 
savoneCommented:
Just a word, your should never be logging in as root to the GUI.  Huge security risk.
0
 
XetroximynAuthor Commented:
@farzanj; I can't run startx from the VNC because I can't even get to a command prompt... I just have empty background

@everyone;
I think I may have been wrong... I assumed it was using gnome because if have /root/.gvfs

but I have no gnome or gdm in /etc/init.d.... any idea what else i might use or how to restart?
0
 
serialbandCommented:
If you can't get a display on VNC, try to ssh to the server instead.  I usually run ssh to a text terminal, even if I start up a VNC.  Sometimes the GUI connection just gets bogged down and you can always fall back on the plain text interface.

/etc/init.d/gdm is ubuntu.  Redhat uses /etc/init.d/xfs for the X font server.  It should be the same syntax
/etc/init.d/xfs restart
/etc/init.d/xfs stop
/etc/init.d/xfs start

Open in new window

I can't believe that Redhat's come full circle and reused the version number.  I remember running the old Redhat 6 back in 1999 - 2003.  I still have an old shrink wrapped copy from that era.  For a moment, I was thinking why anyone would run such an old copy, until I realized it meant the modern Redhat Enterprise 6.1.  I don't generally pay to run Redhat and use centos or ubuntu instead so I was fully confused for a short time.
0
 
joolsCommented:
You can usually restart X by pressing CTRL+ALT+BACKSPACE on the keyboard... if memory serves correctly.
0
 
XetroximynAuthor Commented:
Thanks!  No xfs either though...



[root@oaccati init.d]# ll
total 608
-rwxr-xr-x  1 root root  1288 Oct 26  2011 abrt-ccpp
-rwxr-xr-x  1 root root  1628 Oct 26  2011 abrtd
-rwxr-xr-x  1 root root  1642 Oct 26  2011 abrt-oops
-rwxr-xr-x. 1 root root  1725 Dec  2  2009 acpid
-rwxr-xr-x  1 root root  2158 Feb 10  2012 acronis_agent
-rwxr-xr-x  1 root root  2305 May 22 12:51 acronis_mms
-rwxr-xr-x  1 root root  2223 May 22 12:51 acronis_rsm
-rwxr-xr-x  1 root root   628 May 22 12:51 acronis_schedule
-rwxr-xr-x  1 root root  2062 Jan 19  2012 atd
-rwxr-xr-x  1 root root  3378 Mar 14 11:00 auditd
-rwxr-xr-x  1 root root  3715 Feb  6  2012 autofs
-rwxr-xr-x. 1 root root  2540 Apr  3  2011 avahi-daemon
-rwxr-xr-x. 1 root root   710 Jun 30  2010 bluetooth
-rwxr-xr-x  1 root root  2092 Nov  1  2011 certmonger
-rwxr-xr-x  1 root root  5470 Jul 26  2011 cgconfig
-rwxr-xr-x  1 root root  3592 Jul 26  2011 cgred
-rwxr-xr-x. 1 root root 11042 Jul 20  2010 cpuspeed
-rwxr-xr-x. 1 root root  2793 Mar  4  2011 crond
-rwxr-xr-x  1 root root  2988 Mar 19 11:22 cups
-rwxr-xr-x  1 root root 37935 Dec  9  2011 dataeng
-rwxr-xr-x  1 root root  1353 May 22 12:52 dkms_autoinstaller
-rwxr-xr-x  1 root root  7579 Mar  2 19:39 dsm_om_connsvc
-rwxr-xr-x  1 root root  8007 Mar  2 19:39 dsm_om_shrsvc
-rwxr-xr-x  1 root root 14000 Oct 19  2009 dsm_sa_ipmi
-rwxr-xr-x. 1 root root  1358 Apr 27  2011 edac
-rwxr-xr-x  1 root root  2785 Jul 14  2011 firstboot
-rw-r--r--  1 root root 18171 Oct  7  2011 functions
-rwxr-xr-x. 1 root root  1801 Apr  1  2011 haldaemon
-rwxr-xr-x  1 root root  5629 Oct  7  2011 halt
-rwxr-xr-x  1 root root  3371 Feb  7  2012 httpd
-rwxr-xr-x  1 root root 97050 Jan 13  2012 instsvcdrv
-rwxr-xr-x  1 root root  8727 Feb  3  2012 ip6tables
-rwxr-xr-x. 1 root root 14075 May 28  2010 ipmi
-rwxr-xr-x  1 root root  2056 Nov 24  2011 ipmievd
-rwxr-xr-x  1 root root  5036 Apr 30 09:17 ipsec
-rwxr-xr-x  1 root root  8630 Feb  3  2012 iptables
-rwxr-xr-x  1 root root  1873 May  2 14:57 irqbalance
-rwxr-xr-x  1 root root  4535 Feb 19  2011 iscsi
-rwxr-xr-x  1 root root  3990 Aug 15  2011 iscsid
-rwxr-xr-x  1 root root 15277 Apr 12 02:06 kdump
-rwxr-xr-x  1 root root   652 Oct  7  2011 killall
-r-xr-xr-x  1 root root  2293 Jul 27  2011 logmein-hamachi
-r-xr-xr-x  1 root root  2489 Oct 19  2011 lvm2-monitor
-rwxr-xr-x  1 root root  2034 Jul 18  2011 mcelogd
-rwxr-xr-x  1 root root  2571 Apr  9  2010 mdmonitor
-rwxr-xr-x  1 root root  2200 Jul 27  2011 messagebus
-rwxr-xr-x  1 root root  2980 Oct  7  2011 netconsole
-rwxr-xr-x  1 root root  5485 Oct  7  2011 netfs
-rwxr-xr-x  1 root root  6502 Oct  7  2011 network
-rwxr-xr-x  1 root root  6226 Oct 21  2011 nfs
-rwxr-xr-x  1 root root  3526 Oct 21  2011 nfslock
-rwxr-xr-x  1 root root  1746 Apr 25 13:58 nmb
-rwxr-xr-x. 1 root root  1923 Oct 22  2009 ntpd
-rwxr-xr-x. 1 root root  1866 Oct 22  2009 ntpdate
-rwxr-xr-x. 1 root root  2261 Feb 24  2011 oddjobd
-rwxr-xr-x. 1 root root  3812 Jan 11  2011 openwsmand
-rwxr-xr-x  1 root root  1866 Sep  1  2011 portreserve
-rwxr-xr-x  1 root root  3852 May 12  2011 postfix
-rwxr-xr-x. 1 root root  1556 Apr 19  2010 psacct
-rwxr-xr-x. 1 root root  2034 Feb  4  2011 quota_nld
-rwxr-xr-x. 1 root root  1559 May 19  2009 rdisc
-rwxr-xr-x  1 root root  1815 Feb  7  2012 restorecond
-rwxr-xr-x. 1 root root  2898 Mar 19  2010 rhnsd
-rwxr-xr-x  1 root root  1703 Apr 24 16:51 rhsmcertd
-rwxr-xr-x  1 root root  1808 Dec  2  2011 rngd
-rwxr-xr-x. 1 root root  2073 Aug 16  2010 rpcbind
-rwxr-xr-x  1 root root  2518 Oct 21  2011 rpcgssd
-rwxr-xr-x  1 root root  2300 Oct 21  2011 rpcidmapd
-rwxr-xr-x  1 root root  2464 Oct 21  2011 rpcsvcgssd
-rwxr-xr-x  1 root root  2269 Aug 22  2011 rsyslog
-rwxr-xr-x  1 root root  1698 Feb  7  2012 sandbox
-rwxr-xr-x  1 root root  2056 Apr 12  2010 saslauthd
-rwxr-xr-x  1 root root  1817 Oct 12  2011 sblim-sfcb
-rwxr-xr-x  1 root root   647 Oct  7  2011 single
-rwxr-xr-x  1 root root  3002 Aug  2  2011 smartd
-rwxr-xr-x  1 root root  2697 Apr 25 13:58 smb
-rwxr-xr-x  1 root root  2162 Nov 15  2011 snmpd
-rwxr-xr-x  1 root root  1738 Nov 15  2011 snmptrapd
-rwxr-xr-x  1 root root  2472 Oct 29  2011 spice-vdagentd
-rwxr-xr-x  1 root root  4582 Jan 18  2012 sshd
-rwxr-xr-x  1 root root  2647 Jan 17  2012 sssd
-rwxr-xr-x. 1 root root  1267 Mar 31  2011 sysstat
-rwxr-xr-x  1 root root  2296 Sep 23  2011 udev-post
-rwxr-xr-x  1 root root  3126 Nov  9  2011 vncserver
-rwxr-xr-x  1 root root  2824 May 11 18:51 vsftpd
-rwxr-xr-x. 1 root root  1598 Feb  3  2011 watchdog
-rwxr-xr-x  1 root root  1314 Jan 21  2012 webmin
-rwxr-xr-x  1 root root  3555 Sep 21  2011 xinetd
-rwxr-xr-x. 1 root root  4799 Jun 24  2010 ypbind

Open in new window

0
 
joolsCommented:
I dont think that xfs needs to be running for x to start now, it used to but I believe it changed in 6 (maybe 5, cant remember exactly).

However, it sounds more like vnc needs to be restarted....

Try; service vnc restart
0
 
XetroximynAuthor Commented:
Thanks!  no vnc service so I did
service vncserver restart
restarted OK -- but same issue
0
 
serialbandCommented:
Can you ssh to it, with just plain ssh?  
Once you ssh to it, can you run startx?  If this art works, see if you can connect with VNC.

Otherwise, check the firewall.
    service iptables stop
Then connect via VNC.  If that works, then start iptables again and add a firewall rule to open a port for VNC,
    service iptables start
0
 
XetroximynAuthor Commented:
I have SSH access.  I tried this...  Its not that VNC wont connect though... it does connect -- but I get empty desktop...  (I tried to logout but it never actually logged out... just left it with a blank desktop, and even when I go back in with new VNC connection, same thing)
0
 
joolsCommented:
Modify the .vnc file in your home directory and remove twm and change it to gnome-session & or gdm (I cant remember the exact details. but will try to find an example.

You will need to restart vnc
0
 
joolsCommented:
Actually, it looks like the file might be called xstartup in .vnc in your home directory...

http://www.experts-exchange.com/OS/Linux/Setup/Q_25137650.html
0
 
XetroximynAuthor Commented:
Thanks!

wierd -- I did this and when restarting VNC server noticed is said

[root@oaccati ~/.vnc]# service vncserver restart
Shutting down VNC server: 2:root                           [  OK  ]
Starting VNC server: 2:root
New 'oaccati.opinionaccess.com:2 (root)' desktop is oaccati.opinionaccess.com:2

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/oaccati.opinionaccess.com:2.log

                                                           [  OK  ]

Open in new window


So I tried to connect to :2 instead of :1 and it works!  (even if I change gnome-session back to twm)

So I am good now!

But any idea how I would restart display 1 (:1)?

I dont need it -- but just curious.
0
 
joolsCommented:
Just edit the vncserver file in /etc/sysconfig.
0
 
XetroximynAuthor Commented:
thanks!
0
 
XetroximynAuthor Commented:
thanks!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 7
  • 5
  • 2
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now