Find installation date and time of rpm package(s).

List all rpm package with date and time information, use the below given command to list all rpm package with date-stamp information:

rpm -qa --last

–cut
iotop-0.4.3-7.8.1 Fri Aug 7 12:24:02 2015
libgtop-lang-2.28.0-1.9.24 Fri Aug 7 12:20:57 2015
libgtop-2.28.0-1.9.24 Fri Aug 7 12:20:10 2015
libgtop-2_0-7-2.28.0-1.9.24 Fri Aug 7 12:20:06 2015
–cut

and for a single package:

rpm -q --last package-name

SUSE 12 – enable SSL and Create a Self-Signed Certificate

The SSL module is enabled by default in the global server configuration. In case it has been disabled on your host, activate it with the following command: a2enmod ssl. To finally enable SSL, the server needs to be started with the flag “SSL”. To do so, call a2enflag SSL (case-sensitive!). If you have chosen to encrypt your server certificate with a password, you should also increase the value for APACHE_TIMEOUT in /etc/sysconfig/apache2, so you have enough time to enter the passphrase when Apache starts. Restart the server to make these changes active. A reload is not sufficient.

Creating a Self-Signed Certificate on SUSE 12:

root# openssl req -new > vhostname.csr
root# openssl rsa -in privkey.pem -out vhostname.key
root# openssl x509 -in vhostname.csr -out journal.crt -req -signkey vhostname.key -days 3650

Copy the certificate files to the relevant directories, so that the Apache server can read them. Make sure that the private key /etc/apache2/ssl.key/vhostname.key is not world-readable, while the public PEM certificate /etc/apache2/ssl.crt/vhostname.crt is.

Rotate cron.daily on SUSE at a certain time.

At the moment my logs are rotating via logrotate at various different time.
To rotate at a certain time edit variable DAILY_TIME in /etc/sysconfig/cron

For example: DAILY_TIME="00:01"

Otherwise the way to do it involves making the creation time of /var/spool/cron/lastrun/cron.daily the hour and minute you want. This can be done by an at job since you don’t want to hang around to do that. To understand why creation time and not modification time, read /usr/lib/cron/run-crons, in particular the find statement.

How to remove an unwanted channel from SUSE Manager

At first you need to identify what channels you want to delete. Use the “mgr-sync list channels” command.

root # mgr-sync list channels
Available Channels:

Status:
- [I] - channel is installed
- [ ] - channel is not installed, but is available
- [U] - channel is unavailable

[ ] RHEL i386 Server 5 RES 5 [rhel-i386-server-5]
[ ] RHEL i386 Server 6 Red Hat Expanded Support for RHEL 6 [rhel-i386-server-6]
[ ] RHEL x86_64 Server 5 RES 5 [rhel-x86_64-server-5]
[ ] RHEL x86_64 Server 6 Red Hat Expanded Support for RHEL 6 [rhel-x86_64-server-6]
[ ] RHEL x86_64 Server 7 Red Hat Expanded Support for RHEL 7 [rhel-x86_64-server-7]
[ ] SLES10-SP3-Pool for i586 SUSE Linux Enterprise Server 10 SP3 i686 [sles10-sp3-pool-i586]
[ ] SLES10-SP3-Pool for x86_64 SUSE Linux Enterprise Server 10 SP3 x86_64 [sles10-sp3-pool-x86_64]
[ ] SLES10-SP4-Pool for i586 SUSE Linux Enterprise Server 10 SP4 i486 [sles10-sp4-pool-i586]
[ ] SLES10-SP4-Pool for x86_64 SUSE Linux Enterprise Server 10 SP4 x86_64 [sles10-sp4-pool-x86_64]
[ ] SLES11-SP1-Pool for i586 SUSE Linux Enterprise Server 11 SP1 i586 [sles11-sp1-pool-i586]
[ ] SLES11-SP1-Pool for x86_64 SUSE Linux Enterprise Server 11 SP1 x86_64 [sles11-sp1-pool-x86_64]
[ ] SLES11-SP3-Pool for i586 SUSE Linux Enterprise Server 11 SP3 i686 [sles11-sp3-pool-i586]
[ ] SLES11-SP3-Pool for x86_64 SUSE Linux Enterprise Server 11 SP3 x86_64 [sles11-sp3-pool-x86_64]
[ ] SLES11-SP4-Pool for i586 SUSE Linux Enterprise Server 11 SP4 i686 [sles11-sp4-pool-i586]
[I] SLES11-SP4-Pool for x86_64 SUSE Linux Enterprise Server 11 SP4 x86_64 [sles11-sp4-pool-x86_64]
[ ] SLE11-Public-Cloud-Module for x86_64 SLES-SP4 SUSE Linux Enterprise Server 11 SP3 x86_64 [sle11-public-cloud-module-x86_64-sles-sp4]
[I] SLE11-SDK-SP4-Pool for x86_64 SUSE Linux Enterprise Software Development Kit 11 SP4 [sle11-sdk-sp4-pool-x86_64]
[I] SLE11-SDK-SP4-Updates for x86_64 SUSE Linux Enterprise Software Development Kit 11 SP4 [sle11-sdk-sp4-updates-x86_64]
[ ] SLE11-Security-Module for x86_64 SLES-SP4 SUSE Linux Enterprise Server 11 SP3 x86_64 [sle11-security-module-x86_64-sles-sp4]
[ ] SLE11-SMT-SP3-Pool for x86_64 SP4 SUSE Linux Enterprise Subscription Management Tool 11 SP3 [sle11-smt-sp3-pool-x86_64-sp4]
[ ] SLE11-SMT-SP3-Updates for x86_64 SP4 SUSE Linux Enterprise Subscription Management Tool 11 SP3 [sle11-smt-sp3-updates-x86_64-sp4]
[ ] SLE11-SP4-Debuginfo-Pool for x86_64 SUSE Linux Enterprise Server 11 SP4 x86_64 [sle11-sp4-debuginfo-pool-x86_64]
[ ] SLE11-SP4-Debuginfo-Updates for x86_64 SUSE Linux Enterprise Server 11 SP4 x86_64 [sle11-sp4-debuginfo-updates-x86_64]
[ ] SLES11-Extras for x86_64 SLES-SP4 SUSE Linux Enterprise Server 11 SP1 x86_64 [sles11-extras-x86_64-sles-sp4]
[I] SLES11-SP4-Updates for x86_64 SUSE Linux Enterprise Server 11 SP4 x86_64 [sles11-sp4-updates-x86_64]
[I] SLES12-Pool for x86_64 SUSE Linux Enterprise Server 12 x86_64 [sles12-pool-x86_64]

For example you want to delete the following channel:
[I] SLE11-SDK-SP4-Updates for x86_64 SUSE Linux Enterprise Software Development Kit 11 SP4 [sle11-sdk-sp4-updates-x86_64]

To do that, use the following command: “spacewalk-remove-channel -c

root # spacewalk-remove-channel -c sle11-sdk-sp4-updates-x86_64

Enable the VNC session running on display :1 for an oracle user on the SUSE server

To enable the VNC session running on display :1 for an oracle user on the SUSE server, please create the file called after.local in /etc/init.d with 775 rights, the file should look like that:

slestest:~ # cat /etc/init.d/after.local
#!/bin/sh
/bin/su oracle -c "/usr/bin/vncserver :1 &"

Just check that you have tightvnc installed:
slestest:~ # rpm -qa|grep vnc
xorg-x11-Xvnc-7.4-27.81.7
tightvnc-1.3.9-81.13.1
slestest:~ #

Useful RPM Commands

Getting detailed information about the package telnet:
root# rpm -qi telnet
Name : telnet
Epoch : 1
Version : 0.17
Release : 59.el7
Architecture: x86_64
Install Date: Thu 16 Jul 2015 13:49:27 IST
Group : Applications/Internet
Size : 115772
License : BSD
Signature : RSA/SHA256, Fri 04 Jul 2014 06:12:17 IST, Key ID 24c6a8a7f4a80eb5
Source RPM : telnet-0.17-59.el7.src.rpm
Build Date : Mon 09 Jun 2014 23:06:27 IST
Build Host : worker1.bsys.centos.org
Relocations : (not relocatable)
Packager : CentOS BuildSystem
Vendor : CentOS
URL : http://web.archive.org/web/20070819111735/www.hcs.harvard.edu/~dholland/computers/old-netkit.html
Summary : The client program for the Telnet remote login protocol
Description :
Telnet is a popular protocol for logging into remote systems over the
Internet. The package provides a command line Telnet client
root#

Determining which package installed the file /usr/bin/telnet:
root# rpm -qf /usr/bin/telnet
telnet-0.17-59.el7.x86_64
root#

Showing all the files installed by the package telnet:
root# rpm -ql telnet
/usr/bin/telnet
/usr/share/doc/telnet-0.17
/usr/share/doc/telnet-0.17/README
/usr/share/man/man1/telnet.1.gz
root#

Viewing the documentation files for the command telnet:
root# rpm -qd telnet
/usr/share/doc/telnet-0.17/README
/usr/share/man/man1/telnet.1.gz
root#

XRDP on SUSE12 issue – solved

I have installed XRDP on SLES12 but the systemd does not start this service as xrdp.service service file is missing. I know that it could be started by typing: /etc/xrdp/xrdp.sh start but I want it to be started after the reboot.

Create a systemd service file:

sles15:~ # vim /usr/lib/systemd/system/xrdp.service

[Unit]
Description=xrdp daemon
After=syslog.target network.target

[Service]
Type=forking
ExecStart=/etc/xrdp/xrdp.sh start
ExecStop=/etc/xrdp/xrdp.sh stop

[Install]
WantedBy=multi-user.target

and then a symlink:

sles15:~ # ln -s /usr/lib/systemd/system/xrdp.service /etc/systemd/system/xrdp.service

now turn the XRDP service on, for start at next boot.

sles15:~ # systemctl enable xrdp
sles15:~ # systemctl is-enabled xrdp

So, the XRDP will be started after the reboot 😉 And now another problem occurred, we connected to XRDP on SUSE12 and got a black screen 😛
To fix this issue you need to switch to icewm and at lest get a screen 😉 Just edit /etc/xrdp/startwm.sh and pretend the list of Session with “icewm”.

sles15:~ # vim /etc/xrdp/startwm.sh
--cut
#SESSIONS="gnome-session blackbox fluxbox startxfce4 startkde xterm"
SESSIONS="icewm"
--cut

I am a bit surprised that a package like XRDP made it into SLES in such a broken state. Well, have to wait for SP1.

Starting NFS client services: sm-notify idmapd – hangs on SUSE and OES11.

The system is responding to a keyboard, but the booting process does not go forward.
Only ctrl+alt+del is working fine. To make it work I had to reboot with runlevel 1 and delete this one:
/etc/init.d/rc5.d/S04nfs.
After that system is booting without problem.

Can’t delete files/folders on a NSS volume.

While deleting files/folders on the NSS volume on an OES11 server as root user via shell. Let’s say test1.doc and the following error will occur:

“rm: cannot remove `test1.doc’: Permission denied” or “S-1-1-0-1 on a Windows machine.”

You will get that error if you have flagged the file with NSS flag “Delete Inhibit” or “Rename Inhibit”. Clear those flags out and it should also be possible to delete the file directly from a Linux console. Use this command:

root# attrib -r -c all foldername