Permalink
Browse files

Merge git.joyent.com:illumos-live

  • Loading branch information...
2 parents 30ced6c + 2bbea55 commit 50fb1d245e135b3f20fb7007d68812007878b060 @JohnSonnenschein JohnSonnenschein committed May 17, 2012
View
@@ -86,8 +86,7 @@ echo "==> Checking for /opt/gcc/4.4.4/bin/gcc"
if [ ! -f "/opt/gcc/4.4.4/bin/gcc" ]; then
if [ ! -z "${GCC44_URL}" ]; then
cd /opt
- curl -k https://download.joyent.com/pub/build/gcc-4.tar.bz2 | bzcat \
- | ${ROOTCMD} tar -xf -
+ curl -k ${GCC44_URL} | bzcat | ${ROOTCMD} tar -xf -
cd - >/dev/null
else
echo "FATAL: unable to download gcc 4.4.4, no URL is set. Please set GCC44_URL in configure."
@@ -1,6 +1,6 @@
-## Rotate and trim the audit logs nightly at midnight.
+## Rotate and trim the audit logs nightly.
0 0 * * * /smartdc/bin/sdc-lastcomm -R 30
-## Rotate and trim the regular logs nightly at 10 after midnight.
+## Rotate and trim the regular logs nightly.
10 0 * * * /usr/sbin/logadm
# NOTE: all entries above are in root's system-defined crontab; see the
@@ -19,6 +19,7 @@
# CDDL HEADER END
#
# Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2012, Joyent, Inc. All rights reserved.
#
# logadm.conf
#
@@ -35,8 +36,8 @@
# logadm typically runs early every morning via an entry in
# root's crontab (see crontab(1)).
#
-/var/log/syslog -C 8 -a 'kill -HUP `cat /var/run/syslog.pid`'
-/var/adm/messages -C 4 -a 'kill -HUP `cat /var/run/syslog.pid`'
+/var/log/syslog -C 8 -a 'kill -HUP `cat /var/run/*syslog*.pid`'
+/var/adm/messages -C 4 -a 'kill -HUP `cat /var/run/*syslog*.pid`'
/var/cron/log -c -s 512k -t /var/cron/olog
/var/lp/logs/lpsched -C 2 -N -t '$file.$N'
/var/fm/fmd/errlog -N -s 2m -M '/usr/sbin/fmadm -q rotate errlog && mv /var/fm/fmd/errlog.0- $nfile'
@@ -0,0 +1,80 @@
+#!/sbin/sh
+#
+# CDDL HEADER START
+#
+# The contents of this file are subject to the terms of the
+# Common Development and Distribution License (the "License").
+# You may not use this file except in compliance with the License.
+#
+# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+# or http://www.opensolaris.org/os/licensing.
+# See the License for the specific language governing permissions
+# and limitations under the License.
+#
+# When distributing Covered Code, include this CDDL HEADER in each
+# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+# If applicable, add the following below this CDDL HEADER, with the
+# fields enclosed by brackets "[]" replaced with your own identifying
+# information: Portions Copyright [yyyy] [name of copyright owner]
+#
+# CDDL HEADER END
+#
+#
+# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+# Use is subject to license terms.
+# Copyright 2012 Joyent, Inc. All rights reserved.
+#
+# Start method script for the cron service.
+#
+
+. /lib/svc/share/smf_include.sh
+
+if [ -p /etc/cron.d/FIFO ]; then
+ if /usr/bin/pgrep -x -u 0 -z `smf_zonename` cron >/dev/null 2>&1; then
+ echo "$0: cron is already running"
+ exit $SMF_EXIT_ERR_NOSMF
+ fi
+fi
+
+if smf_is_globalzone && [ -n "$(bootparams | grep '^headnode=true')" ]; then
+ #
+ # Randomize root's crontab so all HN's are not in sync.
+ #
+ utc_offset=`nawk -F= '{if ($1 == "utc_offset") print $2}' \
+ /usbkey/config.inc/generic`
+ [ -z "$utc_offset" ] && utc_offset=0
+
+ n=$(date +%S)
+ hr=$(($n % 5))
+ hr=$(($hr + $utc_offset))
+
+ n=$(date +%M)
+ mn=$(($n % 15))
+
+ nawk -v hr=$hr -v mn=$mn '{
+ if (substr($1, 1, 1) == "#") {
+ print $0
+ next
+ }
+ if (length($0) == 0) {
+ print $0
+ next
+ }
+
+ printf("%d %d %s %s %s %s", mn, hr, $3, $4, $5, $6)
+ for (i = 7; i <= NF; i++)
+ printf(" %s", $i)
+ printf("\n")
+ mn += 10
+ }' /etc/cron.d/crontabs/root >/etc/cron.d/crontabs/root.$$
+ cp /etc/cron.d/crontabs/root.$$ /etc/cron.d/crontabs/root
+ rm -f /etc/cron.d/crontabs/root.$$
+fi
+
+if [ -x /usr/sbin/cron ]; then
+ /usr/bin/rm -f /etc/cron.d/FIFO
+ /usr/sbin/cron &
+else
+ exit 1
+fi
+exit $SMF_EXIT_OK
@@ -56,7 +56,6 @@
# network/nfs/cbd.xml
# network/nfs/mapid.xml
# network/nfs/status.xml
-# network/smb/client.xml
# network/ipmievd.xml
# network/nis/client.xml
# network/rpc/rex.xml
@@ -66,7 +65,6 @@
# system/fm/notify-params.xml
# system/install/system-config.xml
# system/pkgserv.xml
-# system/sac.xml
#
#
@@ -80,6 +78,8 @@
# system/boot-archive-update.xml
# system/boot-archive.xml
# system/boot-config.xml
+# system/fmd.xml
+# system/sac.xml
#
#
@@ -102,12 +102,13 @@ network/dns/install.xml disabled
network/dns/multicast.xml disabled
network/forwarding.xml disabled
network/inetd-upgrade.xml enabled
-network/inetd.xml enabled
+network/inetd.xml disabled
network/ipfilter.xml disabled
network/ipsec/ike.xml disabled
network/ipsec/ipsecalgs.xml enabled
network/ipsec/manual-key.xml disabled
network/ipsec/policy.xml enabled
+network/loadbalancer/ilbd.xml disabled
network/login.xml enabled
network/network-initial.xml enabled
network/network-install.xml disabled
@@ -128,14 +129,15 @@ network/routing/rdisc.xml disabled
network/routing/ripng.xml disabled
network/routing/route.xml disabled
network/rpc/bind.xml enabled
+network/smb/client.xml disabled
network/shares/group.xml enabled
network/shares/reparsed.xml disabled
network/shell.xml disabled
network/slp.xml disabled
network/ssh.xml enabled
system/auditd.xml disabled
system/consadm.xml disabled
-system/console-login.xml enabled
+system/console-login.xml disabled
system/coreadm.xml enabled
system/cron.xml enabled
system/cryptosvc.xml enabled
@@ -150,7 +152,6 @@ system/filesystem/local-fs.xml enabled
system/filesystem/minimal-fs.xml enabled
system/filesystem/root-fs.xml enabled
system/filesystem/usr-fs.xml enabled
-system/fmd.xml enabled
system/hostid.xml enabled
system/hotplug.xml disabled
system/identity.xml enabled
View
@@ -45,6 +45,7 @@ install: $(TARGETS) sysinfo
cp vm/smf/system-metadata.xml $(DESTDIR)/lib/svc/manifest/system/system-metadata.xml
mv $(DESTDIR)/usr/vm/sbin/vmadmd.js $(DESTDIR)/usr/vm/sbin/vmadmd
mv $(DESTDIR)/usr/vm/sbin/vmadm.js $(DESTDIR)/usr/vm/sbin/vmadm
+ mv $(DESTDIR)/usr/vm/sbin/build-user-script.js $(DESTDIR)/usr/vm/sbin/build-user-script
mv $(DESTDIR)/usr/vm/sbin/metadata.js $(DESTDIR)/usr/vm/sbin/metadata
cp -PR ds $(DESTDIR)/usr/
mkdir -m 0755 -p $(DESTDIR)/var/db/dsadm
View
@@ -29,6 +29,7 @@ d usr/vm/node_modules 0555 root bin
d usr/vm/sbin 0555 root bin
d usr/vm/smf 0555 root bin
d usr/vm/test 0555 root bin
+f usr/vm/sbin/build-user-script 0555 root bin
f usr/vm/sbin/vmadm 0555 root bin
f usr/vm/sbin/vmadmd 0555 root bin
f usr/vm/sbin/zoneevent 0555 root bin
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,35 @@
+#!/usr/bin/node
+/*
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
+ *
+ * This tool takes a filename as the only parameter and generates an update
+ * payload for use with vmadm that turns the specified file into the
+ * user-script for the VM.
+ *
+ * For example:
+ *
+ * build-user-script /path/to/script.sh | vmadm update <UUID>
+ *
+ */
+
+var fs=require('fs');
+
+function usage ()
+{
+ console.log('Usage: ' + process.argv[1] + ' <filename>');
+ process.exit(1);
+}
+
+if (!process.argv[2]) {
+ usage();
+} else {
+ fs.readFile(process.argv[2], function (error, data) {
+ var payload = {};
+ if (error) {
+ console.error(error.message);
+ process.exit(1);
+ }
+ payload.set_customer_metadata = {'user-script': data.toString()};
+ console.log(JSON.stringify(payload, null, 2));
+ });
+}
Oops, something went wrong.

0 comments on commit 50fb1d2

Please sign in to comment.