Print this page
2837 - remove print/lp* from gate and use CUPS from userland
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/lp/cmd/lpsched/print-svc
+++ new/usr/src/cmd/lp/cmd/lpsched/print-svc
1 1 #!/sbin/sh
2 2 #
3 3 # CDDL HEADER START
4 4 #
5 5 # The contents of this file are subject to the terms of the
6 6 # Common Development and Distribution License (the "License").
7 7 # You may not use this file except in compliance with the License.
8 8 #
9 9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 # or http://www.opensolaris.org/os/licensing.
11 11 # See the License for the specific language governing permissions
12 12 # and limitations under the License.
13 13 #
14 14 # When distributing Covered Code, include this CDDL HEADER in each
15 15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 # If applicable, add the following below this CDDL HEADER, with the
17 17 # fields enclosed by brackets "[]" replaced with your own identifying
18 18 # information: Portions Copyright [yyyy] [name of copyright owner]
19 19 #
20 20 # CDDL HEADER END
21 21 #
22 22 #
23 23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 24 # Use is subject to license terms.
25 25 #
26 26 #
27 27
28 28 . /lib/svc/share/smf_include.sh
29 29 . /lib/svc/share/ipf_include.sh
30 30
31 31 # SERVICE = parent service name
32 32 SERVICE=`echo $SMF_FMRI | /usr/bin/cut -f1,2 -d":"`
33 33
34 34 case "$1" in
35 35 'start')
36 36
37 37 isopts=`/usr/sbin/svccfg <<-EOF
38 38 select $SMF_FMRI
39 39 listpg cmd_opts
40 40
41 41 EOF`
42 42
43 43 if [ "$isopts" ] ; then
44 44
45 45 #called by /usr/lib/lpsched; use cmd_opts properties only
46 46
47 47 num_notifiers=`/bin/svcprop -p cmd_opts/num_notifiers $SMF_FMRI`
48 48
49 49 if [ "$num_notifiers" != "" ] ; then
50 50 OPTS="$OPTS -n $num_notifiers"
51 51 fi
52 52
53 53 num_filters=`/bin/svcprop -p cmd_opts/num_filters $SMF_FMRI`
54 54
55 55 if [ "$num_filters" != "" ] ; then
56 56 OPTS="$OPTS -f $num_filters"
57 57 fi
58 58
59 59 fd_limit=`/bin/svcprop -p cmd_opts/fd_limit $SMF_FMRI`
60 60
61 61 if [ "$fd_limit" != "" ] ; then
62 62 OPTS="$OPTS -p $fd_limit"
63 63 fi
64 64
65 65 reserved_fds=`/bin/svcprop -p cmd_opts/reserved_fds $SMF_FMRI`
66 66
67 67 if [ "$reserved_fds" != "" ] ; then
68 68 OPTS="$OPTS -r $reserved_fds"
69 69 fi
70 70
71 71 # clear out cmd_opts property group
72 72
73 73 svccfg <<-EOF
74 74 select $SMF_FMRI
75 75 delpg cmd_opts
76 76
77 77 EOF
78 78
79 79 else
80 80
81 81 # We are here through enable; use lpsched properties
82 82 # Check for saved properties
83 83
84 84 num_notifiers=`/bin/svcprop -p lpsched/num_notifiers $SERVICE`
85 85 if [ "$num_notifiers" != "" ] && [ "$num_notifiers" != "0" ] ; then
86 86 OPTS="$OPTS -n $num_notifiers"
87 87 fi
88 88
89 89 num_filters=`/bin/svcprop -p lpsched/num_filters $SERVICE`
90 90 if [ "$num_filters" != "" ] && [ "$num_filters" != "0" ] ; then
91 91 OPTS="$OPTS -f $num_filters"
92 92 fi
93 93
94 94 fd_limit=`/bin/svcprop -p lpsched/fd_limit $SERVICE`
95 95 if [ "$fd_limit" != "" ] && [ "$fd_limit" != "0" ]; then
96 96 OPTS="$OPTS -p $fd_limit"
97 97 fi
98 98
99 99 reserved_fds=`/bin/svcprop -p lpsched/reserved_fds $SERVICE`
100 100 if [ "$reserved_fds" != "" ] && [ "$reserved_fds" != "0" ] ; then
101 101 OPTS="$OPTS -r $reserved_fds"
102 102 fi
103 103 fi
104 104
105 105 # set temporary or permanent properties from OPTS
106 106
107 107 [ -f /usr/lib/lp/local/lpsched ] || exit $SMF_EXIT_ERR_CONFIG
108 108
109 109 /usr/lib/lp/local/lpsched ${OPTS}
110 110
111 111 ;;
112 112
↓ open down ↓ |
112 lines elided |
↑ open up ↑ |
113 113 'stop')
114 114 [ -f /usr/lib/lp/local/lpshut ] || exit $SMF_EXIT_ERR_CONFIG
115 115
116 116 /usr/lib/lp/local/lpshut
117 117 ;;
118 118
119 119 'ipfilter')
120 120 FMRI=$2
121 121 IPP_FMRI="svc:/application/print/ipp-listener:default"
122 122 RFC1179_FMRI="svc:/application/print/rfc1179:default"
123 - IPP_CONF=/etc/apache/httpd-standalone-ipp.conf
123 + IPP_CONF=/etc/apache2/2.2/httpd-standalone-ipp.conf
124 124 ip="any"
125 125
126 126 policy=`get_policy $FMRI`
127 127
128 128 file=`fmri_to_file $RFC1179_FMRI $IPF_SUFFIX`
129 129 echo "# $RFC1179_FMRI" >$file
130 130 service_is_enabled ${RFC1179_FMRI}
131 131 if [ $? -eq 0 ]; then
132 132 rfc_name=`svcprop -p inetd/name ${RFC1179_FMRI} 2>/dev/null`
133 133 rfc_proto=`svcprop -p inetd/proto ${RFC1179_FMRI} 2>/dev/null | \
134 134 sed 's/6/ /'`
135 135 rfc_port=`$SERVINFO -p -t -s $rfc_name`
136 136 generate_rules $FMRI $policy $rfc_proto $ip $rfc_port $file
137 137 fi
138 138
139 139 file=`fmri_to_file $IPP_FMRI $IPF_SUFFIX`
140 140 echo "# $IPP_FMRI" >$file
141 141 service_is_enabled ${IPP_FMRI}
142 142 if [ $? -eq 0 ]; then
143 143 #
144 144 # If Listen directives are used, it's possibie to listen on
145 145 # more than one ports. Process the Port directives only when Listen
146 146 # directives don't exist.
147 147 #
148 148 ipp_ports=`grep '^[ \t]*[^# ]*Listen' ${IPP_CONF} | awk '{print $2}'`
149 149
150 150 if [ -z "$ipp_ports" ]; then
151 151 ipp_ports=`grep '^[ \t]*[^# ]*Port' ${IPP_CONF} | \
152 152 awk '{print $2}' | tail -1`
153 153 fi
154 154
155 155 for port in $ipp_ports; do
156 156 generate_rules $FMRI $policy "tcp" $ip $port $file
157 157 done
158 158 fi
159 159
160 160 ;;
161 161
162 162 *)
163 163 echo "Usage: $0 { start | stop }"
164 164 exit 1
165 165 ;;
166 166 esac
167 167 exit $SMF_EXIT_OK
↓ open down ↓ |
34 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX