Tag Archives: sysevent

Fixing Nexenta Zones

Update: Some of the bugs in this post have been fixed, rendering a lot of the steps unnecessary. If you are running the latest version of Nexenta (3.0.1), you should only need to perform the last steps, where you dpkg-reconfigure sunwcsd and reimport the sysevent.xml file. See the new post for more details.

There is a nasty bug in Nexenta 3.0 that causes zones to function improperly. Services such as SSH are broken, packages may not install properly, etc. This is caused by a missing sysidtool, and a missing sysevent service. Two fix this problem, a few steps are required. First, in the global zone, you must edit /usr/bin/createzone and make the following changes:

1. Replace elatte-unstable with hardy-unstable. This should be found around line 41, in the default_config() subroutine.
2. Update the @source_files array as follows:

my @source_files = qw(
        /lib/svc/method/nexenta-sysidtool-system
        /var/svc/manifest/system/nexenta-sysidtool.xml
        /lib/svc/method/nexenta-sysidtool-net
        );

You are simply changing “elatte” to “nexenta” here.

Now, go through the normal zone creation process. If you don’t know how to do that, see here for a decent tutorial. The zone creation process should go off without a hitch, and sysidtool should install properly. Without our fixes, you would probably see an error that looks something like this.

There are still two more steps to be done. We must log in to the zone, but regular zlogin will not work until we fix another small bug. Boot the zone with “zoneadm -z yourZone boot”, then log in with “zlogin -S yourZone” instead of the normal zlogin. This will bring us to maintenance mode. Run pwconv:

zoneadm -z yourZone boot
zlogin -S yourZone

[In yourZone]
pwconv
exit

After this, regular zlogin should work. Now, we need to get the sysevent service working. Many services depend on this service. Without it, all of them will fail to start. To fix this, edit (from within the zone) the /lib/svc/method/svc-syseventd.

After the line . /lib/svc/share/smf_include.sh put
add [ `zonename` = global ] || sleep 3600 & exit 0

When finished, your zone’s /lib/svc/method/svc-syseventd file should look something like this. The bolded line is the one you added.

# CDDL Header
# ...

. /lib/svc/share/smf_include.sh
[ `zonename` = global ] || sleep 3600 & exit 0

case "$1" in
'start')
	/usr/lib/sysevent/syseventd >/dev/msglog 2>&1
	rc=$?
	if [ $rc -ne 0 ]; then
		echo "WARNING: /usr/lib/sysevent/syseventd failed: exit status $rc"
		exit $SMF_EXIT_ERR_FATAL
	fi
	;;

#
# devfsadmd and syseventconfd are started on-demand
# by syseventd. syseventd should be stopped before devfsadm and syseventconfd.
#
'stop')
	zone=`smf_zonename`
	/usr/bin/pkill -x -u 0 -P 1 -z $zone rcm_daemon
	/usr/bin/pkill -x -u 0 -P 1 -z $zone syseventd
	/usr/bin/pkill -x -u 0 -P 1 -z $zone devfsadm
	/usr/bin/pkill -x -u 0 -P 1 -z $zone syseventconfd

	#
	# Since pkill is not atomic (may miss forking processes), also
	# kill entire service contract.
	#
	smf_kill_contract $2 TERM 1
	[ $? -ne 0 ] && exit 1
	;;	

*)
	echo "Usage: $0 { start | stop }"
	exit 1
	;;

esac
exit 0

Finally, you will need to enter two more commands as the super-user:

dpkg-reconfigure sunwcsd
svccfg import /var/svc/manifest/system/sysevent.xml

Exit the zone and reboot it. Log in again, and everything should be magically working!

This information was compiled from several Nexenta bug reports (203, 173, LP #347937) after I ran into problems getting SSH working in my new zone. Apparently, the problems are bigger than SSH. I can’t take credit for discovering these fixes.