20080915

primary label corrupt

During the ZFS testing process I've used dd command to erase the disk fragment with /dev/urandom (testing the ability of raidz crash handling). After resilvering there was still information on my console and dmesg log:

Sep 15 07:42:00 thumper scsi: [ID 107833 kern.warning] WARNING: /pci@0,0/pci1022,7458@1/pci11ab,11ab@1/disk@0,0 (sd2):
Sep 15 07:42:00 thumper primary label corrupt; using backup


I've resolved this with a format command.
It could be done in the following way.

thumper [/]# format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
0. c0t0d0
/pci@0,0/pci1022,7458@1/pci11ab,11ab@1/disk@0,0
[...]

Specify disk (enter its number): 0
selecting c0t0d0
[disk formatted]
Reading the primary EFI GPT label failed. Using backup label.
Use the 'backup' command to restore the primary label.

format> backup
Restoring primary label.
format> label
Ready to label disk, continue? y

format> quit

20080704

init_htent: error parsing IP address for host


# imsimta run tcp_intranet
init_htent: error parsing IP address for host #1


You have to check your /etc/inet/hosts entries.
At the first line (#1), ignoring the comment lines, there was IPv6 entry for localhost.

::1 localhost


After removal the problem has gone.

20080630

oneliner

I use sed delete negation to remove lines that do not match the pattern.
In the following example I want to delete the improper ssh-key entries from an authorized_keys file.
Ex.

sed -e '/^environment.*USER.*/!d' .ssh/authorized_keys

I do not allow usage of ssh session without set USER environment variable.

20080627

Registering Solaris System from the command line


bladerunner [/usr/lib/breg/data]# cp RegistrationProfile.properties /tmp/
bladerunner [/usr/lib/breg/data]# cd /tmp
bladerunner [/tmp]# vim RegistrationProfile.properties
[...]
#
# Sun Online account information. A new account can be created by visiting
# http://updates.sun.com
#
userName=wisnios
password=MySunOnlinePassword

#
# Name (label) of this machine as you would like it to appear on the Sun Connection
# portal. If left blank hostname will be used
#
hostName=bladerunner

[...]
:wq

bladerunner [/tmp]# /usr/sbin/sconadm register -a -r /tmp/RegistrationProfile.properties
sconadm is running
Authenticating user ...
finish registration!

20080626

How to determine the Sun Java System Directory Server version

Ex.

# /opt/SUNWdsee/ds6/lib/ns-slapd -v
Sun Microsystems, Inc.
Sun-Java(tm)-System-Directory/6.0 B2007.025.1834 32-bit
[...]


ver. 6.0

It could also be accomplished by:

# dsadm --version
[dsadm]
dsadm : 6.0 B2007.025.1834

[slapd 32-bit]
Sun Microsystems, Inc.
Sun-Java(tm)-System-Directory/6.0 B2007.025.1834 32-bit
ns-slapd : 6.0 B2007.025.1834
Slapd Library : 6.0 B2007.025.1834
Front-End Library : 6.0 B2007.025.1834

[slapd 64-bit]
Sun Microsystems, Inc.
Sun-Java(tm)-System-Directory/6.0 B2007.025.1834 64-bit
ns-slapd : 6.0 B2007.025.1834
Slapd Library : 6.0 B2007.025.1834
Front-End Library : 6.0 B2007.025.1834

20080522

Call to undefined function pg_connect()

When using coolstack and trying to connect to postgresql database from php script the following error appear:

Call to undefined function pg_connect() in somescript.php on line XX

The reason is default php configuration; php.ini doesn't know anything about postgresql extension, only mysql (finally, it's Solaris AMP - Apache MySQL PHP). To resolve the undesirable behaviour add:

extension="pgsql.so"

to php.ini configuration.


Cool Stack 1.2
Default file location:
/opt/coolstack/php5/lib/php.ini
/opt/coolstack/php5/lib/php/extensions/no-debug-non-zts-20060613/pgsql.so

20080504

ZFS dataset inside a non-global zone

To achieve the usage of global ZFS dataset inside a non-global zone you have to set the zoned attribute to on. It could be done during the dataset creation (zfs create -o zoned=on DATASET) or after the creation process:

zfs set zoned=on DATASET


Without this option the zone startup process will fail, ex.

sunflower [/]# zoneadm -z samba boot
zoneadm: zone 'samba': These file-systems are mounted on subdirectories of /export/zones/samba/root:
zoneadm: zone 'samba': /export/zones/samba/root/export/vol1
zoneadm: zone 'samba': call to zoneadmd failed