Skip to content

Instantly share code, notes, and snippets.

View bdha's full-sized avatar
☂️
ಠ_ಠ

Bryan Horstmann-Allen bdha

☂️
ಠ_ಠ
View GitHub Profile
[20090407-18:23:35]::[root@iapetus]:[~]$ /usr/pkg/bin/puppetd --verbose --logdest=syslog --test --server control.pobox.com --factsync
info: Loading fact zonename
info: Loading fact location
info: Loading fact hardware_platform
info: Retrieving facts
notice: /File[/var/puppet/facts]/checksum: checksum changed '{mtime}Mon Apr 06 04:30:29 -0400 2009' to '{mtime}Mon Apr 06 04:30:30 -0400 2009'
info: Loading fact zonename
info: Loading fact location
info: Loading fact hardware_platform
/usr/pkg/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27: command not found: /bin/zonename
--- /root/daemontools.rb.orig 2009-04-06 18:03:04.355682000 -0400
+++ daemontools.rb 2009-04-07 18:14:44.624793744 -0400
@@ -34,8 +34,7 @@
"""
- commands :svc => "/usr/bin/svc"
- commands :svstat => "/usr/bin/svstat"
+ commands :svc => "/usr/bin/svc", :svstat => "/usr/bin/svstat"
[20090408-18:03:31]:[shoal]:[bda@lab]:[~/Projects/pobox/mon/mon.d]$ cat fmdump.monitor
#!/icg/bin/perl
use strict;
use warnings;
use Sys::Hostname;
use IPC::Run qw/run new_chunker timeout/;
unless ( $^O eq "solaris" ) { exit 0; }
# This document describes updating the SmartOS boot_archive and /usr volumes.
#
# The boot_archive effectively contains /. If you want to make changes to SMF
# or so forth, you need to update the boot_archive.
#
# If you want to add things to /usr, such as drivers, you will need to update
# usr.lgz. It is compressed, so note the lofiadm -U and -C calls below. Once
# you have updated usr.lgz you will need to copy it back to the mounted
# boot_arhive.
#
# Determine which init system we're using and load daemontools for it.
init_system = File.readlink("/proc/1/exe")
case init_system
when /upstart/
log "Using upstart"
cookbook_file "/etc/init/svscanboot.conf" do
source "upstart.svc"
owner "root"
group "root"
# This document describes updating the SmartOS boot_archive and /usr volumes.
#
# The boot_archive effectively contains /. If you want to make changes to SMF
# or so forth, you need to update the boot_archive.
#
# If you want to add things to /usr, such as drivers, you will need to update
# usr.lgz. It is compressed, so note the lofiadm -U and -C calls below. Once
# you have updated usr.lgz you will need to copy it back to the mounted
# boot_arhive.
#
# Grab any zfs data from "zfs get"
#zfs = Mash.new
#popen4("zfs get -p -H all") do |pid, stdin, stdout, stderr|
# stdin.close
# stdout.each do |line|
# next unless (line =~ /^([^\t]+)\t([^\t]+)\t([^\t]+)\t([^\t]+)$/)
# filesystem = $1
# zfs[filesystem] = Mash.new unless zfs.has_key?(filesystem)
# zfs[filesystem][:values] = Mash.new unless zfs[filesystem].has_key?('values')
# zfs[filesystem][:sources] = Mash.new unless zfs[filesystem].has_key?('sources')
#!/bin/bash
if ! [ $3 ] ; then
echo "$0 <SOURCE POOL/DATASET> <TARGET_HOST> <TARGET POOL/DATASET>"
exit 1
fi
SRC=$1
TARGET_HOST=$2
DST=$3
[root@00-0c-29-a1-8b-9d ~]# cat /etc/motd
- SmartOS Live Image v0.147+ build: 20120113T013514Z
[root@00-0c-29-a1-8b-9d ~]# uname -a
SunOS 00-0c-29-a1-8b-9d 5.11 joyent_20120113T013514Z i86pc i386 i86pc
[root@00-0c-29-a1-8b-9d ~]# zlogin test1
[Connected to zone 'test1' pts/3]
Last login: Tue Jan 24 04:03:39 on pts/3
OpenIndiana (powered by illumos) SunOS 5.11 oi_151a September 2011
root@test1:~# cat /etc/release
OpenIndiana Development oi_151a X86
{
"hostname": "test1",
"alias": "test1",
"brand": "ipkg",
"autoboot": "true",
"default_gateway": "10.0.1.1",
"dns_domain": "local",
"dataset_uuid": "templates/oi-151a",
"nics": [
{