add python/ipaddress-1.0.18
[unleashed-userland.git] / components / quagga / patches / 05-noupg-nolegacy.patch
blob6b592106fc971844a30937e307b245642b5f97f6
1 --- solaris/quagga.init.in
2 +++ solaris/quagga.init.in
3 @@ -31,78 +31,6 @@
4 USER=@enable_user@
5 GROUP=@enable_group@
7 -# handle upgrade of daemon-args SMF property to new routeadm properties
8 -# used during upgrade too by routeadm.
9 -# relevant to S10U4+ only.
10 -handle_routeadm_upgrade () {
11 - GLOBAL_OPTIONS="PAfiug"
13 - daemon_args=`get_daemon_args $SMF_FMRI`
15 - if [ -n "$daemon_args" ]; then
16 - set_daemon_value_property "$SMF_FMRI" "$daemon_args" \
17 - "$GLOBAL_OPTIONS" "P" vty_port 0
18 - set_daemon_value_property "$SMF_FMRI" "$daemon_args" \
19 - "$GLOBAL_OPTIONS" "A" vty_address
20 - set_daemon_value_property "$SMF_FMRI" "$daemon_args" \
21 - "$GLOBAL_OPTIONS" "f" config_file
22 - set_daemon_value_property "$SMF_FMRI" "$daemon_args" \
23 - "$GLOBAL_OPTIONS" "i" pid_file
24 - set_daemon_value_property "$SMF_FMRI" "$daemon_args" \
25 - "$GLOBAL_OPTIONS" "u" user
26 - set_daemon_value_property "$SMF_FMRI" "$daemon_args" \
27 - "$GLOBAL_OPTIONS" "g" group
29 - case "$1" in
30 - zebra)
31 - set_daemon_boolean_property "$SMF_FMRI" "$daemon_args" \
32 - "${GLOBAL_OPTIONS}b" "b" batch true false
33 - ;;
34 - ripd|ripngd)
35 - set_daemon_boolean_property "$SMF_FMRI" "$daemon_args" \
36 - "${GLOBAL_OPTIONS}r" "r" retain true false
37 - ;;
38 - bgpd)
39 - set_daemon_boolean_property "$SMF_FMRI" "$daemon_args" \
40 - "${GLOBAL_OPTIONS}rnp" "r" retain true false
41 - set_daemon_boolean_property "$SMF_FMRI" "$daemon_args" \
42 - "${GLOBAL_OPTIONS}rnp" "n" no_kernel true false
43 - set_daemon_value_property "$SMF_FMRI" "$daemon_args" \
44 - "${GLOBAL_OPTIONS}rnp" "p" bgp_port
45 - esac
46 - clear_daemon_args $SMF_FMRI
47 - fi
50 -upgrade_config () {
51 - DAEMON=$1
52 - # handle upgrade of SUNWzebra to Quagga
53 - if [ -d "/etc/quagga" -a ! -f "/etc/quagga/${DAEMON}.conf" ] ; then
54 - if [ -f "/etc/sfw/zebra/${DAEMON}.conf" ] ; then
55 - cp "/etc/sfw/zebra/${DAEMON}.conf" \
56 - "/etc/quagga/${DAEMON}.conf.upgrade" \
57 - || exit $SMF_EXIT_ERR_FATAL
58 - chown "${USER}:${GROUP}" "/etc/quagga/${DAEMON}.conf.upgrade" \
59 - || exit $SMF_EXIT_ERR_FATAL
60 - chmod 0600 "/etc/quagga/${DAEMON}.conf.upgrade" \
61 - || exit $SMF_EXIT_ERR_FATAL
62 - mv "/etc/quagga/${DAEMON}.conf.upgrade" "/etc/quagga/${DAEMON}.conf" \
63 - || exit $SMF_EXIT_ERR_FATAL
64 - fi
65 - fi
67 - if [ ! -f "/etc/quagga/${DAEMON}.conf" ] ; then
68 - touch "/etc/quagga/${DAEMON}.conf.new" \
69 - || exit $SMF_EXIT_ERR_FATAL
70 - chown "${USER}:${GROUP}" "/etc/quagga/${DAEMON}.conf.new" \
71 - || exit $SMF_EXIT_ERR_FATAL
72 - chmod 0600 "/etc/quagga/${DAEMON}.conf.new" \
73 - || exit $SMF_EXIT_ERR_FATAL
74 - mv "/etc/quagga/${DAEMON}.conf.new" "/etc/quagga/${DAEMON}.conf" \
75 - || exit $SMF_EXIT_ERR_FATAL
76 - fi
79 # Relevant to S10+
80 quagga_is_globalzone () {
81 if [ "${QUAGGA_INIT_ZONENAME:=`/sbin/zonename`}" = "global" \
82 @@ -173,35 +101,11 @@
86 -# Include smf functions, if available. If not, define smf_present to indicate
87 -# there is no SMF. Should allow this script to work pre-S10.
88 -if [ -f "$SMFINCLUDE" ] ; then
89 - . "$SMFINCLUDE";
91 - # source the SMF-routeadm include if present..
92 - if [ -f "$ROUTEADMINCLUDE" ] ; then
93 - . "$ROUTEADMINCLUDE"
94 - fi
95 -else
96 - # pre-SMF system, fake up any functions and exit codes
97 - # which SMFINCLUDE usually provides.
98 - smf_present () {
99 - return 1
101 - SMF_EXIT_OK=0;
102 - SMF_EXIT_ERR_CONFIG=96;
103 - SMF_EXIT_ERR_FATAL=95;
106 -# if there's no SMF, set some default DAEMON_ARGS
107 -smf_present || DAEMON_ARGS=""
108 +. "$SMFINCLUDE";
109 +. "$ROUTEADMINCLUDE"
111 usage () {
112 - if smf_present ; then
113 - echo "Usage: $0 <daemon>";
114 - else
115 - echo "Usage: $0 <stop|start> <daemon> <daemon arguments>";
116 - fi
117 + echo "Usage: $0 <daemon>";
118 echo "The --pid_file argument is implied";
119 echo "This help message: $0 <help|usage>";
121 @@ -214,12 +118,7 @@
123 esac
125 -if smf_present ; then
126 - QUAGGA_METHOD="start"
127 -else
128 - QUAGGA_METHOD="$1"
129 - shift;
131 +QUAGGA_METHOD="start"
133 DAEMON="$1"
135 @@ -243,22 +142,9 @@
137 esac
139 -# Older Quagga SMF packages pass daemon args on the commandline
140 -# Newer SMF routeadm model uses properties for each argument
141 -# so we must handle that.
142 -if [ smf_present -a -f "$ROUTEADMINCLUDE" ]; then
143 - handle_routeadm_upgrade $DAEMON;
144 - DAEMON_ARGS=`routeadm_daemon_args`;
145 - routeadm_zebra_enable $DAEMON;
146 -else
147 - if [ $# -gt 0 ] ; then
148 - shift
149 - DAEMON_ARGS="$@"
150 - fi
152 +DAEMON_ARGS=`routeadm_daemon_args $DAEMON`;
153 +routeadm_zebra_enable $DAEMON;
155 -upgrade_config "$DAEMON"
157 if [ ! -f "@sysconfdir@/${DAEMON}.conf" ] ; then
158 echo "Could not find config file, @sysconfdir@/${DAEMON}.conf"
159 exit $SMF_EXIT_ERR_CONFIG
160 --- solaris/quagga.xml.in
161 +++ solaris/quagga.xml.in
162 @@ -226,8 +226,6 @@
163 <!-- Identifies service as a routing service -->
164 <propval name='daemon' type='astring'
165 value='@sbindir@/ripd' />
166 - <propval name='legacy-daemon' type='astring'
167 - value='/usr/sfw/sbin/ripdstart' />
168 <propval name='value_authorization' type='astring'
169 value='solaris.smf.value.routing' />
170 <propval name='protocol' type='astring' value='ipv4' />
171 @@ -489,8 +487,6 @@
172 <!-- Identifies service as a routing service -->
173 <propval name='daemon' type='astring'
174 value='@sbindir@/ospfd' />
175 - <propval name='legacy-daemon' type='astring'
176 - value='/usr/sfw/sbin/ospfdstart' />
177 <propval name='value_authorization' type='astring'
178 value='solaris.smf.value.routing' />
179 <propval name='protocol' type='astring' value='ipv4'/>
180 @@ -752,8 +748,6 @@
181 <!-- Identifies service as a routing service -->
182 <propval name='daemon' type='astring'
183 value='@sbindir@/bgpd' />
184 - <propval name='legacy-daemon' type='astring'
185 - value='/usr/sfw/sbin/bgpdstart' />
186 <propval name='value_authorization' type='astring'
187 value='solaris.smf.value.routing' />
188 <property name='protocol' type='astring'>