Bug 74482 - Use 'shutdown -p now' by default
Summary: Use 'shutdown -p now' by default
Status: RESOLVED INTENTIONAL
Alias: None
Product: kdm
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: FreeBSD Ports Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdm bugs tracker
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-07 17:43 UTC by Arjan van Leeuwen
Modified: 2008-05-19 17:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Enable shutdown -p on BSD style systems. (486 bytes, patch)
2007-08-20 13:04 UTC, Roy Marples
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Arjan van Leeuwen 2004-02-07 17:43:23 UTC
Version:            (using KDE KDE 3.2.0)
Installed from:    FreeBSD Ports

By default, kdm uses '/sbin/shutdown -h now' to shut down the machine (at least on FreeBSD it does). It would be a lot nicer if the default would be '/sbin/shutdown -p now'; this will power off the computers of users who are running ACPI or APM. For other systems, it will just do the same as a shutdown -h now.
Comment 1 Oswald Buddenhagen 2004-02-07 17:46:28 UTC
yeah ... one problem though: -p is non-standard, so some systems may not grok it at all ... that needs some support check.
Comment 2 Stephan Kulow 2004-02-08 09:50:31 UTC
Subject: Re:  Use 'shutdown -p now' by default

Am Samstag 07 Februar 2004 17:46 schrieb Oswald Buddenhagen:
> yeah ... one problem though: -p is non-standard, so some systems may not
> grok it at all ... that needs some support check.
I suggest though not to try from configure if shutdown returns when called 
with -p now :)

Greetings, Stephan

Comment 3 Michael Nottebrock 2004-02-28 03:37:53 UTC
If the configuration option that disappeared from kcm_kdm would make a reappearance (see Bug 74463) , none of this would be necessary, uses could just change it once and keep it that way (and yes, the freebsd port of kdebase will finally not overwrite kdmrc with a generic default anymore starting with its next revision ;-)).

Btw, just what "standards" should shutdown(8) comply to? AFAIK, POSIX doesn't deal with it, nor with halt, or even init.
Comment 4 Oswald Buddenhagen 2004-02-28 03:53:33 UTC
indeed ... how good that the option is not gone, only the gui. i for one never had problems with it being there, so it can return as far as i'm concerned ...

anyway, i'd still prefer to have it set up automatically. hard-coding oses and os versions is ugly ... does somebody have a better idea? is there a "poweroff" binary on these systems?

as for standards, there is more than posix. maybe SUSv2 deals with it. that's irrelevant anyway, as -r and -h are at least de-facto standard.
Comment 5 Oswald Buddenhagen 2005-07-17 20:23:29 UTC
ok, how about just using "shutdown -p now || shutdown -h now"?
Comment 6 Arjan van Leeuwen 2005-07-24 23:31:54 UTC
Sounds like a good idea.
Comment 7 Oswald Buddenhagen 2007-06-29 10:01:20 UTC
won't fix. reasons:
- i really have no idea how to auto-detect it. parsing the man page is sort of no acceptable solution
- trying several commands in series is ... ugly
- the gui option is back, so why bother
Comment 8 Roy Marples 2007-08-20 13:04:26 UTC
Created attachment 21437 [details]
Enable shutdown -p on BSD style systems.

Please conside this patch.

You already have a #ifdef BSD, but it's not actually defined anywhere.
You do however, have #define BSD_INIT if /etc/ttys exists but this isn't used
anywhere.

This patch just changes #elif BSD to #elif BSD_INIT then uses the -p option,
which all the BSD's should support.
Comment 9 Oswald Buddenhagen 2007-08-28 14:17:09 UTC
> You already have a #ifdef BSD, but it's not actually defined anywhere. 
>
#include <sys/param.h>

> all the BSD's should support
>
you mean "all sufficiently recent open BSDs".