LinuxQuestions.org
Visit Jeremy's Blog.
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 12-02-2015, 09:11 AM   #1
rtvhg43
LQ Newbie
 
Registered: Nov 2015
Posts: 27

Rep: Reputation: Disabled
shutdown code


I forgot the launcher code for desktop shutdown button.
I thought it was Shutdown P but not quite...
what is it??
 
Old 12-02-2015, 09:26 AM   #2
debguy
Member
 
Registered: Oct 2014
Location: U.S.A.
Distribution: mixed, mostly debian slackare today
Posts: 207

Rep: Reputation: 19
when you ask others you need to be more detailed so they can provide a "physically real answer". answers should be user actions or patch(1)es*** (real answers that work, not talk).

but for you: you give general description of computer, OS, software involved as well as any error messages verbatim. if you can, you try to determine yourself what is responsibel for error message (but you wouldnt be asking if you knew that fully). you also say if this problem occured 1x only (dont post it) or if you can repeat the issue by a known series of user actions.

what desktop are you using?

do you mean you have to provide an sh(1)* commandline for shutdown(1)*

so from your hardly given description i think you said "my desktop does not shut down unless i tell it what command to use for shutdown, and i'm unsure what to give it"

prolly do this from an (x)terminal / console:

$ man shutdown

it will tell you "P" or what to you need, ie "shutdown -t0 -r now" (note: that might not work). "shutdown -t1 -a -r now" ?

if so, /sbin/shutdown unfortunately there are "many hacked versions of" with incompatible options. there are flavors: BSD, util-linux-ng, busybox, sysvinit. shutdown often "come with init(1)**" and run "init scripts" then runs /sbin/halt|reboot. it's almost silly (about sad) but there's no command which "just works for all".

however shutdown is really not "special". you can "kill" (close) all running process (except your own script and init), umount all disks, etc, and execute /sbin/reboot. (but it can be quite a long process if the installed software / packages are "needy", just saying shutdown is really just a simple script which closes out and finally runs a program that issues bios reboot or cpu halt instruction, which are just a single instruction)

--------------------
* man(1) means man is a program with a manual page(s)
installed in "section one" (of 9 or more)

$ man -S 1 foo # gives manpage only for foo in section 1
$ man man # is sacred, and shows you how to use man

** see patch(1)

*** your system might use redhat "systemd", a (some say malware) replacement of init(1). if so i think it has shutdown(1) but NOTHING i said applies to what it might do (systemd can phone home and give control of your pc to redhat, among other things: i have no idea what exactly it might do, which might not be the same as on other users pc)

Last edited by debguy; 12-02-2015 at 09:36 AM.
 
Old 12-02-2015, 10:18 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4864Reputation: 4864Reputation: 4864Reputation: 4864Reputation: 4864Reputation: 4864Reputation: 4864Reputation: 4864Reputation: 4864Reputation: 4864Reputation: 4864
Quote:
Originally Posted by debguy View Post
*** your system might use redhat "systemd", a (some say malware) replacement of init(1). if so i think it has shutdown(1) but NOTHING i said applies to what it might do (systemd can phone home and give control of your pc to redhat, among other things: i have no idea what exactly it might do, which might not be the same as on other users pc)
Please stop spreading such a nonsense.
Anyways, on all distributions I know that use systemd commands like shutdown, poweroff and reboot are symlinked to systemctl, which emulates their behavior and options, so that you can use them as you would do with other init-systems.
 
Old 12-02-2015, 11:01 AM   #4
rtvhg43
LQ Newbie
 
Registered: Nov 2015
Posts: 27

Original Poster
Rep: Reputation: Disabled
2 really stupid answers. If you cant just answer a simple ? then shut up.
 
Old 12-02-2015, 11:17 AM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4864Reputation: 4864Reputation: 4864Reputation: 4864Reputation: 4864Reputation: 4864Reputation: 4864Reputation: 4864Reputation: 4864Reputation: 4864Reputation: 4864
Excuse me please?
You were asked by debguy to provide more information, since your question is anything but clear and very far from being "simple", since you provide virtually no information on what you actually want to do, which distribution with which desktop environment you are using, and so.
Instead of providing the needed information you start to insult the persons the actually want to help you with your problem, this way you won't get much help here on LQ, not to mention that you are in no position to forbid any member of this forum to post in one of your threads.
 
Old 12-02-2015, 12:13 PM   #6
Soadyheid
Senior Member
 
Registered: Aug 2010
Location: Near Edinburgh, Scotland
Distribution: Cinnamon Mint 17.3 (Netbook) and 18.3 (Desktop)
Posts: 1,422

Rep: Reputation: 338Reputation: 338Reputation: 338Reputation: 338
From a terminal...
Code:
#shutdown -p
should power shutdown and power off your system.
Code:
#shutdown -h now
shuts down and halts your system "now". You can specify a time with a -t<number of seconds> switch rather than "now" I think.
Code:
#shutdown -i0 -g0 -y
seems to work in most cases as well.

These commands need to be issued as root so you may need to elevate your permission either with SU or sudo.

Hope that's the sort of simple answer you're looking for.

My

Play Bonny!

 
Old 12-02-2015, 01:57 PM   #7
rtvhg43
LQ Newbie
 
Registered: Nov 2015
Posts: 27

Original Poster
Rep: Reputation: Disabled
got it thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
FORCE SHUTDOWN -> Auto-Kill apps that prevent Shutdown - HOW ?? ttiihone Linux - General 3 01-19-2015 08:19 AM
[SOLVED] shutdown works, but /lib/systemd/system/shutdown.target does not. kaz2100 Debian 3 08-06-2014 03:28 AM
FC18: running a command on shutdown (or reboot) before every other shutdown operation P5music Fedora 3 04-23-2013 03:56 PM
Linux shutdown - source code magic_ghost Linux - Software 5 01-26-2006 05:36 PM
User Preferences: Use HTML code instead of vB code? (vB code is overrated) stefanlasiewski LQ Suggestions & Feedback 5 07-26-2005 01:37 AM

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

All times are GMT -5. The time now is 12:35 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration