From: Alex Musolino <alex@musolino.id.au>
To: 9front@9front.org
Subject: Re: [9front] -d option for fshalt
Date: Thu, 4 Jun 2020 16:27:13 +0930 [thread overview]
Message-ID: <9183627795DC5C421772A3CB7E426121@musolino.id.au> (raw)
In-Reply-To: <180DA00A5457D54F4C0A959E23BD199B@antares-labs.eu>
> - echo usage: $0 '[-r]' >[1=2]
> + echo usage: $0 '[-rd]' >[1=2]
Good catch. I opted for '[-d] [-r]' to match what I have in
the man page. The were separated in the first place so as not
to provide a misleading example; Fshalt will *not* parse the
individual flags out of a single '-rd' argument.
Updated patch follows.
diff -r ff6b294d07a9 rc/bin/fshalt
--- a/rc/bin/fshalt Mon Jun 01 00:07:01 2020 +0200
+++ b/rc/bin/fshalt Thu Jun 04 16:22:02 2020 +0930
@@ -1,16 +1,20 @@
#!/bin/rc
-# fshalt [-r] - sync (flush) and, if possible, halt all file servers
-# and optionally reboot
rfork en
+dump=no
reboot=no
scram=no
-switch ($#*) {
-case 0
-case 1
- reboot=yes
-case *
- echo usage: $0 '[-r]' >[1=2]
- exit usage
+
+while (~ $1 -*) {
+ switch ($1) {
+ case -d
+ dump=yes
+ case -r
+ reboot=yes
+ case *
+ echo usage: $0 '[-d] [-r]' >[1=2]
+ exit usage
+ }
+ shift
}
path=(/bin)
@@ -52,6 +56,13 @@
# put this in a shell function so this rc script doesn't get read
# when it's no longer accessible
fn x {
+ if (~ $dump yes) {
+ echo
+ echo -n dumping...
+ for (i in $c $h)
+ echo dump >>$i
+ }
+
echo
echo -n halting...
for (i in $c $h)
diff -r ff6b294d07a9 sys/man/8/fshalt
--- a/sys/man/8/fshalt Mon Jun 01 00:07:01 2020 +0200
+++ b/sys/man/8/fshalt Thu Jun 04 16:22:02 2020 +0930
@@ -4,6 +4,8 @@
.SH SYNOPSIS
.B fshalt
[
+.B -d
+] [
.B -r
]
.br
@@ -20,13 +22,15 @@
and
.IR hjfs (4)
servers.
-If given
-.BR -r ,
-.I fshalt
-will then reboot the machine.
-Else it will invoke
+The
+.BR -d
+option causes a dump command to be issued to the local filesystem
+before the sync and halt commands. Once any filesystems have been
+halted,
.I scram
-to shut down the machine.
+will be invoked to shut down the machine, unless the
+.BR -r
+option is specified, in which case the machine is instead rebooted.
The halting and rebooting is done by copying all necessary
commands into a
.IR ramfs (4)
next prev parent reply other threads:[~2020-06-04 6:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-02 4:37 Alex Musolino
2020-06-02 4:58 ` [9front] " Alex Musolino
2020-06-02 6:54 ` Alex Musolino
2020-06-02 6:59 ` rgl
2020-06-04 6:57 ` Alex Musolino [this message]
2020-06-04 12:27 ` kvik
2020-06-04 13:57 ` Alex Musolino
2020-06-04 15:50 ` kvik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9183627795DC5C421772A3CB7E426121@musolino.id.au \
--to=alex@musolino.id.au \
--cc=9front@9front.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).