diff options
author | gjb <gjb@FreeBSD.org> | 2016-04-04 23:55:32 +0000 |
---|---|---|
committer | gjb <gjb@FreeBSD.org> | 2016-04-04 23:55:32 +0000 |
commit | 1dc4c40e3b35564cb2e787ad968e6b4a9fb7eb0f (patch) | |
tree | a027fe5a27446f32854d6a07b34b5f2a992bf283 /etc | |
parent | 3669a0dced7e344be71d234ffc3a71530ef0ae08 (diff) | |
parent | 589cedfe0cde2b49d5f47fc240de37c8bf307abd (diff) | |
download | FreeBSD-src-1dc4c40e3b35564cb2e787ad968e6b4a9fb7eb0f.zip FreeBSD-src-1dc4c40e3b35564cb2e787ad968e6b4a9fb7eb0f.tar.gz |
MFH
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'etc')
-rw-r--r-- | etc/autofs/special_hosts | 4 | ||||
-rwxr-xr-x | etc/autofs/special_media | 25 | ||||
-rw-r--r-- | etc/mtree/BSD.usr.dist | 2 | ||||
-rwxr-xr-x | etc/rc.d/msgs | 22 | ||||
-rwxr-xr-x | etc/rc.d/pf | 6 |
5 files changed, 49 insertions, 10 deletions
diff --git a/etc/autofs/special_hosts b/etc/autofs/special_hosts index f81449d..c498546 100644 --- a/etc/autofs/special_hosts +++ b/etc/autofs/special_hosts @@ -10,8 +10,8 @@ if [ $# -eq 0 ]; then exit 0 fi -out=`showmount -e "$1"` +out=`showmount -E "$1"` [ $? -eq 0 ] || exit 1 echo "$out" | awk -v host="$1" \ - 'NR > 1 { printf "%s\t%s:%s ", $1, host, $1 } END { printf "\n" }' + '{ printf "\"%s\"\t\"%s:%s\" ", $0, host, $0 } END { printf "\n" }' diff --git a/etc/autofs/special_media b/etc/autofs/special_media index 32f9478..1e2c255 100755 --- a/etc/autofs/special_media +++ b/etc/autofs/special_media @@ -21,6 +21,7 @@ print_available() { _label="${_fstype_and_label#* }" # Replace plus signs and slashes with minuses; # leading plus signs have special meaning in maps, + # and multi-component keys are just not supported. _label="$(echo ${_label} | sed 's,[+/],-,g')" echo "${_label}" continue @@ -31,6 +32,26 @@ print_available() { } # Print a single map entry. +print_map_entry() { + local _fstype _p + + _fstype="$1" + _p="$2" + + if [ "${_fstype}" = "ntfs" ]; then + if [ -f "/usr/local/bin/ntfs-3g" ]; then + echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid :/dev/${_p}" + else + /usr/bin/logger -p info -t "special_media[$$]" \ + "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-ntfs first" + exit 1 + fi + else + echo "-fstype=${_fstype},nosuid :/dev/${_p}" + fi +} + +# Determine map entry contents for the given key and print out the entry. print_one() { local _fstype _fstype_and_label _label _key _p @@ -38,7 +59,7 @@ print_one() { _fstype="$(fstyp "/dev/${_key}" 2> /dev/null)" if [ $? -eq 0 ]; then - echo "-fstype=${_fstype},nosuid :/dev/${_key}" + print_map_entry "${_fstype}" "${_key}" return fi @@ -66,7 +87,7 @@ print_one() { continue fi - echo "-fstype=${_fstype},nosuid :/dev/${_p}" + print_map_entry "${_fstype}" "${_p}" done # No matching device - don't print anything, autofs will handle it. diff --git a/etc/mtree/BSD.usr.dist b/etc/mtree/BSD.usr.dist index 12a4ef6..44e9c3e 100644 --- a/etc/mtree/BSD.usr.dist +++ b/etc/mtree/BSD.usr.dist @@ -428,6 +428,8 @@ uefisign .. .. + firmware + .. games fortune .. diff --git a/etc/rc.d/msgs b/etc/rc.d/msgs index 6031acc..8bcc26c 100755 --- a/etc/rc.d/msgs +++ b/etc/rc.d/msgs @@ -6,8 +6,20 @@ # PROVIDE: msgs # REQUIRE: LOGIN -# Make a bounds file for msgs(1) if there isn't one already -# -if [ -d /var/msgs -a ! -f /var/msgs/bounds -a ! -L /var/msgs/bounds ]; then - echo 0 > /var/msgs/bounds -fi +. /etc/rc.subr + +name="msgs" +start_cmd="msgs_start" +stop_cmd=":" + +msgs_start() +{ + # Make a bounds file for msgs(1) if there isn't one already + # + if [ -d /var/msgs -a ! -f /var/msgs/bounds -a ! -L /var/msgs/bounds ]; then + echo 0 > /var/msgs/bounds + fi +} + +load_rc_config $name +run_rc_command "$1" diff --git a/etc/rc.d/pf b/etc/rc.d/pf index 8dcc40d..323e639 100755 --- a/etc/rc.d/pf +++ b/etc/rc.d/pf @@ -66,7 +66,11 @@ pf_resync() pf_status() { - $pf_program -s info + if ! [ -c /dev/pf ] ; then + echo "pf.ko is not loaded" + else + $pf_program -s info + fi } run_rc_command "$1" |