openhab / openhabian

openHABian - empowering the smart home, for Raspberry Pi and Debian systems
https://community.openhab.org/t/13379
ISC License
820 stars 252 forks source link

Amanda-Backup: security file '/etc/amanda-security.conf' do not allow to run '/usr/bin/tar' #1370

Closed dimmenhau closed 3 years ago

dimmenhau commented 3 years ago

Issue information:

I tried several times today with the image openhabian-pi-raspios32-v1.6.2 to install on my Raspberry openHAB 3 and then configure Amanda backup. The installation has worked so far without errors, only when I then want to check the installation with amcheck, comes the following error message. With the IMG version (202010031354-git535d54d) the whole thing still worked with openHAB2.6.

System information:

Release = Raspbian GNU/Linux 10 (buster) Kernel = Linux 5.4.79-v7l+ Platform = Raspberry Pi 4 Model B Rev 1.2

Probleme:

amcheck openhab-dir Amanda Tape Server Host Check

slot 1: contains an empty volume Will write label 'openHABian-openhab-dir-001' to new volume in slot 1. NOTE: skipping tape-writable test NOTE: storage 'openhab-dir': retentions-tapes (14) <= runspercycle (14) NOTE: host info dir '/var/lib/amanda/openhab-dir/curinfo/openhab' does not exist It will be created on the next run NOTE: index dir '/var/lib/amanda/openhab-dir/index/openhab' does not exist it will be created on the next run Server check took 1.413 seconds Amanda Backup Client Hosts Check

HOST openhab ERROR: security file '/etc/amanda-security.conf' do not allow to run '/usr/bin/tar' as root for 'amgtar:gnutar_path' HOST openhab ERROR: security file '/etc/amanda-security.conf' do not allow to run '/usr/bin/tar' as root for 'amgtar:gnutar_path' HOST openhab ERROR: security file '/etc/amanda-security.conf' do not allow to run '/usr/bin/tar' as root for 'amgtar:gnutar_path' HOST openhab ERROR: security file '/etc/amanda-security.conf' do not allow to run '/usr/bin/tar' as root for 'amgtar:gnutar_path' Client check: 1 host checked in 3.980 seconds. 4 problems found. (brought to you by Amanda 3.5.1)

mstormi commented 3 years ago

show your /etc/amanda-security.conf and output of dpkg -s amanda-common

dimmenhau commented 3 years ago

I just did another reinstall with the v1.6.2b image. Have only there in the openhabian.conf the hotspot disabled because this makes me problems with the network.

Her is my amanda-security.conf:

#runtar:gnutar_path=/bin/tar
#amgtar:gnutar_path=/bin/tar
#amstar:star_path=/usr/bin/star
#ambsdtar:bsdtar_path=/usr/bin/bsdtar

#restore_by_amanda_user=no
tcp_port_range=512,1024
udp_port_range=840,860

and the output from dpkg:

[16:34:14] openhabian@openhab:~$ dpkg -s amanda-common
Package: amanda-common
Status: install ok installed
Priority: optional
Section: utils
Installed-Size: 7814
Maintainer: Jose M Calhariz <calhariz@debian.org>
Architecture: armhf
Source: amanda (1:3.5.1-2)
Version: 1:3.5.1-2+b3
Replaces: amanda, amanda-client (<< 1:3.5), amanda-server (<< 1:3.5)
Depends: adduser, bsd-mailx | mailx, debconf (>= 0.5) | debconf-2.0, openbsd-inetd | inet-superserver, update-inetd, perl (>= 5.28.0-3), perlapi-5.28.0, libc6 (>= 2.27), libcurl4 (>= 7.16.2), libglib2.0-0 (>= 2.41.1), libssl1.1 (>= 1.1.0)
Suggests: amanda-server (= 1:3.5.1-2+b3) | amanda-client (= 1:3.5.1-2+b3)
Breaks: amanda-client (<< 1:3.5), amanda-server (<< 1:3.5)
Conflicts: amanda
Conffiles:
 /etc/amandahosts a16c7c534d1a6457448e9c385a0fb11e
 /etc/xinetd.d/amanda bb39157494b2622f1a0910312ae0e0ce
Description: Advanced Maryland Automatic Network Disk Archiver (Libs)
 This package contains libraries required by the amanda client and
 server packages and includes the documentation.
Homepage: http://www.amanda.org/
mstormi commented 3 years ago

.conf and amanda version are the same as on a fresh install and that does not exhibit your problem.

I just did another reinstall with the v1.6.2b image.

And ?

dimmenhau commented 3 years ago

the same problem with HOST openhab ERROR: security file '/etc/amanda-security.conf' do not allow to run '/usr/bin/tar' as root for 'amgtar:gnutar_path

and when i uncommented #amgtar:gnutar_path=/bin/tar then this has no effect

mstormi commented 3 years ago

and when i uncommented #amgtar:gnutar_path=/bin/tar then this has no effect

do which tar then try adding this line amgtar:gnutar_path=/usr/bin/tar (assuming your tar is in /usr/bin which it is in Raspi OS per default)

dimmenhau commented 3 years ago

yes... thanks for the solution, now it works. I didn't think of that because I also have a tar program in the /bin directory

[18:47:55] backup@openhab:/$ ls -l /bin/tar
-rwxr-xr-x 1 root root 352280 Apr 23  2019 /bin/tar
[18:48:00] backup@openhab:/$ bin/tar --version
tar (GNU tar) 1.30
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
[18:48:08] backup@openhab:/$ ls -l /usr/bin/tar
-rwxr-xr-x 1 root root 352280 Apr 23  2019 /usr/bin/tar
[18:48:17] backup@openhab:/$ /usr/bin/tar --version
tar (GNU tar) 1.30
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
[18:48:27] backup@openhab:/$