Migrating to OpenIndiana

I recently had a bunch of problems running ZFS on Ubuntu, and so since that is the FS I’ve decided on using for the foreseeable future, I wanted to move to something FOSS that was actually built to use it. I decided to go with OpenSolaris, and then found that that has been Oracled, and now there is OpenIndiana. There’s a few things that I really like about OI, but a lot of minor gripes.

tl:dr

SMB is just plain not as easy due to extended ACLs and permissions not appearing as they are at points. OpenIndiana also makes you do a lot more yourself, and forces you to be a lot more explicit/pedantic than Ubuntu does. I’m actually coming to like this more than Ubuntu’s forgiving manner, mostly due to now actually having to garner a full understanding of the command. I doubt this is specific to OI, but my Debian, Gentoo and Ubuntu days have led me to be apparently sloppy on the command line.

However, lots of things one would assume would be done automatically at setup, aren’t. Executing .bashrc at login for example, needs to be configured after the fact. It’s simple, adding a line telling OI to execute it in your .profile file:

if [ -f ~/.bashrc ]; then . ~/.bashrc; fi

Another example is user additions. Home directories are actually stored in /export/home/ and are only mounted when the user is logged in. So, if you forget to create the home directory, which I did, you may find it easier to delete and recreate the user and directory than you would fucking around to get the directory created and running properly.

Speaking of bash, I decided that I generally have too many terminal windows open at any given point, and identifying which is which from the window previews of them is hard, so I’m going to colour code them.

So, my normal bash prompt for my OI server is:

PS1='[e[1;33m]${LOGNAME}@:$HOSTNAME:$(
 [[ "${LOGNAME}" == "root" ]] && printf "%s" "${PWD/${HOME}/~}n# " ||
 printf "%s" "${PWD/${HOME}/~}n$ ")[e[1;0m]'

EDITOR=nano
alias nanp=nano
alias locate=slocate
unset color_prompt force_color_prompt

And when I get tired of sudo’ing every command I’m running when doing a bunch of admin shit, I have all output set to red so that I see that it’s running elevated:

PS1='[e[1;33m]e[41m${LOGNAME}@$HOSTNAME:[e[40m]$(
 [[ "${LOGNAME}" == "root" ]] && printf "%s" "${PWD/${HOME}/~}n#[e[0m] " ||
 printf "%s" "${PWD/${HOME}/~}n$ ")[e[1;31m]'

EDITOR=nano
alias nanp=nano
alias locate=slocate

To those shaking their heads at defaulting the editor to nano instead of the infinitely more awesome and so much more powerful and Robbie why don’t you use option of vi(m) or emacs or a butterfly, it’s a basic text editor I need; not an IDE or scripting environment. If I need an IDE or something to half write my scripts for me, I’ll use vi. But for editing conf files, nano is quick and gets me in and out without a headache.

Getting better network performance was a matter of getting my NICs to use a bigger MTU, since all my switches deal well with jumbo frames, this was doable. That was just editing the appropriate .conf file in /kernel/drv/ and finding the max MTU option. Set it, then reboot and setting the MTU via ifconfig <int> mtu <mtu> works without giving the Invalid argument response.

Getting rsync working as a daemon was simple, follow this link. However, it went into maintenance mode. Checking the logs by doing:

cat /var/svc/log/network-rsyncd:default.log

Which showed why:

[ Jan 14 04:21:52 Enabled. ]
[ Jan 14 04:21:52 Executing start method ("/lib/svc/method/rsyncd start"). ]
 /sbin/sh[1]: exec: /lib/svc/method/rsyncd: cannot execute
[Permission denied]
[ Jan 14 04:21:52 Method "start" exited with status 126. ]

The file “/lib/svc/method/rsyncd” doesn’t have execute set, so just do that, then disable and reenable, should be online. It’s little things like this that are still a frustrating part of manual program installation, and I’m really happy there seems to be a sensible package management system for OI.

The community also seems to be very helpful and quick to respond, without the stereotypical condescension of most smaller open source projects. Looking forward to posting more about it.