Showing posts with label sysadmin. Show all posts
Showing posts with label sysadmin. Show all posts

Thursday, March 9, 2017

Fedora dnf history

Sometimes it can happen that you remove a package and inadvertently you remove a bunch of dependencies. Like removing the entire desktop manager: what a mess, waht a pain in the ass!
Sometimes dependecies are strange.

Rarely, but it can happen too, after an update something doesn't work anymore. Maybe the updated package is buggy? Better waiting for a fix.

By the way. If you install or uninstall packages by mistake, there is a way to rollback the changes: history.

sudo dnf history list

And you can see the dnf activities.

sudo dnf history info 132

You can see the details of the dnf command labeled as 132

Let's say 132 is the number of the last action

ID     | Command line             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
   132 | update                   | 2017-03-09 16:06 | Update         |    8 

Issue the following command in order to uninstall these updates:

sudo dnf history undo 132

And you will get something like:

Undoing transaction 132, from Thu Mar  9 21:06:10 2017
No package libgdata-0:0.17.6-3.fc25.x86_64 available.
Error: An operation cannot be undone

Well. WTF!

It seems that, if you would like to have the option to rollback updates, you must enable packages cache beforehand with keepcache=1 in the /etc/dnf/dnf.conf configuration file. This could lead to some disk space used to store previous versions of rpms? I must investigate a bit deeper.

References: 

Friday, August 2, 2013

ENOSPC, open '/zones...metadata.json'

SmartOS.

Issuing this command

vmadm update f7c4fbb0-aa35-41d4-9d21-614caba785c7 max_physical_memory=2048

I got an error like

ENOSPC, open '/zones/f7c4fbb0-aa35-41d4-9d21-614caba785c7/config/metadata.json'


I try to enter in the zone

zlogin f7c4fbb0-aa35-41d4-9d21-614caba785c7

but I got

[Connected to zone 'f7c4fbb0-aa35-41d4-9d21-614caba785c7' pts/12]
No utmpx entry. You must exec "login" from the lowest level "shell".

[Connection to zone 'f7c4fbb0-aa35-41d4-9d21-614caba785c7' pts/12 closed]



WTF?

The zone reached the zfs disk quota. Disk full.

But also
vmadm update f7c4fbb0-aa35-41d4-9d21-614caba785c7 quota=50
returns
ENOSPC, open '/zones/f7c4fbb0-aa35-41d4-9d21-614caba785c7/config/metadata.json'


So the solution is simple:

zfs set quota=40G zones/f7c4fbb0-aa35-41d4-9d21-614caba785c7

vmadm update f7c4fbb0-aa35-41d4-9d21-614caba785c7 max_physical_memory=2048
Successfully updated VM f7c4fbb0-aa35-41d4-9d21-614caba785c7


Tuesday, January 15, 2013

smartos vmadm failed

Maybe this is only a workaround, like a good craftsman.

I was in this situation:

# vmadm list
UUID                   TYPE  RAM      STATE      ALIAS

76ffffff-cc23-4501...  OS    256      failed     db1

No way to boot or halt the zone.
(Cannot to start vm from state "failed", must be "stopped")
(login allowed only to running zones  ... is 'installed')


The only way to solve the issues, for me, was:

vi /etc/zones/76ffffff-cc23-4501-b5f3-41a69c65b321.xml

and search for a line containing "failed", then delete this line.


Friday, January 4, 2013

Centos Apache and Directory index forbidden

Today I struggled a little bit to make directory index module working.
I'm on Centos.

Installed apache (httpd) rpm.
No changes to configuration. Nothing.

I have created a conf file /etc/httpd/conf.d/my.conf

Alias /images "/var/www/images"

<Directory "/var/www/images">
    Options Indexes MultiViews FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>


I have created the /var/www/images directory.
In this directory I don't want to put any html page. I want to use the Apache autoindex module to serve a list of files contained in this directory.

WTF autoindex not working...

And in the logs /var/log/httpd/error_log you can read

[Thu Jan 03 03:44:05 2013] [error] [client 192.168.56.1] Directory index forbidden by Options directive: /var/www/images/


The problem was that in /etc/httpd/conf.d/welcome.conf there was

Options -Indexes

So:
- you can delete such file
- you can change in +Indexes

Friday, August 17, 2012

openindiana zfs nfs share root

Server

sharectl set -p nfsmapid_domain=your.domain nfs

zfs create rpool/nfsshare

zfs set sharenfs=rw,root=client.your.domain  rpool/nfsshare

sharectl get nfs

dfshares


Client

sharectl set -p nfsmapid_domain=your.domain

mount -F nfs -overs=4,rw server.your.domain:/mnt/nfsshare /mnt/nfs


Note

root=client.your.domain

if I use the IP address it doesn't work (?)



nfs mount: mount: /mnt/nfs: Permission denied
touch: cannot create /mnt/nfs/aaa: Permission denied

Friday, July 20, 2012

Solaris, snooping RPC and "can't authenticate (unknown cause)" message


The problem

I had a problem with QStar Remote Admin connecting to a Solaris server. As far I can understand QStar uses RPC.
Sniffing traffic using snoop, I've seen a message like this:

1.2.3.4 →1.2.3.5 RPC R (#140) x10=1209249015 can't authenticate (unknown cause)

The problem was that local_only option in the network/rpc/bind service was set to true.

The solution

svccfg
  svc:> select network/rpc/bind
  svc:/network/rpc/bin> setprop config/local_only=false
  svc:/network/rpc/bind> quit
svcadm refresh network/rpc/bind:default
svcprop network/rpc/bind:default | grep local_only

References