Friday, May 18, 2012

eject(1), sulogin(1), wdctl(1)

The commands eject(1) and sulogin(1) have been merged into util-linux upstream.


The original eject(1) upstream is inactive for more than 4 years, but the command is actively used by many users and it's also used by system components like udisks. The command has been completely rewritten (by Michal Luscon and me). Changes:
  • linked with libmount
  • device may be addressed by UUID or LABEL
  • partition name is always converted to whole-disk device name to avoid eject SCSI ioctls on partition devices
  • uses /sys to get list of all partitions (all partitions are unmounted before eject)
  • patches from distributions (mostly Fedora) have been merged
  • code is about 1/3 shorter
Note that users who depend on the command volname(1) from the original eject package have to use
  blkid -p -o value -s LABEL device. 
util-linux and systemd upstreams ambition is to move initd independent commands to the generic util-linux package and minimize number of packages required for basic system.

We merged mountpoint(1) from sysvinit-tools into util-linux two releases ago, and sulogin(1) now. The command sulogin(1) is like login(1) but it's used in single user mode to supply the root password before a shell is started. The nice advantage is that we maintain login(1) and agetty(1) in the same source tree so we can share code and coordinate development.

wdctl(1) is a new small util that will be available in util-linux-2.22. The 'wd' means watchdog (unfortunately 'watchdog' is name already used for watchdog daemon, so we cannot use this name for command line util...).

wdctl(1) prints the current watchdog setting (flags), watchdog identity information and timeouts.

Default output:
  # wdctl                
  Identity:      iTCO_wdt [version 0]
  Timeout:       30 seconds
  Timeleft:       2 seconds
  KEEPALIVEPING  Keep alive ping reply          0           0
  MAGICCLOSE     Supports magic close char      0           0
  SETTIMEOUT     Set timeout (in seconds)       0           0

or in script:

Thanks to Lennart Poettering who provided the first prototype.


  1. Makes lots of sense. Nice work.

    About wdctl, I notice you can only specify 1 watchdog device.
    The kernel recently got support for multiple watchdog devices which is quite common.
    Might be nice to auto scan /dev/watchdog* or support specifying more than one device?

    Any plans to support patting the watchdog from this util? One thing I noticed from short lived utils manipulating the watchdog is that the kernel prints a warning about not having stopped the watchdog before close. That's a kernel issue though, so should be removed
    there IMHO.

  2. > Might be nice to auto scan /dev/watchdog* or support specifying more...

    Good point, I'll implement it.

    > Any plans to support patting the watchdog from this util?

    Hmm.. send patch :-)

  3. I guess my friend shared this post to me by mistake – I work for an academic help company and I specialize in providing Coursework Writing Services. My friend from the development team shared this post with me. I guess it was intended to land somewhere else and it ended up in my inbox.

  4. Hey there it happens that I searched amazing ideas about my writing. Now I want to complete one task. I write my annotated bibliography

  5. Awe! I love family posts! This is great. And Dylan looks so adorable, and cute! You have a great family, it looks like Ranboo Letterman Varsity Jacket

  6. Lava cool product
    This is very interesting content! I have thoroughly enjoyed reading your points and have come to the conclusion that you are right Lava cool product about many of them.

  7. Yellowstone based on the American television series & Yellowstone Jackets is now available.
    Summer Higgins Black Jacket