Index: trunk/tools/ts-specs/TSmytop.spec |
— | — | @@ -5,6 +5,7 @@ |
6 | 6 | Version: 1.6 |
7 | 7 | Source: http://jeremy.zawodny.com/mysql/mytop/mytop-%{version}.tar.gz |
8 | 8 | Patch1: mytop-01-specials.diff |
| 9 | +Patch2: mytop-02-questions.diff |
9 | 10 | |
10 | 11 | SUNW_BaseDir: %{_basedir} |
11 | 12 | BuildRoot: %{_tmppath}/%{name}-%{version}-build |
— | — | @@ -22,6 +23,7 @@ |
23 | 24 | %prep |
24 | 25 | %setup -q -n mytop-%version |
25 | 26 | %patch1 -p0 |
| 27 | +%patch2 -p0 |
26 | 28 | |
27 | 29 | %build |
28 | 30 | |
Index: trunk/tools/ts-specs/TSmysql.spec |
— | — | @@ -13,12 +13,14 @@ |
14 | 14 | Name: %{mysql.name} |
15 | 15 | Summary: %{mysql.summary} |
16 | 16 | Version: %{mysql.version} |
| 17 | +Source2: mysql.xml |
17 | 18 | |
18 | 19 | SUNW_BaseDir: /opt/TSmysql |
19 | 20 | BuildRoot: %{_tmppath}/%{name}-%{version}-build |
20 | 21 | %include default-depend.inc |
21 | 22 | |
22 | 23 | Requires: TSisaexec |
| 24 | +Requires: TSlibfasttime |
23 | 25 | |
24 | 26 | %package devel |
25 | 27 | Summary: %{summary} - development files |
— | — | @@ -26,6 +28,10 @@ |
27 | 29 | %include default-depend.inc |
28 | 30 | Requires: %name |
29 | 31 | |
| 32 | +%package root |
| 33 | +Summary: %{summary} - / filesystem |
| 34 | +SUNW_BaseDir: / |
| 35 | + |
30 | 36 | %package extra |
31 | 37 | Summary: %{summary} - test suite and benchmark tools |
32 | 38 | SUNW_BaseDir: %{_basedir} |
— | — | @@ -92,6 +98,9 @@ |
93 | 99 | |
94 | 100 | ln -s ../../ts/lib/isaexec $RPM_BUILD_ROOT%{_libdir}/mysqld |
95 | 101 | |
| 102 | +mkdir -p $RPM_BUILD_ROOT/var/svc/manifest |
| 103 | +cp %SOURCE2 $RPM_BUILD_ROOT/var/svc/manifest |
| 104 | + |
96 | 105 | %clean |
97 | 106 | rm -rf $RPM_BUILD_ROOT |
98 | 107 | |
— | — | @@ -148,6 +157,10 @@ |
149 | 158 | %{_bindir}/%_arch64/* |
150 | 159 | %endif |
151 | 160 | |
| 161 | +%files root |
| 162 | +%defattr (-, root, sys) |
| 163 | +%class(manifest) /var/svc/manifest/mysql.xml |
| 164 | + |
152 | 165 | %files extra |
153 | 166 | %defattr (-, root, bin) |
154 | 167 | %dir %attr (0755, root, sys) %{_prefix}/mysql-test |
Index: trunk/tools/ts-specs/patches/mytop-02-questions.diff |
— | — | @@ -0,0 +1,56 @@ |
| 2 | +--- mytop.old Tue Mar 3 04:50:15 2009 |
| 3 | +@@ -803,8 +803,8 @@ |
| 4 | + |
| 5 | + ## Queries per second... |
| 6 | + |
| 7 | +- my $avg_queries_per_sec = sprintf("%.2f", $STATUS{Questions} / $STATUS{Uptime}); |
| 8 | +- my $num_queries = $STATUS{Questions}; |
| 9 | ++ my $avg_queries_per_sec = sprintf("%.2f", $STATUS{Queries} / $STATUS{Uptime}); |
| 10 | ++ my $num_queries = $STATUS{Queries}; |
| 11 | + |
| 12 | + my @t = localtime(time); |
| 13 | + |
| 14 | +@@ -823,25 +823,25 @@ |
| 15 | + |
| 16 | + |
| 17 | + printf " Queries: %-5s qps: %4.0f Slow: %7s Se/In/Up/De(%%): %02.0f/%02.0f/%02.0f/%02.0f \n", |
| 18 | +- make_short( $STATUS{Questions} ), # q total |
| 19 | +- $STATUS{Questions} / $STATUS{Uptime}, # qps, average |
| 20 | ++ make_short( $STATUS{Queries} ), # q total |
| 21 | ++ $STATUS{Queries} / $STATUS{Uptime}, # qps, average |
| 22 | + make_short( $STATUS{Slow_queries} ), # slow |
| 23 | + |
| 24 | + # hmm. a Qcache hit is really a select and should be counted. |
| 25 | +- 100 * ($STATUS{Com_select} + ($STATUS{Qcache_hits}||0) ) / $STATUS{Questions}, |
| 26 | +- 100 * ($STATUS{Com_insert} + $STATUS{Com_replace} ) / $STATUS{Questions}, |
| 27 | +- 100 * ($STATUS{Com_update} ) / $STATUS{Questions}, |
| 28 | +- 100 * $STATUS{Com_delete} / $STATUS{Questions}; |
| 29 | ++ 100 * ($STATUS{Com_select} + ($STATUS{Qcache_hits}||0) ) / $STATUS{Queries}, |
| 30 | ++ 100 * ($STATUS{Com_insert} + $STATUS{Com_replace} ) / $STATUS{Queries}, |
| 31 | ++ 100 * ($STATUS{Com_update} ) / $STATUS{Queries}, |
| 32 | ++ 100 * $STATUS{Com_delete} / $STATUS{Queries}; |
| 33 | + |
| 34 | + $lines_left--; |
| 35 | + |
| 36 | + if ($t_delta) |
| 37 | + { |
| 38 | +- my $q_diff = ( $STATUS{Questions} - $OLD_STATUS{Questions} ); |
| 39 | ++ my $q_diff = ( $STATUS{Queries} - $OLD_STATUS{Queries} ); |
| 40 | + # print("q_diff: $STATUS{Questions} - $OLD_STATUS{Questions} / $t_delta = $q_diff\n"); |
| 41 | + |
| 42 | + printf(" qps now: %4.0f Slow qps: %3.1f Threads: %4.0f (%4.0f/%4.0f) %02.0f/%02.0f/%02.0f/%02.0f \n", |
| 43 | +- ( $STATUS{Questions} - $OLD_STATUS{Questions} ) / $t_delta, |
| 44 | ++ ( $STATUS{Queries} - $OLD_STATUS{Queries} ) / $t_delta, |
| 45 | + ( # slow now (qps) |
| 46 | + ($STATUS{Slow_queries} ) ? |
| 47 | + ( $STATUS{Slow_queries} - $OLD_STATUS{Slow_queries} ) / $t_delta : |
| 48 | +@@ -1068,7 +1068,7 @@ |
| 49 | + |
| 50 | + sub GetQPS() |
| 51 | + { |
| 52 | +- my($data) = Hashes('SHOW STATUS LIKE "Questions"'); |
| 53 | ++ my($data) = Hashes('SHOW STATUS LIKE "Queries"'); |
| 54 | + my $num = $data->{Value}; |
| 55 | + |
| 56 | + if (not defined $questions) ## first time? |
Index: trunk/tools/ts-specs/patches/mysql-02-fasttime.diff |
— | — | @@ -0,0 +1,13 @@ |
| 2 | +--- scripts/mysqld_safe.sh.old Tue Mar 3 03:22:53 2009 |
| 3 | +@@ -542,6 +542,10 @@ |
| 4 | + # Avoid 'nohup: ignoring input' warning |
| 5 | + test -n "$NOHUP_NICENESS" && cmd="$cmd < /dev/null" |
| 6 | + |
| 7 | ++LD_PRELOAD_32=/opt/ts/lib/libfasttime.so |
| 8 | ++LD_PRELOAD_64=/opt/ts/lib/amd64/libfasttime.so |
| 9 | ++export LD_PRELOAD_32 LD_PRELOAD_64 |
| 10 | ++ |
| 11 | + log_notice "Starting $MYSQLD daemon with databases from $DATADIR" |
| 12 | + while true |
| 13 | + do |
Index: trunk/tools/ts-specs/ext-sources/sshtunnel.xml |
— | — | @@ -0,0 +1,29 @@ |
| 2 | +<?xml version='1.0'?> |
| 3 | +<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> |
| 4 | +<service_bundle type='manifest' name='export'> |
| 5 | + <service name='network/sshtunnel' type='service' version='0'> |
| 6 | + <create_default_instance enabled='false'/> |
| 7 | + <dependency name='multi-user-server' grouping='optional_all' restart_on='none' type='service'> |
| 8 | + <service_fmri value='svc:/milestone/multi-user-server'/> |
| 9 | + </dependency> |
| 10 | + <exec_method name='start' type='method' exec='/opt/ts/bin/sshtunnel-smf' timeout_seconds='60'> |
| 11 | + <method_context/> |
| 12 | + </exec_method> |
| 13 | + <exec_method name='stop' type='method' exec=':kill' timeout_seconds='60'> |
| 14 | + <method_context/> |
| 15 | + </exec_method> |
| 16 | + <property_group name='tunnel' type='application'> |
| 17 | + <propval name='local-port' type='integer' value='0'/> |
| 18 | + <propval name='remote-host' type='astring' value=''/> |
| 19 | + <propval name='remote-port' type='integer' value='0'/> |
| 20 | + </property_group> |
| 21 | + <property_group name='startd' type='framework'> |
| 22 | + <propval name='duration' type='astring' value='child'/> |
| 23 | + </property_group> |
| 24 | + <template> |
| 25 | + <common_name> |
| 26 | + <loctext xml:lang='C'>SSH tunnel</loctext> |
| 27 | + </common_name> |
| 28 | + </template> |
| 29 | + </service> |
| 30 | +</service_bundle> |
Index: trunk/tools/ts-specs/ext-sources/mysql.xml |
— | — | @@ -0,0 +1,24 @@ |
| 2 | +<?xml version='1.0'?> |
| 3 | +<!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> |
| 4 | +<service_bundle type='manifest' name='export'> |
| 5 | + <service name='application/mysql' type='service' version='0'> |
| 6 | + <create_default_instance enabled='false'/> |
| 7 | + <dependency name='multi-user-server' grouping='optional_all' restart_on='none' type='service'> |
| 8 | + <service_fmri value='svc:/milestone/multi-user-server'/> |
| 9 | + </dependency> |
| 10 | + <exec_method name='start' type='method' exec='/opt/TSmysql/bin/mysqld_safe' timeout_seconds='60'> |
| 11 | + <method_context/> |
| 12 | + </exec_method> |
| 13 | + <exec_method name='stop' type='method' exec='/opt/TSmysql/bin/mysqladmin --defaults-file=/root/.my.cnf shutdown' timeout_seconds='1200'> |
| 14 | + <method_context/> |
| 15 | + </exec_method> |
| 16 | + <property_group name='startd' type='framework'> |
| 17 | + <propval name='duration' type='astring' value='child'/> |
| 18 | + </property_group> |
| 19 | + <template> |
| 20 | + <common_name> |
| 21 | + <loctext xml:lang='C'>MySQL</loctext> |
| 22 | + </common_name> |
| 23 | + </template> |
| 24 | + </service> |
| 25 | +</service_bundle> |
Index: trunk/tools/ts-specs/ext-sources/checkraid.sh |
— | — | @@ -0,0 +1,66 @@ |
| 2 | +#! /bin/ksh |
| 3 | + |
| 4 | +MAILTO=admins@toolserver.org |
| 5 | +VARDIR=/var/opt/ts/checkstatus |
| 6 | +LIBDIR=/opt/ts/lib |
| 7 | + |
| 8 | +PROG=$LIBDIR/checkraid.awk |
| 9 | +ARCCONF=/opt/StorMan/arcconf |
| 10 | +STATUSFILE=$VARDIR/curr |
| 11 | +NEWSTATUS=$VARDIR/new |
| 12 | +MAILFILE=$VARDIR/mail |
| 13 | + |
| 14 | +if ! [ -d "$VARDIR" ]; then |
| 15 | + if ! mkdir -p "$VARDIR"; then |
| 16 | + echo >&2 "$0: could not create $VARDIR" |
| 17 | + exit 1 |
| 18 | + fi |
| 19 | +fi |
| 20 | + |
| 21 | +if ! [ -x "$ARCCONF" ]; then |
| 22 | + echo >&2 "$0: $ARCCONF not found; please install the StorMan package." |
| 23 | + exit 1 |
| 24 | +fi |
| 25 | + |
| 26 | +if ! $ARCCONF GETCONFIG 1 | $PROG >$NEWSTATUS; then |
| 27 | + echo >&2 "$0: $ARCCONF failed; see above messages for details" |
| 28 | + exit 1 |
| 29 | +fi |
| 30 | + |
| 31 | +if [ ! -f $STATUSFILE ]; then |
| 32 | + if ! mv $NEWSTATUS $STATUSFILE; then |
| 33 | + echo >&2 "$0: couldn't write to the status file $STATUSFILE" |
| 34 | + exit 1 |
| 35 | + fi |
| 36 | + |
| 37 | + exit 0 |
| 38 | +fi |
| 39 | + |
| 40 | +if cmp -s $NEWSTATUS $STATUSFILE; then |
| 41 | + rm -f $NEWSTATUS |
| 42 | + exit 0 |
| 43 | +fi |
| 44 | + |
| 45 | +rm -f $MAILFILE |
| 46 | +cat >$MAILFILE <<__EOF__ |
| 47 | +A change has been detected in the RAID controller on $(hostname): |
| 48 | + |
| 49 | +__EOF__ |
| 50 | +diff -u $STATUSFILE $NEWSTATUS >>$MAILFILE |
| 51 | +cat >>$MAILFILE <<__EOF__ |
| 52 | + |
| 53 | +The full controller status follows: |
| 54 | + |
| 55 | +__EOF__ |
| 56 | +cat $NEWSTATUS >>$MAILFILE |
| 57 | + |
| 58 | +rm -f $STATUSFILE |
| 59 | +mv $NEWSTATUS $STATUSFILE |
| 60 | + |
| 61 | +if ! mailx -s "RAID status change for $(hostname)" $MAILTO <$MAILFILE; then |
| 62 | + echo >&2 "$0: can't send mail" |
| 63 | + exit 1 |
| 64 | +fi |
| 65 | + |
| 66 | +rm -f $MAILFILE |
| 67 | +exit 0 |
Property changes on: trunk/tools/ts-specs/ext-sources/checkraid.sh |
___________________________________________________________________ |
Name: svn:executable |
1 | 68 | + * |
Index: trunk/tools/ts-specs/ext-sources/sshtunnel-smf |
— | — | @@ -0,0 +1,27 @@ |
| 2 | +#! /bin/ksh |
| 3 | + |
| 4 | + . /lib/svc/share/smf_include.sh |
| 5 | + |
| 6 | +getproparg() { |
| 7 | + val=`svcprop -p $1 $SMF_FMRI` |
| 8 | + [ -n "$val" ] && echo $val |
| 9 | +} |
| 10 | + |
| 11 | +localport=`getproparg tunnel/local-port` |
| 12 | +remoteport=`getproparg tunnel/remote-port` |
| 13 | +remotehost=`getproparg tunnel/remote-host` |
| 14 | + |
| 15 | +echo $localport $remoteport $remotehost |
| 16 | + |
| 17 | +while true; do |
| 18 | + ssh -Cni /etc/opt/sshtunnel/id_dsa \ |
| 19 | + -L$localport:$remotehost:$remoteport \ |
| 20 | + -cblowfish-cbc \ |
| 21 | + -n -N \ |
| 22 | + pppuser@browne.wikimedia.org |
| 23 | + |
| 24 | + # Transitory network problem? |
| 25 | + sleep 5 |
| 26 | +done |
| 27 | + |
| 28 | +exit 0 |
Property changes on: trunk/tools/ts-specs/ext-sources/sshtunnel-smf |
___________________________________________________________________ |
Name: svn:executable |
1 | 29 | + * |
Index: trunk/tools/ts-specs/ext-sources/checkraid.awk |
— | — | @@ -0,0 +1,25 @@ |
| 2 | +#! /usr/bin/nawk -f |
| 3 | + |
| 4 | +BEGIN { |
| 5 | + FAILED_DISK=0 |
| 6 | + FAILED_VOLUME=0 |
| 7 | +} |
| 8 | + |
| 9 | +/Controller Status/ { |
| 10 | + STATUS=$4 |
| 11 | +} |
| 12 | + |
| 13 | +/Defunct disk drive count/ { |
| 14 | + FAILED_DISK=$6 |
| 15 | +} |
| 16 | + |
| 17 | +/Logical devices\/Failed\/Degraded/ { |
| 18 | + split($4, x, / /) |
| 19 | + FAILED_VOLUME=x[2] + x[3] |
| 20 | +} |
| 21 | + |
| 22 | +END { |
| 23 | + print "Controller status: " STATUS |
| 24 | + print "Failed disks: " FAILED_DISK |
| 25 | + print "Failed volumes: " FAILED_VOLUME |
| 26 | +} |
Property changes on: trunk/tools/ts-specs/ext-sources/checkraid.awk |
___________________________________________________________________ |
Name: svn:executable |
1 | 27 | + * |
Index: trunk/tools/ts-specs/TSsshtunnel.spec |
— | — | @@ -0,0 +1,45 @@ |
| 2 | +%include Solaris.inc |
| 3 | + |
| 4 | +Name: TSsshtunnel |
| 5 | +Summary: SSH tunnel service |
| 6 | +Version: 1 |
| 7 | +Source1: sshtunnel.xml |
| 8 | +Source2: sshtunnel-smf |
| 9 | + |
| 10 | +SUNW_BaseDir: %{_basedir} |
| 11 | +BuildRoot: %{_tmppath}/%{name}-%{version}-build |
| 12 | +%include default-depend.inc |
| 13 | + |
| 14 | +%package root |
| 15 | +Summary: %{summary} - / filesystem |
| 16 | +SUNW_BaseDir: / |
| 17 | +%include default-depend.inc |
| 18 | + |
| 19 | +%prep |
| 20 | +%setup -q -T -c -n %name-%version |
| 21 | + |
| 22 | +%build |
| 23 | + |
| 24 | +%install |
| 25 | +rm -rf $RPM_BUILD_ROOT |
| 26 | +mkdir -p $RPM_BUILD_ROOT/var/svc/manifest/network |
| 27 | +cp %SOURCE1 $RPM_BUILD_ROOT/var/svc/manifest/network |
| 28 | +mkdir -p $RPM_BUILD_ROOT%{_bindir} |
| 29 | +cp %SOURCE2 $RPM_BUILD_ROOT%{_bindir} |
| 30 | + |
| 31 | +%clean |
| 32 | +rm -rf $RPM_BUILD_ROOT |
| 33 | + |
| 34 | +%files |
| 35 | +%defattr (-, root, bin) |
| 36 | +%dir %attr (0755, root, bin) %{_bindir} |
| 37 | +%attr (0755, root, bin) %{_bindir}/sshtunnel-smf |
| 38 | + |
| 39 | +%files root |
| 40 | +%defattr (-, root, sys) |
| 41 | +%dir %attr (0755, root, sys) /var/svc/manifest/network |
| 42 | +%class(manifest) /var/svc/manifest/network/sshtunnel.xml |
| 43 | + |
| 44 | +%changelog |
| 45 | +* Sun Mar 01 2009 - river@loreley.flyingparchment.org.uk |
| 46 | +- initial spec |
Index: trunk/tools/ts-specs/TScheckraid.spec |
— | — | @@ -0,0 +1,38 @@ |
| 2 | +%include Solaris.inc |
| 3 | + |
| 4 | +Name: TScheckraid |
| 5 | +Summary: checkraid utility for Adapter RAID controllers |
| 6 | +Version: 1 |
| 7 | +Source1: checkraid.sh |
| 8 | +Source2: checkraid.awk |
| 9 | + |
| 10 | +SUNW_BaseDir: %{_basedir} |
| 11 | +BuildRoot: %{_tmppath}/%{name}-%{version}-build |
| 12 | +%include default-depend.inc |
| 13 | + |
| 14 | +# Requires: |
| 15 | + |
| 16 | +%prep |
| 17 | +%setup -q -T -c -n %name-%version |
| 18 | +%build |
| 19 | + |
| 20 | +%install |
| 21 | +rm -rf $RPM_BUILD_ROOT |
| 22 | +mkdir -p $RPM_BUILD_ROOT%{_libdir} |
| 23 | +cp %SOURCE2 $RPM_BUILD_ROOT%{_libdir} |
| 24 | +mkdir -p $RPM_BUILD_ROOT%{_bindir} |
| 25 | +cp %SOURCE1 $RPM_BUILD_ROOT%{_bindir}/checkraid |
| 26 | + |
| 27 | +%clean |
| 28 | +rm -rf $RPM_BUILD_ROOT |
| 29 | + |
| 30 | +%files |
| 31 | +%defattr (-, root, bin) |
| 32 | +%dir %attr (0755, root, bin) %{_bindir} |
| 33 | +%attr (0755, root, bin) %{_bindir}/checkraid |
| 34 | +%dir %attr (0755, root, bin) %{_libdir} |
| 35 | +%attr (0755, root, bin) %{_libdir}/checkraid.awk |
| 36 | + |
| 37 | +%changelog |
| 38 | +* Sat Feb 28 2009 - river@loreley.flyingparchment.org.uk |
| 39 | +- initial spec |
Index: trunk/tools/ts-specs/base-specs/mysql.spec |
— | — | @@ -5,6 +5,7 @@ |
6 | 6 | Version: 5.1.31 |
7 | 7 | Source: http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.1/mysql-%{version}.tar.gz |
8 | 8 | Patch1: mysql-01-libdir.diff |
| 9 | +Patch2: mysql-02-fasttime.diff |
9 | 10 | |
10 | 11 | SUNW_BaseDir: /opt/TSmysql |
11 | 12 | BuildRoot: %{_tmppath}/%{name}-%{version}-build |
— | — | @@ -12,6 +13,7 @@ |
13 | 14 | %prep |
14 | 15 | %setup -q -n mysql-%version |
15 | 16 | %patch1 -p0 |
| 17 | +%patch2 -p0 |
16 | 18 | |
17 | 19 | %build |
18 | 20 | |
— | — | @@ -28,6 +30,7 @@ |
29 | 31 | --includedir=%{_includedir} \ |
30 | 32 | --with-extra-charsets=all \ |
31 | 33 | --with-mysqld-user=mysql \ |
| 34 | + --with-mysqld-libs=-lmtmalloc \ |
32 | 35 | --with-zlib-dir=/usr \ |
33 | 36 | --with-big-tables \ |
34 | 37 | --with-ssl=/usr/sfw \ |