Some tweaks to get SmartOS happy, plus getting init script up to date

*from* upstream, that is.