Показаны сообщения с ярлыком Solaris. Показать все сообщения
Показаны сообщения с ярлыком Solaris. Показать все сообщения

вторник, 22 декабря 2015 г.

Bye-bye, sysidtool, hello sysding

Often you want to have some simple tool to configure basic system settings after installation, such as ip settings, time zone settings, locales and so on. More important, installer also sometimes needs similar utility, which would run on first boot and initialize basic system parameters. For example, OmniOS runs /.initialboot script on the first boot. Solaris historically had sysidtool service, which read /etc/sysidcfg file and used it to configure zones or base system. Sysidtool also had ncurses-based interface to perform basic zone configuration.
The disadvantage of sysidtool is that it is a closed source tool, and you cannot fix it if you want it to do a bit more. So, we switched to sysding in OpenIndiana Hipster.
Sysding was originally written by Olaf Bohlen (Agnar at #oi-dev) to configure multiple illumos/Solaris zones. It doesn't have interactive interface, but has a set of utility functions to write configuration scripts. File /etc/sysding.conf is a simple ksh script, sourced by /lib/svc/method/sysding on . /lib/svc/method/sysding predefines some useful functions which can be necessary for initial configuration. Sample configuration file can look like
setup_timezone Europe/Moscow
setup_locale en_US.UTF-8
setup_user_password root '$5$+Fu+utqXFqU=$RD2LbFipqwKc2srNFYnVkda9U6K2pmMajvuR3iyHzR'
setup_interface PRIMARY v4 192.168.1.4/24
setup_route default 192.168.1.1
setup_ns_dns "stud.lan" "stud.lan notebook.lan" "8.8.8.8"

Using it, sysding will set timezone, locale, root password, network settings on first boot and reboot zone (or NGZ), because /etc/default/init was changed. It also cares about setting root password to 'NP' at first boot in zone if it's empty and you haven't specified one. Without this you wouldn't be able to "zlogin" to the zone. It can do a bit more. If you are interested, look at /lib/svc/method/sysding . If you want to have some customizations for your environment, create pull requests against https://github.com/OpenIndiana/sysding/, but don't forget two things: test your changes thoroughly and keep in mind that sysding was created to be a simple configuration tool.

пятница, 8 ноября 2013 г.

beadm destroy error

Today when I was trying to destroy old boot environment, I got strange error:
# beadm destroy oi-hipster-2013-08-06
Are you sure you want to destroy oi-hipster-2013-08-06?
This action cannot be undone (y/[n]): y
be_destroy_callback: failed to destroy data/zones/build/ROOT/zbe: dataset is busy
be_destroy: failed to destroy BE data/zones/build/ROOT/zbe
be_destroy_zone_root_callback: failed to destroy zone root data/zones/build/ROOT/zbe
be_destroy_zone_roots: failed to destroy zone roots under zonepath dataset data/zones/build: dataset is busy
be_destroy_zones: failed to find and destroy zone roots for zone build
be_destroy: failed to destroy one or more zones for BE oi-hipster-2013-08-06
I didn't want to destroy zone root FS accidentally, so was a bit scared. However, after looking at it a bit longer, I found out, that zone root FS has several manual ZFS snapshots. After destroying snapshots I was able to destroy BE.

четверг, 23 мая 2013 г.

elfdump -a in Solaris

Solaris userland is rather specific... A lot of utilities misses convenient options from GNU/BSD analogs. E.g., we don't have "elfdump -a" here... As always, a bit of scripting solves this problem:
elfdump -c /bin/ls |grep Header |awk ' { print $4; }'  |xargs -n 1 -I '{}' elfdump -N '{}' /bin/ls 

пятница, 18 марта 2011 г.

Normal ping in Solaris

I always disliked default behavior of Solaris ping:

me@host$ ping example.org
example.org is alive

Luckily, ping has "-s" parameter.

me@host$ ping -s example.org
PING example.org: 56 data bytes
64 bytes from example.org (192.168.1.1): icmp_seq=0. time=0.214 ms
64 bytes from example.org (192.168.1.1): icmp_seq=1. time=0.317 ms
64 bytes from example.org (192.168.1.1): icmp_seq=2. time=0.222 ms
64 bytes from example.org (192.168.1.1): icmp_seq=3. time=0.202 ms
^C
----example.org PING Statistics----
4 packets transmitted, 4 packets received, 0% packet loss
round-trip (ms) min/avg/max/stddev = 0.202/0.239/0.317/0.053


Less known feature is MACHINE_THAT_GOES_PING environment variable, available at least in all recent OpenSolaris versions and derivatives. When it set, '-s' key is set by default.

me@host$ export MACHINE_THAT_GOES_PING=1
me@host$ ping example.org
PING example.org: 56 data bytes
64 bytes from example.org (192.168.1.1): icmp_seq=0. time=0.218 ms
64 bytes from example.org (192.168.1.1): icmp_seq=1. time=0.218 ms
64 bytes from example.org (192.168.1.1): icmp_seq=2. time=0.193 ms
^C
----example.org PING Statistics----
3 packets transmitted, 3 packets received, 0% packet loss
round-trip (ms) min/avg/max/stddev = 0.193/0.210/0.218/0.014


Now I'm going to add this variable to my .profile :)

пятница, 13 августа 2010 г.

Why I'm going to read Oracle course in university... on PostgreSQL

I used to like Oracle. They gave us one of the best DBMS. They made a lot of work on promoting Linux. They used a lot of open source software in their products and promoted Java...
But their greed is unnatural. It is more than Microsoft's greed.
1) Their DBMS costs too much. When our university tried to prolong their support, they said taht we had to pay taxes... because we hadn't done this earlier.
2) They don't allow to use their products in education for free. Even MS Academy program is free for our University.
3) They have done everything to kill Sun OpenSolaris. Damn them!
4) They prohibited to use Sun Solaris for free.
5) And now they are suing Google for using Java technologies in Android.
IMHO, this company is crazy and ill on immediate profit. It doesn't matter to them that their steps only makes potential customers nervous. What is next? Will they sue Apache or SpringSource for developing Java-related products or FreeBSD for using ZFS?
No, thanks. I will not promote their products at our campus.
FreeBSD and PostgreSQL is a real base for DBMS server, not Solaris and one overpriced DBMS...

понедельник, 2 августа 2010 г.

Gnome OS sounds frightening

The first my though about Gnome OS (Looking at Gnome as operating system, http://www.omgubuntu.co.uk/2010/08/proposal-to-make-gnome-fully-fledged-os.html) was doubt about what does it mean. When people see Linux as "implementation detail", does it mean that Gnome would be more or less Linux-oriented? I fear that this simply means further ignoring other OS. For example, you have to apply about 800 patches to build Gnome on Solaris (and there it is the main desktop environment). Unpatched Gnome can't be build on FreeBSD. Further Linux orientation doesn't bring anything good for other OS. We already have many Linux crutches like policykit (why is it necessary, for example, on Solaris, where we have good RBAC) and hal (the only thing this monster created by Linux community doesn't do is cooking coffee for you) and I don't like this trend...
Let's remember, Linux is common Unix-like environment, but not the single one...