Commit Graph

79 Commits

Author SHA1 Message Date
uwe feec5ded24 Use NULL instead of 0 for null pointer. 2017-08-07 22:08:12 +00:00
kre 0b2d8dad17 Update the history, shutdown was first in 4.1 BSD (and existed earlier).
Ride date bump for previous update.
2016-09-14 00:16:31 +00:00
sevan d11b992e7c shutdown appeared as a standalone utility in 4.2BSD release, in 4BSD its a
target in init.
http://www.tuhs.org/cgi-bin/utree.pl?file=4BSD/usr/src/cmd/init.c
http://www.tuhs.org/cgi-bin/utree.pl?file=4.2BSD/usr/src/etc/shutdown.c

Amend HISTORY.
Bump date.
2016-09-12 06:22:35 +00:00
apb 292aec205d When the third arg to fwrite() is a size in bytes, then the second arg
should be 1.  sizeof(*mbuf) happens to equal 1, but it's better not
to rely on that.
2014-03-28 18:27:14 +00:00
dholland adcc6f36b6 Fix thinko about halt vs. poweroff; from Moritz Wilhelmy in PR 45141. 2011-10-04 07:25:34 +00:00
joerg 8bdebf9d52 statc + __dead 2011-08-27 18:54:39 +00:00
wiz adc40ee487 Add -b and -vxz to usage. 2011-02-16 19:33:48 +00:00
wiz 2d50779420 Add -vxz to SYNOPSIS. Sort. 2011-02-16 19:33:39 +00:00
dyoung 00ef49e965 Add flags -v, -x, and -z for verbose, debug, and silent shutdowns,
respectively, by passing flags AB_VERBOSE, AB_DEBUG, and/or AB_SILENT to
reboot(2).
2011-02-16 17:53:31 +00:00
riz b82a6579fe Remove _PATH_NOLOGIN before reboot, as well as before exit(), to prevent
a root file system which has been marked read-only in fstab from continuing
to prevent logins after reboot.  From Ian D. Leroux in PR#43390.
2010-06-09 04:51:53 +00:00
lukem ef685eeea9 Enable WARNS=4 by default except for:
dump  dump_lfs  fsck_ffs  fsck_lfs  fsdb  mount_smbfs
	newfs_ext2fs  newfs_lfs  resize_lfs  setkey
2009-04-11 07:58:11 +00:00
lukem ddd1724f86 xref rescue(8) 2008-10-21 02:32:37 +00:00
lukem 6543a91fea Remove the \n and tabs from the __COPYRIGHT() strings.
(Tweak some to use a consistent format.)
2008-07-20 01:20:21 +00:00
dholland 311ef454d2 Improvements and clarifications to log messages and also to the man page.
Partially cherry-picked from or inspired by PR bin/36551 by Greg A. Woods,
plus some additional grammar/usage/clarity adjustments while I was passing
through. Any mistakes are mine.
2008-02-09 04:09:22 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
jnemeth 2f4c83c097 PR/36626 - Jukka Salmi -- fails to compile if DEBUG is defined 2007-07-10 23:50:35 +00:00
tls 4147a3c54a Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry.  RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros.  Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default.  Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
2007-05-28 12:06:17 +00:00
christos 8a56ee5512 - sprinkle static
- pass WARNS=4 and lint
- use size_t/time_t where appropriate
- get/setprogname()
- before executing rc.shutdown, set the real user id to 0, because shutdown
  scripts may depend on it (for example su depends on being root).
- use warn instead of perror, and make sure we use the right errno.
2007-03-14 03:52:28 +00:00
jnemeth 61f477b7e3 PR/31531: Takahiro Kambe: shutdown(8) quietly exit if execed from login shell 2006-03-07 22:19:55 +00:00
christos 2c6eadc9ce Move WARNS=3 to the Makefile.inc, and add a little const to the remaining
programs that did not compile before.
2005-06-27 01:00:04 +00:00
xtraeme 48bd1327fa Finish previous (use ANSI function declarations) this time. 2005-02-05 13:17:54 +00:00
xtraeme 866012a7e2 Kill __P(), use ANSI function declarations. 2005-02-05 13:15:12 +00:00
dsl 1869f0e146 Add (unsigned char) cast to ctype functions 2004-11-05 21:56:01 +00:00
dsainty ed00687c42 Comment typo: unecessary->unnecessary 2004-10-09 02:51:19 +00:00
christos ea369b9669 Deal with RESCUEDIR 2004-08-19 22:25:49 +00:00
agc 276d62f603 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22308, verified by myself.
2003-08-07 10:04:22 +00:00
wiz 52270a7fd9 Add Ns. 2003-06-30 11:49:54 +00:00
wiz 82196526d4 New sentence, new line in last. Bump date for last. 2002-10-18 22:44:42 +00:00
atatat f232e00070 Add "-b bootstr" for shutdown to pass to reboot(8), so that shutdown
(which runs rc.shutdown, which might do stuff like, say, save your
ipnat or ipf state for restoration on reboot) can tell machines (sparc
and sun3 machines presently) how to boot.
2002-10-18 20:35:36 +00:00
wiz 4ce43ae0cd Whitespace nits 2001-11-16 10:25:42 +00:00
cgd 30b3e4f5c7 __CONCAT does token pasting, not string concatnation. if something like:
__CONCAT("foo","bar");
actually works to concantate strings, it's because the preprocessor expands
it into "foo""bar" as separate strings, and then ANSI string concatenation
is performed on that.  It's more straightforward to just use ANSI string
concatenation directly, and newer GCCs complain (rightly) about misuse
of token pasting.
2000-12-20 00:31:41 +00:00
wiz af69e93eb8 change mentioning of `login' to a .Xr in one place 2000-10-17 01:07:43 +00:00
jdolecek 339275db14 backoff rev 1.18 & 1.19 - it's made obsolete by last rc.d changes and using
arbitrary hard time limit for /etc/rc.shutdown is not right anyway
2000-07-25 19:02:15 +00:00
jdolecek 9ada2e4d0c backoff rev 1.36 - it's made obsolete by last rc.d changes and using
arbitrary hard time limit for /etc/rc.shutdown is not right anyway
2000-07-25 18:59:44 +00:00
jdolecek 3a7c71f3b9 fix synopsis line so that the -T syntax is right 2000-07-20 17:46:57 +00:00
jdolecek 02ca64b4c6 when running /etc/rc.shutdown, don't want on it until it completes
indefinitely - by default, wait maximum of 300 seconds only
the timeout is settable via new -T flag
Adjust history to mention addition of shutdown hooks and -T option on manpage

This fixes bin/10637.
2000-07-20 17:33:57 +00:00
jdolecek 94021a19a5 when running /etc/rc.shutdown, don't wait on it until it completes
indefinitely - by default, wait maximum of 300 seconds only
the timeout is settable via new -T flag
Adjust history to mention addition of shutdown hooks and -T option on manpage,
also move description of -D further up and slighly adjust.

This fixes bin/10637.
2000-07-20 17:33:56 +00:00
is 7bf4e6a5e3 exect->execve.
During my investigation, no reason could be found to enable tracing.
Fixes PR 7782 by Christoph Martin.
1999-10-31 13:24:05 +00:00
bad 1bb90faab4 testo. We want to source /etc/rc.shutdown.
Fixes PR #6474.
1998-11-22 19:13:45 +00:00
bad 7404107445 Run /etc/rc.shutdown when the final shutdown time has come.
Thanks to Ted Lemon for helping with my English.
1998-10-29 20:12:56 +00:00
bad af876a75fc Delete redundant "the". 1998-10-29 18:55:27 +00:00
enami 3c12da56ad Initialize the global variable `shuttime' with current time when
user requested to shutdown now, so that correct time is written in
/etc/nologin.
1998-10-09 03:01:40 +00:00
enami 2691695883 Add -p option in usage. 1998-10-09 02:26:17 +00:00
enami 138ef65e24 Sort options in SYNOPSIS alphabetically. 1998-10-09 02:24:08 +00:00
ross 029a64cc29 from Erik Bertelsen <erik@mediator.uni-c.dk>
{ put } { in } { lots } { of } { these } { to } { shut } { up } { egcs }
1998-08-25 19:18:12 +00:00
mycroft 09ef8c4ccd const poisoning. 1998-07-26 20:18:32 +00:00
mrg c028709e08 KNF. ensure hostname is nul-terminated 1998-07-05 08:34:25 +00:00
thorpej ff77be620b Add a -p option, to power down the system at the specified time. 1998-06-06 21:18:54 +00:00
fair 3d7afc6d03 fix bad .Xr references 1998-04-29 09:49:10 +00:00
kleink ed110b2e5e Need <time.h> for ctime(), time(), localtime() and mktime() prototypes. 1998-04-01 15:17:31 +00:00