Fix up mix of man(7)/mdoc(7).
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / examples / chroot-setup / Solaris10
blob8647d9a8cf407a971d2538ab4e9a0788ccd46169
1 #!/bin/sh
2 # From original Solaris 8 version by Matthew X. Economou
3 # Solaris 10 version updated by JD Bronson. Caution: this copies
4 # too many files. There is no need to copy libc.so and other files
5 # that are already linked in before a Postfix daemon chroots itself.
7 COMMAND_DIRECTORY="/usr/sbin"
8 DAEMON_DIRECTORY="/usr/libexec/postfix"
9 QUEUE_DIRECTORY="/var/spool/postfix"
11 ## Copy any shared libraries, device entries, or configuration files
12 ## needed by Postfix into the jail.
13 binlist="
14 $DAEMON_DIRECTORY/virtual
15 $DAEMON_DIRECTORY/trivial-rewrite
16 $DAEMON_DIRECTORY/spawn
17 $DAEMON_DIRECTORY/smtpd
18 $DAEMON_DIRECTORY/smtp
19 $DAEMON_DIRECTORY/showq
20 $DAEMON_DIRECTORY/qmqpd
21 $DAEMON_DIRECTORY/qmgr
22 $DAEMON_DIRECTORY/proxymap
23 $DAEMON_DIRECTORY/pipe
24 $DAEMON_DIRECTORY/pickup
25 $DAEMON_DIRECTORY/nqmgr
26 $DAEMON_DIRECTORY/master
27 $DAEMON_DIRECTORY/local
28 $DAEMON_DIRECTORY/lmtp
29 $DAEMON_DIRECTORY/flush
30 $DAEMON_DIRECTORY/error
31 $DAEMON_DIRECTORY/cleanup
32 $DAEMON_DIRECTORY/bounce
33 /usr/lib/sendmail
34 $COMMAND_DIRECTORY/postsuper
35 $COMMAND_DIRECTORY/postqueue
36 $COMMAND_DIRECTORY/postmap
37 $COMMAND_DIRECTORY/postlog
38 $COMMAND_DIRECTORY/postlock
39 $COMMAND_DIRECTORY/postkick
40 $COMMAND_DIRECTORY/postfix
41 $COMMAND_DIRECTORY/postdrop
42 $COMMAND_DIRECTORY/postconf
43 $COMMAND_DIRECTORY/postcat
44 $COMMAND_DIRECTORY/postalias
46 ldd $binlist | awk '/[=]>/ { print $3 }' | sort -u | while read i
48 mkdir -p $QUEUE_DIRECTORY`dirname $i`
49 ## Sun's version of tar sucks. We'll have to remove the leading
50 ## slashes from file names ourself, otherwise the copy doesn't
51 ## work.
52 (cd / && tar cphf - `echo $i | sed -e 's/^\///'`) | (cd $QUEUE_DIRECTORY && tar xpf -)
53 done
55 ## More stuff for the jail, mostly discovered by inspection
56 ## (e.g. strings, lsof).
57 more="
58 /dev/zero
59 /dev/null
60 /dev/udp6
61 /dev/tcp6
62 /dev/udp
63 /dev/tcp
64 /dev/poll
65 /dev/rawip
66 /dev/ticlts
67 /dev/ticotsord
68 /dev/ticots
69 /devices/pseudo/mm@0:zero
70 /devices/pseudo/mm@0:null
71 /devices/pseudo/udp6@0:udp6
72 /devices/pseudo/tcp6@0:tcp6
73 /devices/pseudo/udp@0:udp
74 /devices/pseudo/tcp@0:tcp
75 /devices/pseudo/poll@0:poll
76 /devices/pseudo/icmp@0:icmp
77 /devices/pseudo/tl@0:ticlts
78 /devices/pseudo/tl@0:ticotsord
79 /devices/pseudo/tl@0:ticots
80 /etc/hosts
81 /etc/nsswitch.conf
82 /etc/netconfig
83 /etc/passwd
84 /etc/resolv.conf
85 /etc/default/init
86 /etc/default/nss
87 /etc/inet/services
88 /etc/inet/hosts
89 /etc/services
90 /lib/ld.so
91 /lib/ld.so.1
92 /usr/lib/nss_dns.so.1
93 /usr/lib/sparcv9/straddr.so
94 /usr/lib/straddr.so
95 /usr/lib/straddr.so.2
96 /lib/libintl.so
97 /lib/libintl.so.1
98 /lib/libw.so
99 /lib/libw.so.1
100 /lib/nss_nis.so.1
101 /lib/nss_nisplus.so.1
102 /lib/nss_dns.so.1
103 /lib/nss_files.so.1
104 /usr/share/lib/zoneinfo
105 /var/ld/ld.config
107 for i in $more; do
108 mkdir -p $QUEUE_DIRECTORY`dirname $i`
109 (cd / && tar cpf - `echo $i | sed -e 's/^\///'`) | (cd $QUEUE_DIRECTORY && tar xpf -)
110 done
112 exit 0