Archive for the ‘SuSE Linux’ Category
Posted by jpluimers on 2020/05/15
Nowadays, most OpenSuSE Linux services are systemd based. Listing those is simple with systemctl list-units --all (configured ones) and systemctl list-unit-files (nonconfigured ones as well), though their states can be many as the command-completion for the --state parameter:
# systemctl list-unit-files --state
abandoned deactivating failed masked not-found remounting-sigterm start-pre stop-sigkill waiting
activating deactivating-sigkill final-sigkill merged plugged running stop stop-sigterm
activating-done deactivating-sigterm final-sigterm mounted registered sigkill stop-post stub
activating-sigkill dead inactive mounting reload sigterm stop-pre tentative
activating-sigterm elapsed listening mounting-done reloading start stop-pre-sigkill unmounting
active error loaded mounting-sigkill remounting start-chown stop-pre-sigterm unmounting-sigkill
auto-restart exited making mounting-sigterm remounting-sigkill start-post stop-sigabrt unmounting-sigterm
The odd thing: not all states from the service list are in the completion. These are missing from the list-unit-files:
generated
static
transient
In the past, most services were System V based, where you can use service --status-all. Contrary to the documentation (which indicates “The –status-all option displays the status of all loaded service units.”), it lists all services.
On OpenSuSE though, it now lists both System V based and systemd based services in one go. Since usually there are no more System V services (virtually all have been migrated to systemd a few years ago), the netto result is systemd services.
Based on [WayBack] init.d – Command to list services that start on startup? – Ask Ubuntu
–jeroen
Posted in *nix, *nix-tools, Linux, openSuSE, Power User, SuSE Linux, Tumbleweed | Leave a Comment »
Posted by jpluimers on 2020/04/20
This was much easier than I hoped for: the zypper verbs search and install both support the --type pattern argument.
After that, the names for them are pattern names instead of the normal package names.
So for instance:
zypper search --type pattern
zypper install -type pattern kde kde_plasmaaa
Sources:
–jeroen
Posted in *nix, Linux, openSuSE, Power User, SuSE Linux, Tumbleweed | Leave a Comment »
Posted by jpluimers on 2020/01/20
When you look at how to find listed cron jobs, usually the answer is cron -l or cron -u username -l.
However, on OpenSuSE systems, cron jobs can be in different places, and the sysconfig settings have influence on them too.
These files and directories all influence cron:
Directories:
/etc/cron.d/
/etc/cron.daily/
/etc/cron.hourly/
/etc/cron.monthly/
/etc/cron.weekly/
Files:
/etc/sysconfig/cron
/etc/init.d/rc2.d/K01cron
/etc/init.d/rc2.d/S14cron
/etc/init.d/rc3.d/K01cron
/etc/init.d/rc3.d/S14cron
/etc/init.d/rc5.d/K01cron
/etc/init.d/rc5.d/S14cron
/etc/init.d/cron
/etc/news/crontab.sample
/etc/pam.d/crond
/etc/systemd/system/multi-user.target.wants/cron.service
/etc/omc/srvinfo.d/cron.xml
/etc/cron.deny
/etc/crontab
Most are available for other Linux distributions as well, but each one might have slightly different configurations (especially for the directories). Some background reading:
Some details:
- The
crontab -l will only list what is in /etc/crontab.
- These directories are influenced by
/etc/sysconfig/cron, especially the DAILY_TIME variable (see below) for the daily jobs.
All of the directories are checked every 15 minutes through /usr/lib/cron/run-crons:/etc/cron.daily/
/etc/cron.hourly/
/etc/cron.monthly/
/etc/cron.weekly/
- That script then uses these files for checking when to run:
/var/spool/cron/lastrun/cron.weekly
/var/spool/cron/lastrun/cron.daily
/var/spool/cron/lastrun/cron.hourly
The DAILY_TIME variable:
## Type: string
## Default: ""
#
# At which time cron.daily should start. Default is 15 minutes after booting
# the system. Example setting would be "14:00".
# Due to the fact that cron script runs only every 15 minutes,
# it will only run on xx:00, xx:15, xx:30, xx:45, not at the accurate time
# you set.
DAILY_TIME=""
–jeroen
Posted in *nix, *nix-tools, cron, Linux, openSuSE, Power User, SuSE Linux, Tumbleweed | Leave a Comment »
Posted by jpluimers on 2019/10/24
For first time BIND named users on OpenSuSE there is often confusion on the relation between these directories:
/etc/named.d/
/var/lib/named/
For example here someone else struggled: [WayBack] Re: Fwd: Re: [opensuse] Split DNS? Solved
This is how I inferred the workings:
The /etc/named.conf.include is re-generated at named start by running /usr/share/bind/createNamedConfInclude by including files that both match NAMED_CONF_INCLUDE_FILES in /etc/sysconfig/named and exist in the /etc/named.d/ directory.
At named startup, it also copies everything from /etc/named.d to /var/lib/named/etc/named.d
For details see
–jeroen
Posted in *nix, *nix-tools, bind-named, Linux, openSuSE, Power User, SuSE Linux | Leave a Comment »
Posted by jpluimers on 2019/09/16
Dieser Artikel beschreibt, wie man einen eigenen Mechanismus für DNS-Updates als DynDNS-Alternative aufbaut.
Translated:
This article describes how you can create your own mechanism for DNS-updates as alternative for DynDNS.
Interesting read: [WayBack] Eigenes DynDNS mit Bind und Apache – CupRacer.de
Edit
The above post disappeared, but this one (which adds calling the DynDNS server from a Fritz!Box) is still up: [WayBack] Eigener DynDNS mit Bind, Apache und PHP | onderka.com with an update at [WayBack] Eigener DynDNS mit dnsmasq, Apache und PHP | onderka.com.
Source code for both:
Related and background reading:
–jeroen
Posted in *nix, bind-named, Linux, openSuSE, Power User, SuSE Linux, Tumbleweed | Leave a Comment »
Posted by jpluimers on 2019/07/01
The snapper documentation itself is big and hard to grasp at once, so start here for a few examples on how to get going, or how to assess your current configuration:
For a very good snapper introduction seems to be gone, but was present in the OpenSuSE documentation archive circa version 13.2 at [WayBack] Chapter 4. Snapshots/Rollback with Snapper | ActiveDoc which I’ve quoted below.
Between that version and LEAP, the retention got moved from “timeline” based to “number” based. More on that in these links:
Man pages:
Introduction
4.1.1 snapshots and Disk Space #
When a snapshot is created, both the snapshot and the original point to the same blocks in the file system. So, initially a snapshot does not occupy additional disk space. If data in the original file system is modified, changed data blocks are copied while the old data blocks are kept for the snapshot. Therefore, a snapshot occupies the same amount of space as the data modified. So, over time, the amount of space a snapshot allocates, constantly grows. As a consequence, deleting files from a Btrfs file system containing snapshots may not free disk space!
Note: Snapshot Location
Snapshots always reside on the same partition or subvolume that has been snapshotted. It is not possible to store snapshots on a different partition or subvolume.
As a result, partitions containing snapshots need to be larger than “normal” partitions. The exact amount strongly depends on the number of snapshots you keep and the amount of data modifications. As a rule of thumb you should consider using twice the size than you normally would.
Tip: Freeing space / Disk Usage
In order to free space on a Btrfs partition containing snapshots you need to delete unneeded snapshots rather than files. Older snapshots occupy more space than recent ones.
Since the df does not show the correct disk usage on Btrfs file systems, you need to use the command btrfs filesystem df MOUNT_POINT. Displaying the amount of disk space a snapshot allocates is currently not supported by the Btrfs tools.
–jeroen
Posted in *nix, Linux, openSuSE, Power User, SuSE Linux, Tumbleweed | Leave a Comment »
Posted by jpluimers on 2019/06/07

`ls` colour codes
I got confused as I thought red text would mean an error.
But they’re not: greenish yellow on a read background means error (a symbolic link to a place that’s no longer there).
It’s the output of https://github.com/gkotian/gautam_linux/blob/master/scripts/colours.sh as the one at
Actually the script is here https://raw.githubusercontent.com/gkotian/gautam_linux/master/scripts/colours.sh as the one at [WayBack] command line – What do the different colors mean in the terminal? – Ask Ubuntu failed with errors like this one:
-bash: *.xbm: bad substitution
The full script output is below.
Since various terminals have a different mapping from colours in the ANSI escape code colour table, I used the standard HTML colours using (which slightly differs from the Terminal.app screenshot on the right):
References:
Note that the shell on Mac OS X uses a different way of configuring colours CLICOLOR as described in [WayBack] settings – CLICOLOR and LS_COLORS in bash – Unix & Linux Stack Exchange. I might cover that another day.
Script output:
Read the rest of this entry »
Posted in *nix, *nix-tools, ANSI escape code, bash, CSS, Development, Encoding, HTML, HTML5, Linux, openSuSE, Power User, Software Development, SuSE Linux, Tumbleweed, Web Development | Leave a Comment »
Posted by jpluimers on 2019/05/27
A while ago, I somehow had a damaged btrfs partition that I found out after the virtualisation host without reason decided to reboot.
I’m not sure what caused that (by now the machine has been retired as it was already getting a bit old), but btrfs was panicking shortly after boot, so the VM as is was unusable.
In the end I had to:
- Boot from a Tumbleweed Rescue DVD (download Rescue CD – x86_64 from [WayBack] openSUSE:Tumbleweed installation – openSUSE)
- Add a fresh backup hard disk in read-write mote
- Mount the old one in read-only mode
rsync -avloz over as much as I could
- Restore the VM from a backup
- Attach the backup hard disk
- Diff what I missed (only a few bits in the
/etc tree and my home directory for which I hadn’t yet pushed the git repositories).
These didn’t work, but might work for others: [WayBack] SDB:BTRFS – openSUSE – How to repair a broken/unmountable btrfs filesystem
–jeroen
Posted in *nix, btrfs, File-Systems, Linux, openSuSE, Power User, SuSE Linux, Tumbleweed | Leave a Comment »
Posted by jpluimers on 2019/04/22
I wondered [WayBack] linux – Why is this a binary multi-megabyte blob /etc/udev/hwdb.bin under /etc? – Unix & Linux Stack Exchange.
All my OpenSuSE systems had the /etc/udev/hwdb.bin file with sizes varying between 7.5 and 10 megabytes with many of the zypper dist-upgrade causing updates.
Luckily the system also contains these files which had valid unit definitions, so the file was generated/updated during boot:
/usr/bin/systemd-hwdb
/usr/lib/systemd/system/sysinit.target.wants/systemd-hwdb-update.service
/usr/lib/systemd/system/systemd-hwdb-update.service
Thanks [WayBack] nwildner for answering that question!
So after installing etckeeper and performing etckeeper init you can immediately remove it from the git repository:
# cd /etc
# git rm --cached /etc/udev/hwdb.bin
rm 'udev/hwdb.bin'
# git commit -m "no need for /etc/udev/hwdb.bin to be under revision control as systemd-hwdb maintains it"
For more background, see [WayBack] How to make Git “forget” about a file that was tracked but is now in .gitignore? – Stack Overflow.
–jeroen
Posted in *nix, *nix-tools, etckeeper, Linux, openSuSE, Power User, SuSE Linux, systemd, Tumbleweed | Leave a Comment »