LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-18-2018, 07:51 AM   #1
ddenial
Member
 
Registered: Dec 2016
Distribution: CentOS, Fedora, Ubuntu
Posts: 359

Rep: Reputation: 56
CentOS/Redhat Restart/Shutdown command?


Hello

What is the command in CentOS 7 that will launch the Restart/Shutdown Dialog window?

Like in Ubuntu there is this command that will display GUI window.
Code:
gnome-session-quit --power-off

There is no such equivalent in CentOS 7. I want that to link in my OpenBox menu to Restart/Shutdown.

Right now I'm using systemctl reboot/poweroff, but want GUI dialog instead.

Thanks

Last edited by ddenial; 11-18-2018 at 07:52 AM.
 
Old 11-18-2018, 10:06 AM   #2
lougavulin
Member
 
Registered: Jul 2018
Distribution: Slackware,x86_64,current
Posts: 279

Rep: Reputation: 100Reputation: 100
So I guess Gnome is not installed.
How do you start X, automatically at boot or after logged on tty ?
If automatically, what is your Display Manager (gdm, kdm, ...) ?

Why don't you add shutdown or restart to your OpenBox menu ?
 
Old 11-18-2018, 10:26 AM   #3
mangya
Member
 
Registered: Jul 2015
Distribution: CentOS
Posts: 89

Rep: Reputation: Disabled
Quote:
Originally Posted by lougavulin View Post
So I guess Gnome is not installed.
How do you start X, automatically at boot or after logged on tty ?
If automatically, what is your Display Manager (gdm, kdm, ...) ?

Why don't you add shutdown or restart to your OpenBox menu ?
Yes, the only DM I've installed is Openbox. I do however installed some gnome packages.
Code:
$ rpm -qa | grep gnome-
gnome-bluetooth-3.20.1-1.el7.x86_64
gnome-themes-standard-3.22.2-2.el7_5.x86_64
gnome-calculator-3.22.3-1.el7.x86_64
libgnome-keyring-3.12.0-1.el7.x86_64
gnome-screenshot-3.22.0-1.el7.x86_64
gnome-settings-daemon-3.26.2-9.el7.x86_64
gnome-boxes-3.22.4-4.el7.x86_64
gnome-keyring-pam-3.20.0-3.el7.x86_64
gnome-python2-2.28.1-14.el7.x86_64
polkit-gnome-0.106-0.1.20170423gita0763a2.el7.x86_64
gnome-system-monitor-3.22.2-3.el7.x86_64
gnome-desktop3-3.22.2-2.el7.x86_64
gnome-online-accounts-3.26.2-1.el7.x86_64
compat-gnome-desktop314-3.14.2-1.el7.x86_64
gnome-bluetooth-libs-3.20.1-1.el7.x86_64
gnome-disk-utility-3.22.1-1.el7.x86_64
gnome-terminal-3.22.1-2.el7.x86_64
gnome-terminal-nautilus-3.22.1-2.el7.x86_64
gnome-icon-theme-3.12.0-1.el7.noarch
gnome-keyring-3.20.0-3.el7.x86_64
gnome-python2-gconf-2.28.1-14.el7.x86_64
gnome-vfs2-2.24.4-14.el7.x86_64
My login manager is lightdm. Also, as you have mentioned I've already tweaked my menu.xml for restart and shutdown.
Code:
$ cat .config/openbox/menu.xml
.
.
<item label="Log Out">
	<action name="SessionLogout">
		<prompt>yes</prompt>
	</action>
</item>
<item label="Restart">
	<action name="Execute">
		<execute>systemctl reboot</execute>
	</action>
</item>
<item label="Shutdown">
	<action name="Execute">
		<execute>systemctl poweroff</execute>
	</action>
</item>
I just want to use gnome default shutdown GUI window Dialog as a better option. That's all.
 
Old 11-19-2018, 10:50 AM   #4
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
man shutdown
 
Old 11-19-2018, 07:53 PM   #5
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,735

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Shutdown
Code:
init 0
reboot
Code:
init 6
still works in CentOS 7...tho they're not the current/correct/SystemD way to do that.

You're DE doesn't have built-in session control? Hmmm. I'm still learning about various DE's...ran Cinnamon on my CentOS 7 desktop for awhile...now messing with KDE.
 
Old 11-19-2018, 08:39 PM   #6
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,346
Blog Entries: 28

Rep: Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145Reputation: 6145
Also see man reboot.
 
Old 11-20-2018, 11:23 AM   #7
DavidMcCann
LQ Veteran
 
Registered: Jul 2006
Location: London
Distribution: PCLinuxOS, Debian
Posts: 6,143

Rep: Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314Reputation: 2314
I'm not a Gnome user, but I think you need to install and use gnome-session-quit.
 
Old 11-20-2018, 12:36 PM   #8
ddenial
Member
 
Registered: Dec 2016
Distribution: CentOS, Fedora, Ubuntu
Posts: 359

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by DavidMcCann View Post
I'm not a Gnome user, but I think you need to install and use gnome-session-quit.
Unfortunately not available anymore.
 
Old 11-26-2018, 01:17 PM   #9
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Code:
shutdown -h now
man shutdown as advertised.
 
1 members found this post helpful.
Old 11-26-2018, 07:44 PM   #10
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by Habitual View Post
Code:
shutdown -h now
man shutdown as advertised.
That cmd has always worked for me:-
 
Old 11-29-2018, 11:10 AM   #11
ddenial
Member
 
Registered: Dec 2016
Distribution: CentOS, Fedora, Ubuntu
Posts: 359

Original Poster
Rep: Reputation: 56
Thanks.
 
Old 11-29-2018, 09:40 PM   #12
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by ddenial View Post
Thanks.
You're welcome.

Did it work?
 
1 members found this post helpful.
Old 11-30-2018, 02:57 PM   #13
ddenial
Member
 
Registered: Dec 2016
Distribution: CentOS, Fedora, Ubuntu
Posts: 359

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by Ztcoracat View Post
You're welcome.

Did it work?
Yes. Thanks
 
Old 11-30-2018, 03:11 PM   #14
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by ddenial View Post
Yes. Thanks
You're Welcome-
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what is the default powerstate (e.g. S3,S4,S5) for the command 'shutdown -hP' or 'shutdown -hH' or 'shutdown -h' badbetty Slackware 6 11-12-2017 12:18 AM
FC18: running a command on shutdown (or reboot) before every other shutdown operation P5music Fedora 3 04-23-2013 03:56 PM
'shutdown' command causing unclean shutdown silentwol Linux - Software 3 07-01-2009 02:01 AM
exec a command on shutdown/restart adamruss Linux - Newbie 2 03-02-2008 05:56 AM
How do I set the regulatory daemon to restart when I restart the network service? zahadumy Linux - Networking 0 11-05-2006 11:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration