/[base]/head/sbin/shutdown/shutdown.c
ViewVC logotype

Log of /head/sbin/shutdown/shutdown.c

Parent Directory Parent Directory | Revision Log Revision Log


Links to HEAD: (view) (download) (annotate)
Sticky Revision:

Revision 327488 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 2 09:02:42 2018 UTC (6 years, 3 months ago) by eadler
File length: 13584 byte(s)
Diff to previous 327476
shutdown: Fix r327476 by adding init

Initialize maybe_today. While here sort.

PR:				32411
Additionally reported by:	rgrimes, ian


Revision 327476 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jan 1 22:33:57 2018 UTC (6 years, 3 months ago) by eadler
File length: 13566 byte(s)
Diff to previous 326025
shutdown: Assume absolute time is in the future

The original bug describes it best:

When an absolute time is specified to shutdown, the program's
behavior depends on whether that time has passed during the
current calendar day.  POLA would suggest that for shutdown,
whose time argument is always supposed to be in the future,
absolute times specified without a specific date should refer
to the next occurrence of that time, rather than erroring out
if that time has already passed during the current day.

PR:		32411
Submitted by:	wollman@khavrinen.lcs.mit.edu
Submitted on:	2001-11-30 20:30:01 UTC
Reviewed by:	asmodai (at time of bug submission)


Revision 326025 - (view) (download) (annotate) - [select for diffs]
Modified Mon Nov 20 19:49:47 2017 UTC (6 years, 4 months ago) by pfg
File length: 13195 byte(s)
Diff to previous 325206
General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


Revision 325206 - (view) (download) (annotate) - [select for diffs]
Modified Tue Oct 31 03:39:36 2017 UTC (6 years, 5 months ago) by imp
File length: 13150 byte(s)
Diff to previous 324985
Add -c to the usage statements.

Submitted by: Maxim Konovalov


Revision 324985 - (view) (download) (annotate) - [select for diffs]
Modified Wed Oct 25 15:30:30 2017 UTC (6 years, 5 months ago) by imp
File length: 13145 byte(s)
Diff to previous 314436
Add power cycle support (-c) to shutdown.

Sponsored by: Netflix


Revision 314436 - (view) (download) (annotate) - [select for diffs]
Modified Tue Feb 28 23:42:47 2017 UTC (7 years, 1 month ago) by imp
File length: 12746 byte(s)
Diff to previous 275818
Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96


Revision 275818 - (view) (download) (annotate) - [select for diffs]
Modified Tue Dec 16 08:29:02 2014 UTC (9 years, 3 months ago) by gleb
File length: 12746 byte(s)
Diff to previous 238968
sbin/shutdown: Support time units as in 'shutdown -r +5sec'

Units supported: s, sec, m, min, h, hour.

Differential Revision:	https://reviews.freebsd.org/D1272


Revision 238968 - (view) (download) (annotate) - [select for diffs]
Modified Wed Aug 1 09:10:21 2012 UTC (11 years, 8 months ago) by des
File length: 12086 byte(s)
Diff to previous 235855
Restore a piece of BSD history.

PR:		169127
Submitted by:	Ruben de Groot <ruben@hacktor.com>
MFC after:	1 week


Revision 235855 - (view) (download) (annotate) - [select for diffs]
Modified Wed May 23 19:25:46 2012 UTC (11 years, 10 months ago) by jilles
File length: 12047 byte(s)
Diff to previous 229403
shutdown: Remove unnecessary 2-second delay.


Revision 229403 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 3 18:51:58 2012 UTC (12 years, 3 months ago) by ed
File length: 12064 byte(s)
Diff to previous 227081
Replace index() and rindex() calls with strchr() and strrchr().

The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.


Revision 227081 - (view) (download) (annotate) - [select for diffs]
Modified Fri Nov 4 13:36:02 2011 UTC (12 years, 5 months ago) by ed
File length: 12063 byte(s)
Diff to previous 216823
Add missing static keywords for global variables to tools in sbin/.

These tools declare global variables without using the static keyword,
even though their use is limited to a single C-file, or without placing
an extern declaration of them in the proper header file.


Revision 216823 - (view) (download) (annotate) - [select for diffs]
Modified Thu Dec 30 18:06:31 2010 UTC (13 years, 3 months ago) by pjd
File length: 12056 byte(s)
Diff to previous 201180
For compatibility with Linux and Solaris add poweroff(8).

It is implemented as a hard link to shutdown(8) and it is equivalent of:

	# shutdown -p now

While I'm here put one line of usage into one line of C code so it is easier to
grep(1) and separate unrelated code with empty line.

MFC after:	2 weeks


Revision 201180 - (view) (download) (annotate) - [select for diffs]
Modified Tue Dec 29 08:49:43 2009 UTC (14 years, 3 months ago) by ed
File length: 11588 byte(s)
Diff to previous 197560
Add missing `void' for functions without arguments.

While there, rename die_you_gravy_sucking_pig_dog() to something that's
less moronic.


Revision 197560 - (view) (download) (annotate) - [select for diffs]
Modified Mon Sep 28 07:42:52 2009 UTC (14 years, 6 months ago) by delphij
File length: 11619 byte(s)
Diff to previous 140797
Static'ify internal methods and use prototype.


Revision 140797 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 25 08:40:51 2005 UTC (19 years, 2 months ago) by delphij
File length: 11485 byte(s)
Diff to previous 140796
Use new style declarations instead of K&R ones.


Revision 140796 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 25 08:37:04 2005 UTC (19 years, 2 months ago) by delphij
File length: 11527 byte(s)
Diff to previous 128073
Use modern style defination for main() and move a extern
declaration to global section.

Bump WARNS?= to 6


Revision 128073 - (view) (download) (annotate) - [select for diffs]
Modified Fri Apr 9 19:58:40 2004 UTC (20 years ago) by markm
File length: 11542 byte(s)
Diff to previous 114763
Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core, imp


Revision 114763 - (view) (download) (annotate) - [select for diffs]
Modified Mon May 5 22:49:23 2003 UTC (20 years, 11 months ago) by obrien
File length: 11779 byte(s)
Diff to previous 114589
Centralize _PATH_* definitions.

Submitted by:	Tim Kientzle <kientzle@acm.org> (embellished by me)


Revision 114589 - (view) (download) (annotate) - [select for diffs]
Modified Sat May 3 18:41:59 2003 UTC (20 years, 11 months ago) by obrien
File length: 11784 byte(s)
Diff to previous 92883
Use __FBSDID() to quiet GCC 3.3 warnings.


Revision 92883 - (view) (download) (annotate) - [select for diffs]
Modified Thu Mar 21 13:20:49 2002 UTC (22 years ago) by imp
File length: 11781 byte(s)
Diff to previous 79749
o remove __P
o remove main prototype


Revision 79749 - (view) (download) (annotate) - [select for diffs]
Modified Sun Jul 15 05:46:07 2001 UTC (22 years, 8 months ago) by dd
File length: 11835 byte(s)
Diff to previous 50476
Constify, de-register-ify, __unused-ify, and set WARNS=2.

Submitted by:	Mike Barcroft <mike@q9media.com>


Revision 50476 - (view) (download) (annotate) - [select for diffs]
Modified Sat Aug 28 00:22:10 1999 UTC (24 years, 7 months ago) by peter
File length: 11814 byte(s)
Diff to previous 48956
$Id$ -> $FreeBSD$


Revision 48956 - (view) (download) (annotate) - [select for diffs]
Modified Wed Jul 21 02:49:42 1999 UTC (24 years, 8 months ago) by billf
File length: 11855 byte(s)
Diff to previous 48078
Avoid ambigious if/else


Revision 48078 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jun 21 16:06:21 1999 UTC (24 years, 9 months ago) by ru
File length: 11853 byte(s)
Diff to previous 48062
Signal init(8) instead of executing halt(8) or reboot(8)
when halting or rebooting the system.  It benefits from
running /etc/rc.shutdown by init(8).

``-o'' flag is provided for backward compatibility.

PR:		5451
Discussed with:	des


Revision 48062 - (view) (download) (annotate) - [select for diffs]
Modified Mon Jun 21 06:21:05 1999 UTC (24 years, 9 months ago) by jkoshy
File length: 11386 byte(s)
Diff to previous 48004
Minor cleanups to shutdown(8):

- Make the -k "don't actually halt" flag incompatible with
  the halt/reboot options -h, -p, and -r.
- The -n "don't sync" option is ignored if -k is specified.
  Issue a warning message.
- Compute the actual shutdown time written to /var/run/nologin
  correctly in the case of "now" being specified.


Revision 48004 - (view) (download) (annotate) - [select for diffs]
Modified Fri Jun 18 14:26:07 1999 UTC (24 years, 9 months ago) by ru
File length: 11290 byte(s)
Diff to previous 41684
Fix a coredump with negative (due to overflow) offset values.


Revision 41684 - (view) (download) (annotate) - [select for diffs]
Modified Fri Dec 11 11:21:47 1998 UTC (25 years, 4 months ago) by bde
File length: 11250 byte(s)
Diff to previous 41683
Merged from Lite2 (one bcopy -> memmove, one significant change:
don't unlink _PATH_NOLOGIN for the -k case even if shutdown terminates
abnormally.  NetBSD already has this change).


Revision 41683 - (view) (download) (annotate) - [select for diffs]
Modified Fri Dec 11 11:04:19 1998 UTC (25 years, 4 months ago) by bde
File length: 11235 byte(s)
Diff to previous 41666
Fixed missing 'p' and `-' flags and other defects in the usage message.

Fixed some style bugs.


Revision 41666 - (view) (download) (annotate) - [select for diffs]
Modified Thu Dec 10 23:54:02 1998 UTC (25 years, 4 months ago) by msmith
File length: 11228 byte(s)
Diff to previous 38036
Add a '-p' flag to shutdown which corresponds to the '-p' flag to halt,
requesting a system power-off after shutdown.


Revision 38036 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 3 06:22:43 1998 UTC (25 years, 8 months ago) by charnier
File length: 10835 byte(s)
Diff to previous 32399
Correct use of .Nm. Add rcsid. Do not dot terminate err(3) strings. Spelling.


Revision 32399 - (view) (download) (annotate) - [select for diffs]
Modified Sat Jan 10 20:11:06 1998 UTC (26 years, 3 months ago) by alex
File length: 10866 byte(s)
Diff to previous 32344
Pass an actual empty environment to execle() as per POSIX rather than
rely on undocumented behavior.

The following fixes were obtained from OpenBSD:

  o -Wall fixes to tlist array initialization and assignment used
    as truth value.
  o Use a restricted environment.
  o Improved error message when shutdown fails to exec reboot or halt.


Revision 32344 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jan 8 20:05:45 1998 UTC (26 years, 3 months ago) by alex
File length: 10595 byte(s)
Diff to previous 32329
Added environment parameter to execle calls.

Obtained from:	NetBSD PR2737 (augustss@cs.chalmers.se) via OpenBSD


Revision 32329 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jan 8 02:23:59 1998 UTC (26 years, 3 months ago) by alex
File length: 10576 byte(s)
Diff to previous 32328
Correct a comment from my last commit.


Revision 32328 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jan 8 02:21:30 1998 UTC (26 years, 3 months ago) by alex
File length: 10574 byte(s)
Diff to previous 28613
Allow 'shutdown datespec' to work into the next century.  Handle dates
in the 22nd century and beyond even though it's irrelevant with a 32-bit
time_t which expires in the year 2038.


Revision 28613 - (view) (download) (annotate) - [select for diffs]
Modified Sat Aug 23 14:10:34 1997 UTC (26 years, 7 months ago) by joerg
File length: 10210 byte(s)
Diff to previous 26737
Make the daemon process a true daemon by calling setsid().

PR:		bin/3202
Submitted by:	Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>


Revision 26737 - (view) (download) (annotate) - [select for diffs]
Modified Thu Jun 19 14:28:32 1997 UTC (26 years, 9 months ago) by charnier
File length: 10147 byte(s)
Diff to previous 24359
Use err(3).


Revision 24359 - (view) (download) (annotate) - [select for diffs]
Modified Sat Mar 29 03:33:12 1997 UTC (27 years ago) by imp
File length: 10345 byte(s)
Diff to previous 21931
compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


Revision 21931 - (view) (download) (annotate) - [select for diffs]
Modified Tue Jan 21 21:07:29 1997 UTC (27 years, 2 months ago) by adam
File length: 10346 byte(s)
Diff to previous 9987
-n was broken

2.2 candidate (probably)


Revision 9987 - (view) (download) (annotate) - [select for diffs]
Modified Mon Aug 7 19:17:46 1995 UTC (28 years, 8 months ago) by wollman
File length: 10454 byte(s)
Diff to previous 6443
Delete bogus referneces to timezone code internal header file `tzfile.h',
which is no longer bogusly installed in /usr/include.


Revision 6443 - (view) (download) (annotate) - [select for diffs]
Modified Wed Feb 15 14:35:29 1995 UTC (29 years, 1 month ago) by dg
File length: 10474 byte(s)
Diff to previous 4844
Yanked out (now obsolete) support for 'fastboot'.


Revision 4844 - (view) (download) (annotate) - [select for diffs]
Modified Sun Nov 27 23:52:13 1994 UTC (29 years, 4 months ago) by ats
File length: 10917 byte(s)
Diff to previous 1559
Submitted by:	M.C. Wong
Obtained from:
Don't throw away the /etc/nologin file in the -k case.


Revision 1559 - (view) (download) (annotate) - [select for diffs]
Modified Thu May 26 06:35:07 1994 UTC (29 years, 10 months ago) by rgrimes
File length: 10919 byte(s)
Copied from: vendor/CSRG/dist/sbin/shutdown/shutdown.c revision 1558
Diff to previous 1558
This commit was generated by cvs2svn to compensate for changes in r1558,
which included commits to RCS files with non-trunk default branches.


Revision 1558 - (view) (download) (annotate) - [select for diffs]
Added Thu May 26 06:35:07 1994 UTC (29 years, 10 months ago) by rgrimes
Original Path: vendor/CSRG/dist/sbin/shutdown/shutdown.c
File length: 10919 byte(s)
BSD 4.4 Lite sbin Sources

Note:  XNSrouted and routed NOT imported here, they shall be imported with
usr.sbin.


This form allows you to request diffs between any two revisions of this file. For each of the two "sides" of the diff, enter a numeric revision.

  Diffs between and
  Type of Diff should be a

  ViewVC Help
Powered by ViewVC 1.1.27