/var/run/dbus/system_bus_socket Permission denied - linux

For some time, when trying to run dbus gives me the following error, even if I'm logged in as root:
gentoo herman # /etc/init.d/dbus start
* Starting D-BUS system messagebus ...
Failed to start message bus: Failed to bind socket "/var/run/dbus/system_bus_socket": Permission denied
* start-stop-daemon: failed to start `/usr/bin/dbus-daemon' [ !! ]
* ERROR: dbus failed to start
Listing directory:
gentoo herman # ls /var/run/dbus/ -all
ls: nie ma dostępu do /var/run/dbus/system_bus_socket: Brak dostępu
razem 1
drwxr-xr-x 2 root root 88 08-14 16:42 .
drwxr-xr-x 20 root root 824 08-16 16:45 ..
?????????? ? ? ? ? ? system_bus_socket
I tried to delete this file as root via the rm command, but displays the same error.
I have installed :
[ebuild R ] sys-apps/dbus-1.4.14 USE="X static-libs -debug -doc (-selinux) -test"
[ebuild R ] dev-libs/dbus-glib-0.94-r1 USE="static-libs -bash-completion -debug -doc -test"
uname -a :
Linux gentoo 2.6.38-gentoo #6 SMP Fri Jul 1 09:41:37 CEST 2011 x86_64 Intel(R) Core(TM)2 Duo CPU T9400 # 2.53GHz GenuineIntel GNU/Linux
Command "dmesg | grep dbus" nothing displays. Reinstalling dbus also in no way helped. Thanks for any help

Looks like you have corruption in your /var filesystem. Try fsck-ing the file-system.
Also, for a quick workaround you can rename the directory and create a new one, because you won't be able to delete the offending file.
Do as root:
# mv /var/run/dbus /var/run/dbus-broken
# mkdir /var/run/dbus
And start the daemon as usual.
But don't forget the fsck! If there is one error in the FS there may be others lurking around.

Related

Linux Named Pipe Mounted on Docker Volume Showing as Regular File

I am trying to use a named pipe to run certain commands from a dockerised guest application to the host.
I am aware of the risks and this is not public facing, so please no comments about not doing this.
I have a named pipe configured on the host using:
sudo mkfifo -m a+rw /path/to/pipe/file
When I check the created pipe permissions with ls -la file, it shows the pipe has been created and intended permissions are set.
prw-rw-rw- 1 root root 0 Feb 2 11:43 file
When I then test the input by catting a command into the pipe from the host, this runs successfully.
Input
echo "echo test" > file
Output
[!] Starting listening on named pipe: file
test
The problem appears to be within my docker container. I have created a volume and mounted the named pipe from the host. When I then start an sh session and ls -l however, the file named pipe appears to be a normal file without the p and permission properties present on the host.
/hostpipe # ls -la
total 12
drwxr-xr-x 2 root root 4096 Feb 1 16:25 .
drwxr-xr-x 1 root root 4096 Feb 2 11:44 ..
-rw-r--r-- 1 root root 11 Feb 2 11:44 file
Running the same and similar echo "echo test" > file does not work from within the guest.
The host is a Linux desktop on baremetal.
Linux desktop 5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
And the guest is an Alpine image
FROM python:3.8-alpine
and
Linux b16a4357fcf5 5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 Linux
Any idea what is going wrong here?
The issue was how the container was being set up. I was using a regular volume used for persisting data not mounting drives and files. I had to change my definition to use the - type: bind
Using volumes without the bind parameter does not allow use of the host file system functionality and only allows data sharing.
Before
volumes:
- static_data:/vol/static
- ./web:/web
- /opt/named_pipes/:/hostpipe
After
volumes:
- static_data:/vol/static
- ./web:/web
- type: bind
source: /opt/named_pipes/
target: /hostpipe

WSL: Unable to view the folders (appear as file) in Windows explorer if using symlink, but works if symlink on the same directory

No idea why but it seems that Windows explorer unable to view symlinked directories that the target is not on the same directory as the source target.
Is there a way to fix it? As it also make win32 applications unable to read the files under the symlinked directory. (I understand Windows equivalent mklink exist, but I need to do it in WSL's ln.)
Thanks a lot.
Sysinfo:
Windows 10 Pro 2004 Build 19041.264
(No idea how to check WSL build number)
WSL2
Subsystem uname: Linux PC 4.19.104-microsoft-standard #1 SMP Wed Feb 19 06:37:35 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Ubuntu:
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic
Example:
$ pwd
/mnt/d/symlink_test/innerFolder
$ mkdir source
$ touch source/testfile
$ ls source
testfile
$ ln -s source target
$ ls -l
total 0
drwxrwxrwx 1 user user 4096 Jun 6 10:55 source
lrwxrwxrwx 1 user user 6 Jun 6 10:55 target -> source
Now view the output in Windows explorer:
As you can tell, the target folder is recognizable by Windows Explorer
As well as the file testfile is accessable in Windows Explorer
Counter Example:
$ rm -rf target #Just clean things up
$ ls
source
$ ln -s /mnt/d/symlink_test/innerFolder/source ../upper_target #make a symlink to upper dir, or any directory that is not in the same dir, with the source dir being absolute path
$ ls -l .. #List files on the upper dir
total 0
drwxrwxrwx 1 user user 4096 Jun 6 11:03 innerFolder
lrwxrwxrwx 1 user user 6 Jun 6 11:04 upper_target -> /mnt/d/symlink_test/innerFolder/source
$ ls ../upper_target
testfile
However, but now, if you view it in Windows Explorer, the upper_target will become a single file instead of a folder, like above:

Two identical NFS shares, but only one of the two gives Stale file handle errors

I have a Linux (raspbian) server:
$ uname -a
Linux hester 4.19.97-v7l+ #1294 SMP Thu Jan 30 13:21:14 GMT 2020 armv7l GNU/Linux
With two directories that have the same user/group/permissions:
$ ls -ld /mnt/storage/gitea/ /mnt/storage/hester/
drwxr-xr-x 2 nobody nogroup 26 Mar 2 10:20 /mnt/storage/gitea/
drwxr-xr-x 3 nobody nogroup 21 Feb 21 11:26 /mnt/storage/hester/
These two directories are exported with the same parameters in the exports file:
$ cat /etc/exports
/mnt/storage/hester 192.168.1.15(rw,sync,no_subtree_check)
/mnt/storage/gitea 192.168.1.15(rw,sync,no_subtree_check)
On another machine (the 192.168.1.15 mentioned in the exports file) I mount both, successfully :
$ mount /mnt/storage/gitea/
$ echo $?
0
$ mount /mnt/storage/hester/
$ echo $?
0
But now weird things happen:
$ ls -l /mnt/storage/
ls: cannot access '/mnt/storage/gitea': Stale file handle
total 0
d????????? ? ? ? ? ? gitea
drwxr-xr-x 3 nobody nogroup 21 Feb 21 11:26 hester
I really can't figure
what's the source of the error, and above all
where I could look for a difference between the two.
I'm open to suggestions for further investigations or answers for the my doubts. Thanks in advance for any useful input!
I finally found the solution, which was to explicitly add an fsid option in exports:
$ cat /etc/exports
/mnt/storage/hester 192.168.1.15(rw,sync,fsid=20,no_subtree_check)
/mnt/storage/gitea 192.168.1.15(rw,sync,fsid=21,no_subtree_check)
I'm not entirely sure as to the reason why this works. From the man page I get that "NFS needs to be able to identify each filesystem that it exports. Normally it will use a UUID for the filesystem (if the filesystem has such a thing) or the device number of the device holding the filesystem (if the filesystem is stored on the device)."
Both these mountpoints are on the same filesystem, so according to the man page they should have the same fsid, but this causes the same directory to be exported, so I think it means that each export needs to have a separate fsid.
One more note: /mnt/storage is an XFS filesystem over a RAID3, so this could also have made NFS confused about UUIDs of devices.

Cannot open shared object file libpng12.so.0

I am trying to run Quartus 13.0 in the following machine:
parrot 4.18.0-parrot10-amd64 #1 SMP Debian 4.18.10-1parrot10 (2018-10-06) x86_64 GNU/Linux.
I have finished installing Quartus 13.0 and when I try to execute it I get this error:
quartus: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory
I have read all the related questions in stack overflow and other websites but no one worked for me.
When looking for that file, I found it. I have tried to do a hard link but it doesn't work either. Search results:
┌─[pepbd#parrot]─[~]
└──╼ $ls -ld $(locate -r libpng.*\.so.*)
lrwxrwxrwx 1 root root 19 nov 19 17:09 /usr/lib/x86_64-linux-gnu/libpng16.so.16 -> libpng16.so.16.34.0
-rw-r--r-- 1 root root 210864 jul 10 13:17 /usr/lib/x86_64-linux-gnu/libpng16.so.16.34.0
-rw-r--r-- 1 root root 18272 oct 14 21:59 /usr/lib/x86_64-linux-gnu/vlc/plugins/codec/libpng_plugin.so
I had the same problem with Quartus Prime 18 on Ubuntu. This worked for me (run as sudo):
wget -q -O /tmp/libpng12.deb http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb \
&& dpkg -i /tmp/libpng12.deb \
&& rm /tmp/libpng12.deb

rpm error - Can not run any package

I try to install some package using yum, but there is a big problem, I don't know how to solve it. Please help me, thank so much!^^
This is yum error:
[root#localhost rpm]# yum
rpmdb: /var/lib/rpm/__db.001: Input/output error
error: db3 error(5) from dbenv->open: Input/output error
error: cannot open Packages index using db3 - Input/output error (5)
error: cannot open Packages database in /var/lib/rpm
CRITICAL:yum.main:
Error: rpmdb open failed
[root#localhost rpm]#
after that, I try to re-build rpmdb but:
[root#localhost rpm]# rm -rf /var/lib/rpm/__db.00*
rm: cannot remove `/var/lib/rpm/__db.001': Input/output error
rm: cannot remove `/var/lib/rpm/__db.002': Input/output error
rm: cannot remove `/var/lib/rpm/__db.003': Input/output error
rm: cannot remove `/var/lib/rpm/__db.004': Input/output error
[root#localhost rpm]#
And this is list file and permission:
[root#localhost rpm]# ls -l
ls: cannot access __db.001: Input/output error
ls: cannot access __db.004: Input/output error
ls: cannot access __db.002: Input/output error
ls: cannot access __db.003: Input/output error
total 52456
-rw-r--r-- 1 root root 2887680 May 26 2016 Basenames
-rw-r--r-- 1 root root 12288 May 26 2016 Conflictname
-????????? ? ? ? ? ? __db.001
-????????? ? ? ? ? ? __db.002
-????????? ? ? ? ? ? __db.003
-????????? ? ? ? ? ? __db.004
-rw-r--r-- 1 root root 1368064 May 26 2016 Dirnames
-rw-r--r-- 1 root root 5251072 May 26 2016 Filedigests
-rw-r--r-- 1 root root 16384 May 26 2016 Group
...
[root#localhost rpm]#

Resources