Age | Commit message (Collapse) | Author |
|
powerdown, halt, or singleuser. Before pledge, unveil access to
/dev/console, /etc/rc for singleuser entry, execute of /usr/bin/wall
to alert users, and creation of the fastboot and nologin files. Also
conditionally allow execute of halt, reboot, or the shell depending on mode.
Believe all scenarios were tested -- please exercise this one a bit.
|
|
Admins don't necessarily reside in the same timezone as the
machine. If an admin mistakenly schedules downtime for a
machine at the wrong time this could be quite bad.
Users, too, don't necessarily reside in the same timezone as the
machine. Saying the box is going down at "15:40" is potentially
ambiguous.
So, display the local timezone in all logs, broadcasts, printouts,
messages, etc. Give the admin a chance to correct the mistake; give
the user a better idea of when the box is actually going down.
This also updates the process' understanding of the present time
before printing estimates. The system's wall clock could have
changed after the shutdown was scheduled, making subsequent
broadcasts potentially misleading for users.
ok deraadt@
|
|
strtonum(3) accepts a single leading '+', so if we increment timearg we
allow input with two leading pluses. If we don't increment, we still
have a valid input for strtonum(3).
While here, use errstr to say what was wrong with timearg.
Don't increase the range for offsets yet: it exposes segfaults elsewhere
in the program that need to be addressed.
ok millert@ tb@
|
|
If we insert our offset into tlist[] and then process tlist[] like an
array we can eliminate many of the special cases and duplicate calls
in loop().
While we're at it, change struct interval and timewarn() to use time_t
to eliminate the need for some of the casting and add explicit long-long
suffixes to the constants in tlist[] to head off overflow if the code
wanders off.
With type-related input from tb@ and a style tweak from anton@.
ok tb@
|
|
We can limit the time we wait on wall(1) without the complexity
inherent to setjmp.
Actually wait (instead of waitpid) to pick up any straggler wall
processes from prior timewarn() calls.
With a tweak from millert@ to ensure we don't accidentally close
stdin before we exec wall.
ok millert@ tb@
|
|
ok jca@ tb@
|
|
OK deraadt@, millert@
|
|
localtime() since it tends to work better than ctime() when some
filesystems are absent.
ok guenther
|
|
it sounds like a lot, but this will eventually run the /etc/rc scripts
to shutdown, then run reboot or halt. After looking at getpw*, drop
pledge "getpw". Later drop to just "stdio exec"...
This depends on new pledge semantics for revoke(2).
with help from jca
ok guenther millert semarie tedu jca
|
|
|
|
handling along the way.
Reviews by Brendan MacDonell, Jeremy Devenport, florian, doug, millert
|
|
What's worse, the tzfile.h that gets installed is over 20 years old
and doesn't match the real tzfile.h in libc/time. This makes the
tree safe for /usr/include/tzfile.h removal. The TM_YEAR_BASE
define has been moved to time.h temporarily until its usage is
replaced by 1900 in the tree. Actual removal of tzfile.h is pending
a ports build. Based on a diff from deraadt@
|
|
the conditional operator. Adapted from NetBSD. ok miod@
|
|
and compatibility with other BSDs. Adapted from FreeBSD.
Still permit the combination "-hp" as requested by many.
ok sthen@
|
|
possible. Annotate <sys/param.h> lines with their current reasons. Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution. These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)
|
|
Careful second audit by millert
|
|
as neither arrayified not arrayfied exist -- sanctioned dictionaries
like Merriam-Webster ones suggest a few alternatives (e.g., arrayed),
however these made up words are easy to understand and we are not
certain that current ones are not ok.
ok jmc@
|
|
unmaintainable). these days, people use source. these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(luna88k and zaurus also work with -p option.)
ok miod@
|
|
|
|
|
|
|
|
- some mdoc fixes
|
|
rescinded 22 July 1999. Proofed by myself and Theo.
|
|
|
|
each non-option shall be treated as arguments to option '\1'.
BSD getopt match '-' in optstring with a '-' on the command line.
This is used to support deprecated options like "su -" that would
otherwise prevent the use of getopt().
Resolving this simply requires that the leading '-' be moved somewhere
else (I moved it to the end of optstring) since position within
optstring is not meaningful.
|
|
|
|
|
|
hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
|
|
o) wrap long lines;
o) fix bogus .Xr usage;
o) we don't like blank lines;
o) always close .Bl tags;
o) OpenBSD -> .Ox;
o) don't like .Pp before .Ss;
millert@ ok;
|
|
millert@ ok
|
|
sort it.
|
|
|
|
handler will take care of this. Pointed out by bk@rt.fm;
millert@ ok. (Although it was millert@ who asked for it
in the first place, bad me for not checking the source. :-)
|
|
Also mention that /etc/nologin should be deleted after this
if needed.
ok millert@
|
|
|
|
|
|
|
|
|
|
|
|
without options. Other wording tweaks. Move comment related to -p
to where -p is defined, not where -h is defined.
|
|
|
|
|
|
powerdown work correctly on some processors. Idea from mickey@ and
smcho@tsp.korea.ac.kr. Tested my me and angelos@.
Note: If you want to try these out you'll need to
cd /sys/arch/i386/include &&
sudo install -m 444 -o root -g root cpu.h /usr/include/i386
cd /usr/src/sbin/sysctl && make obj && make && sudo make install
to get a sysctl that understands the new variable (machdep.apmhalt).
|