The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My work

  • My badges

  • Twitter Updates

  • My Flickr Stream

    20140508-Delphi-2007--Project-Options--Cannot-Edit-Application-Title-HelpFile-Icon-Theming

    20140430-Fiddler-Filter-Actions-Button-Run-Filterset-now

    20140424-Windows-7-free-disk-space

    More Photos
  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,751 other followers

Archive for the ‘SuSE Linux’ Category

OpenSuSE Tumbleweed – when `halt` doesn’t halt, but CLI+HLT the CPU at the end of the shutdown procedure

Posted by jpluimers on 2017/04/26

When halt is not a real halt but a suspend of the CPU.

When halt is not a real halt but a “disabling” of the CPU.

TL;DR:

Don’t use halt, use poweroff instead.

A while ago I wrote about OpenSuSE 12.x not halting after a halt:

The same holds for more recent OpenSuSE systems, but ESXi would never tell what was going on.

Recently I installed an OpenSuSE Tumbleweed system under VMware Fusion (running on Mac OS X) which indicated “The CPU has been disabled by the guest operating system.”

Log indicates a

Log indicates a “Shutdown” which in fact is a CPU not powered down.

Which — Understanding the message: The CPU has been disabled by the guest operating system (2000542) | VMware KB [WayBack] — means that halt will not power down the VM but perform a CLI + HLT on the CPU. This effectively hangs the CPU even though the console log on the right tells does a real Shutdown.

In the past – even under ESXi – a halt would just power down the system, so based on the above I did more digging and fount this very interesting answer in rhel – What is the difference between these commands for bringing down a Linux server? – Unix & Linux Stack Exchange [WayBack] which comes down to:

  • on a systemd [WayBack] based system commands like halt, reboot, shutdown all invoke systemctl [WayBack] calling for a specific target [WayBack].
  • mapping of targets and commands is as follows (quoted from the answer):
    • systemctl isolate halt.target has the shorthands:
      • shutdown -H now
      • systemctl halt
      • plain unadorned halt
    • systemctl isolate reboot.target has the shorthands:
      • shutdown -r now
      • telinit 6
      • systemctl reboot
      • plain unadorned reboot
    • systemctl isolate poweroff.target has the shorthands:
      • shutdown -P now
      • telinit 0
      • shutdown now
      • systemctl poweroff
      • plain unadorned poweroff
    • systemctl isolate rescue.target has the shorthands:
      • telinit 1
      • systemctl rescue
    • systemctl isolate multi-user.target has the shorthands:
      • telinit 2
      • telinit 3
      • telinit 4
    • systemctl isolate graphical.target has the shorthand:
      • telinit 5

For a SysV [WayBack] init runlevels versus systemd targets see:

The systemd parameters making things a bit confusing, for instance you can do reboot --halt and more of those shown in linux – Are there any good reasons for halting system without cutting power? – Super User [WayBack].

That also explains that halt without a powerdown can be useful: it for instance gives the end-user the opportunity to click the reset button instead of the power button after a halt.

–jeroen

Posted in *nix, Linux, openSuSE, Power User, SuSE Linux, systemd, SysVinit, Tumbleweed | Leave a Comment »

ANSI HTML Adapter example

Posted by jpluimers on 2017/04/24

ANSI HTML Adapter example installation on OpenSuSE Tumbleweed:

zypper addrepo http://download.opensuse.org/repositories/utilities/openSUSE_Factory/utilities.repo
zypper refresh
zypper install aha

On Mac OS X:

brew install aha

Output looks like this: ANSI HTML Adapter example:

diaspore:/etc # aha --version
Ansi Html Adapter Version 0.4.9.0
diaspore:/etc # aha --version | grep aha
diaspore:/etc # aha --version | aha

Ansi Html Adapter Version 0.4.9.0

And the aha --help output on Mac OS X:

Ansi Html Adapter Version 0.4.8.0
aha takes SGR-colored Input and prints W3C conform HTML-Code
use: aha <options> [-f file]
     aha (--help|-h|-?)
aha reads the Input from a file or stdin and writes HTML-Code to stdout
options: --black,      -b: Black Background and White "standard color"
         --pink,       -p: Pink Background
         --stylesheet, -s: Use a stylesheet instead of inline styles
         --iso X,    -i X: Uses ISO 8859-X instead of utf-8. X must be 1..16
         --title X,  -t X: Gives the html output the title "X" instead of
                           "stdin" or the filename
         --line-fix,   -l: Uses a fix for inputs using control sequences to
                           change the cursor position like htop. It's a hot fix,
                           it may not work with any program like htop. Example:
                           echo q | htop | aha -l > htop.htm
         --word-wrap,  -w: Wrap long lines in the html file. This works with
                           CSS3 supporting browsers as well as many older ones.
         --no-header,  -n: Don't include header into generated HTML,
                           useful for inclusion in full HTML files.
Example: aha --help | aha --black > aha-help.htm
         Writes this help text to the file aha-help.htm

Copyleft Alexander Matthes aka Ziz 2015
         zizsdl@googlemail.com
         http://ziz.delphigl.com/tool_aha.php
This application is subject to the MPL or LGPL.

–jeroen

Posted in *nix, Linux, openSuSE, Power User, SuSE Linux, Tumbleweed | Leave a Comment »

opensuse – How to run my script after SuSE finished booting up? – Unix & Linux Stack Exchange

Posted by jpluimers on 2017/04/21

For future research: opensuse – How to run my script after SuSE finished booting up? – Unix & Linux Stack Exchange

Reason? Want to show the output of this as the last boot sequence line:

hostname
ip route
echo
ip address | grep -w 'UP\|flags\|inet\|inet6'
echo more detailed info through "ip address" and "ip route"
cat /etc/resolv.conf | grep nameserver

–jeroen

Posted in *nix, *nix-tools, bash, Linux, openSuSE, Power User, SuSE Linux, Tumbleweed | Leave a Comment »

use vmrun – via How do I find the IP address of a virtual machine using VMware Fusion? – Super User

Posted by jpluimers on 2017/04/20

Note this works only when the VMs have VMware Tools installed (more on that below):

VMWare provides, not surprisingly, a built in tool for this, vmrun. It’s under /Applications/VMware Fusion.app/Contents/Library/vmrun although it has moved around in other Fusion releases a bit.

🍺 vmrun list Total running VMs: 1 .docker/machine/machines/myvm.vmx
🍺 vmrun getGuestIPAddress ~/.docker/machine/machines/myvm.vmx 172.16.213.128

via: How do I find the IP address of a virtual machine using VMware Fusion? – Super User [WayBack]

vmrun [WayBack] is barely documented and most of is in PDF of which this is the most recent I could find: www.vmware.com/pdf/vix180_vmrun_command.pdf [WayBack]

Based on the above path, I added this to my ~/.bash_profile file:

alias vmrun='/Applications/VMware\ Fusion.app/Contents/Library/vmrun'
alias vmrun-list-running-VMs='vmrun list | grep vmx'
vmrun-list-ipv4-of-running-VMs()
{
  vmrun-list-running-VMs | while read line ; do echo $line && vmrun getGuestIPAddress $line; done
}

Now I can do this:

$ vmrun-list-ipv4-of-running-VMs
/Users/jeroenp/VM/W81Entx64DelphiRegression.vmwarevm/W81Entx64.vmx
172.16.172.135
/Users/jeroenp/VM/diaspore-opensuse-Tumbleweed-x64.vmwarevm/diaspore-opensuse-Tumbleweed-x64.vmx
Error: The VMware Tools are not running in the virtual machine: /Users/jeroenp/VM/diaspore-opensuse-Tumbleweed-x64.vmwarevm/diaspore-opensuse-Tumbleweed-x64.vmx
$ vmrun-list-ipv4-of-running-VMs
/Users/jeroenp/VM/diaspore.opensuse-Tumbleweed-x64/diaspore.opensuse-Tumbleweed-x64.vmx
Error: Unable to get the IP address
/Users/jeroenp/VM/W81Entx64DelphiRegression.vmwarevm/W81Entx64.vmx
172.16.172.135
$ vmrun-list-ipv4-of-running-VMs
/Users/jeroenp/VM/diaspore.opensuse-Tumbleweed-x64/diaspore.opensuse-Tumbleweed-x64.vmx
Error: Unable to get the IP address
/Users/jeroenp/VM/W81Entx64DelphiRegression.vmwarevm/W81Entx64.vmx
172.16.172.135
$ vmrun-list-ipv4-of-running-VMs
/Users/jeroenp/VM/diaspore.opensuse-Tumbleweed-x64/diaspore.opensuse-Tumbleweed-x64.vmx
172.16.172.134
/Users/jeroenp/VM/W81Entx64DelphiRegression.vmwarevm/W81Entx64.vmx
172.16.172.135
$ vmrun-list-ipv4-of-running-VMs
/Users/jeroenp/VM/diaspore.opensuse-Tumbleweed-x64/diaspore.opensuse-Tumbleweed-x64.vmx
172.16.172.134
/Users/jeroenp/VM/W81Entx64DelphiRegression.vmwarevm/W81Entx64.vmx
172.16.172.142

These are the messages I observed:

Error: The VMware Tools are not running in the virtual machine: /Users/jeroenp/VM/diaspore-opensuse-Tumbleweed-x64.vmwarevm/diaspore-opensuse-Tumbleweed-x64.vmx
Error: Unable to get the IP address
172.16.172.135

The first one means a machine is running but has no VMware Tools installed. For an OpenSuSE machine you can install it with zypper install open-vm-tools, for other Linux systems read VMware Tools auf Ubuntu, Mint, CentOS oder openSUSE installieren | ITrig [WayBack]

Some more examples of vmrun for VMware Fusion are at Control VMware Fusion from the Command Line | James Reuben Knowles [WayBack]

–jeroen

Posted in *nix, bash, Development, Fusion, openSuSE, Power User, Scripting, Software Development, SuSE Linux, Tumbleweed, Virtualization, VMware | Leave a Comment »

The woods and trees of OpenSuSE on single-board computers – image abbreviations – and getting it installed using OS X

Posted by jpluimers on 2017/02/27

Finding the right image

There are many single-board computers on the OpenSuSE hardware-compatibility list (HCL), including:

A lot of them have ready to go images, often for Tumbleweed, however none of the pages explain the below image differences hence the one-line for each:

Since I wanted a headless system, JeOS was what I needed.

As it wasn’t available for my ODroid C1+ but was for my Raspberry Pi 2 and as my main machine is a 15″ Retina MacBook Pro Late 2013 [WayBack] below are the steps I used to get the image working.

Installing the Raspberry Pi 2 image using OS X

The below Raspberry Pi2 link will redirect to the correct image in the generic download directory http://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/RaspberryPi2/images/

http://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/RaspberryPi2/images/openSUSE-Tumbleweed-ARM-JeOS-raspberrypi2.armv7l.raw.xz

For other Raspberry Pi versions, you can find them here:

http://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/RaspberryPi3/images/openSUSE-Tumbleweed-ARM-JeOS-raspberrypi3.aarch64.raw.xz

http://download.opensuse.org/ports/armv6hl/tumbleweed/images/openSUSE-Tumbleweed-ARM-JeOS-raspberrypi.armv6l-Current.raw.xz

I installed on a 8 gigabyte SD card that revealed itself as /dev/disk1 using this diskutil command (via osx – List all devices connected, lsblk for Mac OS X – Ask Different [WayBack])

diskutil list

So this wrote the image to SD card in a sudo su - prompt:

targetDevice="disk2"
unxz --keep openSUSE-Tumbleweed-ARM-JeOS-raspberrypi2.armv7l-2016.08.20-Build2.1.raw.xz; \
diskutil umount "/dev/${targetDevice}s1"; \
dd bs=1m of="/dev/r${targetDevice}" if=openSUSE-Tumbleweed-ARM-JeOS-raspberrypi2.armv7l-2016.08.20-Build2.1.raw; \
sync; \
diskutil list; \
diskutil eject "/dev/${targetDevice}"

or if you want to select which image to “burn”:

targetDevice="disk2"
imageName="openSUSE-Tumbleweed-ARM-JeOS-raspberrypi2.armv7l-2016.08.20-Build2.1.raw"
imageName="openSUSE-Tumbleweed-ARM-JeOS-raspberrypi.armv6l-2016.11.23-Build2.22.raw"
imageName="openSUSE-Tumbleweed-ARM-JeOS-raspberrypi3.aarch64-2017.01.12-Build3.2.raw"
unxz --keep ${imageName}.xz; \
diskutil umount "/dev/${targetDevice}s1"; \
dd bs=1m of="/dev/r${targetDevice}" if=${imageName}; \
sync; \
diskutil list; \
diskutil eject "/dev/${targetDevice}"

A few notes:

Read the rest of this entry »

Posted in *nix, Development, Hardware, Hardware Development, Linux, openSuSE, Power User, Raspberry Pi, Single-Board Computers, SuSE Linux, Tumbleweed | 1 Comment »

 
%d bloggers like this: