| @@ -1,16 +1,16 @@ | | | @@ -1,16 +1,16 @@ |
1 | #!/bin/sh | | 1 | #!/bin/sh |
2 | # | | 2 | # |
3 | # $NetBSD: rtadvd,v 1.9 2016/11/18 23:10:05 kre Exp $ | | 3 | # $NetBSD: rtadvd,v 1.10 2016/11/19 01:14:58 kre Exp $ |
4 | # | | 4 | # |
5 | | | 5 | |
6 | # PROVIDE: rtadvd | | 6 | # PROVIDE: rtadvd |
7 | # REQUIRE: DAEMON | | 7 | # REQUIRE: DAEMON |
8 | # BEFORE: LOGIN | | 8 | # BEFORE: LOGIN |
9 | | | 9 | |
10 | $_rc_subr_loaded . /etc/rc.subr | | 10 | $_rc_subr_loaded . /etc/rc.subr |
11 | | | 11 | |
12 | name=rtadvd | | 12 | name=rtadvd |
13 | rcvar=$name | | 13 | rcvar=$name |
14 | command="/usr/sbin/$name" | | 14 | command="/usr/sbin/$name" |
15 | pidfile="/var/run/$name.pid" | | 15 | pidfile="/var/run/$name.pid" |
16 | extra_commands=reload | | 16 | extra_commands=reload |
| @@ -46,27 +46,27 @@ rtadvd_prereload() | | | @@ -46,27 +46,27 @@ rtadvd_prereload() |
46 | esac | | 46 | esac |
47 | done | | 47 | done |
48 | | | 48 | |
49 | ${cflag} || test -f "${conf}" && { | | 49 | ${cflag} || test -f "${conf}" && { |
50 | confdir=$(dirname "${conf}") | | 50 | confdir=$(dirname "${conf}") |
51 | echo "${name}: copying ${conf} to ${chdir}${conf}" | | 51 | echo "${name}: copying ${conf} to ${chdir}${conf}" |
52 | mkdir -p "${chdir}${confdir}" | | 52 | mkdir -p "${chdir}${confdir}" |
53 | cp "${conf}" "${chdir}${conf}" || return 1 | | 53 | cp "${conf}" "${chdir}${conf}" || return 1 |
54 | } | | 54 | } |
55 | | | 55 | |
56 | # Make sure /var/run exists in the chroot | | 56 | # Make sure /var/run exists in the chroot |
57 | mkdir -p "${chdir}/var/run" | | 57 | mkdir -p "${chdir}/var/run" |
58 | | | 58 | |
59 | # Provide links to the chrooted dump & pid files | | 59 | # Provide a link to the chrooted dump file |
60 | ln -snf "${chdir}/var/run/${name}.dump" /var/run | | 60 | ln -snf "${chdir}/var/run/${name}.dump" /var/run |
61 | | | 61 | |
62 | # Note: actual chroot is done by rtadvd itself | | 62 | # Note: actual chroot is done by rtadvd itself |
63 | | | 63 | |
64 | return 0 | | 64 | return 0 |
65 | } | | 65 | } |
66 | | | 66 | |
67 | rtadvd_prestart() | | 67 | rtadvd_prestart() |
68 | { | | 68 | { |
69 | if [ "$ip6mode" != router ]; then | | 69 | if [ "$ip6mode" != router ]; then |
70 | warn \ | | 70 | warn \ |
71 | "${name} cannot be used on IPv6 host, only on an IPv6 router." | | 71 | "${name} cannot be used on IPv6 host, only on an IPv6 router." |
72 | return 1 | | 72 | return 1 |