Home Home > Systems-management
Sign up | Login

Deprecation notice: openSUSE Lizards user blog platform is deprecated, and will remain read only for the time being. Learn more...

Archive for the ‘Systems Management’ Category

Install Multiple Kernel Versions using the YaST Qt Package Manager

December 8th, 2009 by

You might want to install multiple kernel versions on your system.
The YaST Qt Package Selector provides a nice user interface that allows to manage multiple package versions now.

yast2-qt-pkg 2.18.19 or later supports this feature. You can find packages in my Build Service repository.

First of all you need to tell libzypp that your kernel is a package which is multiversion-enabled by adding this line to your /etc/zypp/zypp.conf:

multiversion = provides:multiversion(kernel)

Start your YaST Software Management. The versions tab shows check boxes for multiversion packages instead of radio buttons.
This enables you to install multiple versions of the same package.

There is also a package group of multiversion packages that list all packages that can be installed in multiple versions.

YaST Qt Package Manager with Multiversion Kernel Packages

Updating in Place From openSUSE 11.1 to 11.2

October 1st, 2009 by

After running my laptop for some time already on openSUSE Factory, I decided to update my workstation now as well to openSUSE Factory – thus upgrading it to openSUSE 11.2 Milestone 8.

Instead of the “old” but still working way of burning a media, booting from it and upgrading my system, I did the “new” way of openSUSE 11.2: Updating in place with “zypper dup”.

(more…)

openSUSE@ARM: GSoC status and final spurt

August 12th, 2009 by

I was buried with work in the last couple of days, so whats new on my GSoC-project:

  • a lot of patches went into factory and some more are queued
  • fixed issues with qemu
  • most yast packages already building
  • zypper builds, but requires some more bugfixing
  • X11 builds
  • cross-compilation stable, speed is good

Todo:

  • create image (bootable to console)
  • create image (bootable to x11 on beagleboard)
  • evaluate switch in webfrontend for cross-feature
  • project documentation/GSoC

28 Partitions on a Single Disk? No Problem!

August 5th, 2009 by

So far it was only possible to have upto 16 device nodes for a single disks. This restricted the number of usable partitions. As a workaround kpartx could be used to create device mapper mappings for further partitions but that was never fully integrated in openSUSE.

With version 2.6.28 the kernel supports upto 256 device nodes per disk, much more than the partition table allows. But since the implementation is not straightforward, the additional device nodes are assigned dynamically, user-space programs may need to be adapted.

For openSUSE 11.2 Milestone 5 YaST was extended to support this new kernel feature.

Some quick tests showed only problems with LVM. If you are interested in this feature and have the possibility please give it a try so that we find remaining bugs.

Introducing Libstorage

July 20th, 2009 by

Libstorage is a C++ library for managing Linux storage devices. So far it was developed as part of YaST but since a few weeks it is an independent project.

Here is a code example creating a 1GB partition on /dev/sdb.

  Environment env(false);
  StorageInterface* s = createStorageInterface(env);

  string name;

  // Create 1GB partition on /dev/sdb and format it with Ext4.
  s->createPartitionAny("/dev/sdb", 1048576, name);
  s->changeFormatVolume(name, true, EXT4);

  // Set mount-point to "/home" and fstab option to "relatime".
  s->changeMountPoint(name, "/home");
  s->changeFstabOptions(name, "relatime");

  // Set filesystem label to "HOME" and mount filesystem by label.
  s->changeLabelVolume(name, "HOME");
  s->changeMountBy(name, MOUNTBY_LABEL);

  // Commit the change to the system. This will create the partition,
  // format and mount it and update /etc/fstab.
  s->commit();

  destroyStorageInterface(s);

Besides of hard-disks libstorage handles RAID, LVM, NFS, various filesystems and encryption. Swig generated Python bindings are also provided. Libstorage has no dependencies on YaST, neither for building nor runtime. We hope libstorage will also be useful for other projects.

More information is available in the openSUSE Wiki, including a list of useful features people would love to see implemented in the near future.

Comments are as always welcome.

Installation: Resizing Windows before proposing Linux partitions

June 25th, 2009 by

While “selling” openSUSE to a friend of mine, I tried to explain him all the steps of the installation and all the configuration options which I had changed. He was not any geek and it was his first time seeing Linux.

While most of the installation did not need much explanations, I definitely spent most of the time on partitioning. Not that initial proposal was not fine, unless one has special requirements, but there is one elementar input, which even newbies may want to set: How to split disk between Windows and Linux. The installation proposal works just fine, but if one needs to keep more or less space for Windows than proposed and does not have any skills, he is doomed – and so would have been he.

(more…)

Sending Proxy Settings via DHCP

June 3rd, 2009 by

It’s a bit “overdressed” for my little homenet, but playing around with DHCP, DNS and YaST is always interesting….

My DHCP Server at home is configured to use LDAP – and I’ve done the configuration via YaST. Now I read in some M$ pages, that it’s possible to tell the Clients via DHCP (and Apache) to use my Proxy server automatically. (Yes, my wife still needs Win** for her schoolwork.)

First, I had to figure out how I can insert two “non standard” options into the LDAP configuration of the DHCP server. I called “yast2 dhcp-server” (thanks for the tab completion, btw!), marked the “Global Options” entry and clicked on “Edit” (not Add!). On the next page, click on “Add” to add a new Option. Just delete the first available entry “allow” and replace it with the full line as you would write it in dhcpd.conf. In my case, this is
option wpad code 252 = text;
and
option wpad “http://myserver/proxy.pac\n”;
(dunno if the “\n” is really needed). That’s the trick. Have a look at /var/log/messages in a separate terminal when you finish the yast2 dhcp-server module to catch possible errors.

Now all what’s left is a running apache server on “myserver” delivering the “proxy.pac” file to your users. The file content is well known – and google would find hundreds of examples for you.

Ruby on rails, Ajax and memory watching

May 14th, 2009 by

As work on webinterface for YaST is in progress we must learn new technologies suitable for web development. WebYast will be written in ruby and ruby on rails framework. Also because WebYast is new interface it could contain AJAX features for better user comfort. Today I found that ajax support in RoR is on good level and with documentation it takes few minutes to create first example which show current used memory on server. It is not connected anyhow to YaST because I want to focus on AJAX.
And here is a code. It update page every fifth second (but not refresh only update div, on bigger page it is really significant):
/views/home/index.html.erb:
<%= javascript_include_tag :defaults %>
<h1>Hello world!</h1>
<%= periodically_call_remote(:url => { :action => 'get_averages' }, :update => 'avg',:frequency => '5') %>
<div id="avg">
Memory usage is X MB </div>
controllers/home_controller.rb:
class HomeController < ApplicationController
   def index
   end
   def get_averages
     output = `free -m` # bash solution - | sed 's/Mem:[^0-9]+[0-9]+[^0-9]+([0-9]+).*$/1/;2q;1d'`
     output = $1 if (output =~ /.*n(.*)n.*n.*n/) #let live second line
     output = $1 if (output =~ /.*:s+S+s+(S+)s+/) #second field
     render :text => "Usage mem is "+output+"MB RAM."
   end
end

And thats all to watch your server usage.

User readable logging of YaST modules

April 6th, 2009 by

For quite some time, we had user requests (fate #100386) to provide the logging that would be readable to users (= not only YaST developers). Such logs should provide the information what certain YaST action is really doing to the system and exclude all the internal debug info our y2logs are full of.

Martin and Stano created some concept and added new logging functions y2usernote and y2useritem. These log to the new log file, /var/log/YaST2/y2changes (or $HOME/.y2changes).

The question which is still not resolved is how should we use these functions? Which events our modules produce should provide description as “note” and which should provide “items”? What level of complexity should be presented to user? Should we log the real actions, just like commands passed to system agent or rather the explanations of the actions taken? Or both?

Let’s go to the example. The changes are already in FACTORY version of yast2-users packages (yast2-perl-bindings needed as well), so you may even try yourself.

At first, I started logging actions done in Write function. I deleted one user and renamed another. See:

2009-02-05 15:15:55 <item> rivendell User and Group Management module started
2009-02-05 15:16:12 <note> rivendell File written: ‘/etc/group’
2009-02-05 15:16:12 <note> rivendell User pre-deletion script called: ‘/usr/sbin/userdel-pre.local cc 1003 100 /local/home/cc’
2009-02-05 15:16:12 <note> rivendell File written: ‘/etc/passwd’
2009-02-05 15:16:12 <note> rivendell User ‘aa’ renamed to ‘bb’
2009-02-05 15:16:12 <note> rivendell Home directory moved: ‘/bin/mv /local/home/aa /local/home/bb’
2009-02-05 15:16:12 <note> rivendell File written: ‘/etc/shadow’
2009-02-05 15:16:12 <note> rivendell nscd cache invalidated: ‘/usr/sbin/nscd -i passwd’
2009-02-05 15:16:12 <note> rivendell nscd cache invalidated: ‘/usr/sbin/nscd -i group’
2009-02-05 15:16:12 <note> rivendell Group ‘dialout’ modified
2009-02-05 15:16:12 <note> rivendell Group ‘video’ modified
2009-02-05 15:16:12 <note> rivendell Home directory removed: ‘/bin/rm -rf /local/home/cc’
2009-02-05 15:16:12 <note> rivendell User post-deletion script called: ‘/usr/sbin/userdel-post.local cc 1003 100 /local/home/cc’
2009-02-05 15:16:13 <item> rivendell User and Group Management module finished

Now, it is not bad, but the item “File written: ‘/etc/group'” doesn’t give much detailed info about what was done to that file. Stano proposed printing the diffs of the original and modified one, it could look this way:

2009-02-09 10:05:50 <item> rivendell User and Group Management module started
2009-02-09 11:05:49 <note> rivendell Backup created: ‘/bin/cp /etc/group /etc/group.YaST2save’
2009-02-09 11:05:49 <note> rivendell File written: ‘/etc/group’
2009-02-09 11:05:49 <note> rivendell Comparing original and new version:
— /etc/group.YaST2save    2009-02-09 11:05:49.000000000 +0100
+++ /etc/group    2009-02-09 11:05:49.000000000 +0100
@@ -8,3 +8,3 @@
daemon:x:2:
-dialout:x:16:bb,hh,linux,zz
+dialout:x:16:aa,hh,linux
disk:x:6:
@@ -45,3 +45,3 @@
vboxusers:!:113:jsuchome
-video:x:33:bb,hh,linux,zz
+video:x:33:aa,hh,linux
wheel:x:10:
`
2009-02-09 11:05:49 <note> rivendell User pre-deletion script called: ‘/usr/sbin/userdel-pre.local zz 1003 100 /local/home/zz’
2009-02-09 11:05:49 <note> rivendell Backup created: ‘/bin/cp /etc/passwd /etc/passwd.YaST2save’
2009-02-09 11:05:49 <note> rivendell File written: ‘/etc/passwd’
2009-02-09 11:05:49 <note> rivendell Comparing original and new version:
— /etc/passwd.YaST2save    2009-02-09 11:05:49.000000000 +0100
+++ /etc/passwd    2009-02-09 11:05:49.000000000 +0100
@@ -28,6 +28,5 @@
wwwrun:x:30:8:WWW daemon apache:/var/lib/wwwrun:/bin/false
-bb:x:1002:100:AAA:/local/home/bb:/bin/bash
+aa:x:1002:100:AAA:/local/home/aa:/bin/bash
hh:x:1000:100:hhh:/local/home/hh:/bin/bash
linux:x:1001:100:linux:/local/home/linux:/bin/bash
-zz:x:1003:100:zz:/local/home/zz:/bin/bash
+::::::
`
2009-02-09 11:05:49 <note> rivendell User ‘bb’ renamed to ‘aa’
2009-02-09 11:05:49 <note> rivendell Home directory moved: ‘/bin/mv /local/home/bb /local/home/aa’
2009-02-09 11:05:49 <note> rivendell Backup created: ‘/bin/cp /etc/shadow /etc/shadow.YaST2save’
2009-02-09 11:05:49 <note> rivendell File written: ‘/etc/shadow’
2009-02-09 11:05:49 <note> rivendell nscd cache invalidated: ‘/usr/sbin/nscd -i passwd’
2009-02-09 11:05:49 <note> rivendell nscd cache invalidated: ‘/usr/sbin/nscd -i group’
2009-02-09 11:05:49 <note> rivendell Group ‘dialout’ modified
2009-02-09 11:05:49 <note> rivendell Group ‘video’ modified
2009-02-09 11:05:49 <note> rivendell Home directory removed: ‘/bin/rm -rf /local/home/zz’
2009-02-09 11:05:49 <note> rivendell User post-deletion script called: ‘/usr/sbin/userdel-post.local zz 1003 100 /local/home/zz’
2009-02-09 11:05:50 <item> rivendell User and Group Management module finished

Here, the user knows more about the real changes, but the log file is getting a bit less readable again… still I think I’d prefer it.

You could see on examples that I don’t really use the advantage of having 2 logging functions. AFAIK Martin’s original proposal was to use items to tell what actions are we going to perform and notes to log the details of such action. This is hardly achievable in yast2-users module (may be better with
others), since at the time of writing we don’t know the “user actions” taken, this is the info which is known when user is clicking in the UI (*). So another idea is to log directly when users is using UI and not at the time of write. See the last example (this is not a full log this time, just part of it):

2009-02-06 15:54:02 <item> rivendell User and Group Management module started
2009-02-06 15:54:11 <note> rivendell (UI info) User ‘bb’ removed from group ‘dialout’
2009-02-06 15:54:11 <note> rivendell (UI info) User ‘aa’ added to group ‘dialout’
2009-02-06 15:54:11 <note> rivendell (UI info) User ‘bb’ removed from group ‘video’
2009-02-06 15:54:11 <note> rivendell (UI info) User ‘aa’ added to group ‘video’
2009-02-06 15:54:11 <note> rivendell (UI info) User ‘bb’ renamed to ‘aa’
2009-02-06 15:54:11 <item> rivendell (UI info) User modified: ‘aa’
2009-02-06 16:03:10 <item> rivendell User and Group Management module finished

I think the last method is getting more talkative and actually is not more helpful.

So – comments? Proposals?

(*) Actually it would need to be cached during the UI-clicking and logged at the time of writing only if user doesn’t cancel the actions.

The generation of apt repositories at gwdg.de is going to stop

April 3rd, 2009 by

I was just notified by the ftp admin of gwdg.de (Eberhard), the long time reliable mirror of openSUSE, that he is going to stop the cronjobs at ftp4 which generate the /pub/linux/suse/apt/ contents at ftp4.gwdg.de, and shortly there after the rsync runs which sync it to ftp3 and ftp5 will be disabled.

I would like to thank Eberhard for the reliable service and all the hard work that was performed to generate the apt repositories during all those years!