output
stringlengths 9
26.3k
| input
stringlengths 26
29.8k
| instruction
stringlengths 14
159
|
---|---|---|
I think you misunderstand the purpose of the journal. It is not a log of the actions done by applications, and doesn't record which application caused a change. It is not intended for users or administrators. It's intended as an internal tool for the filesystem.
For performance, disk writes do not always take place in the same order they are issued. If the system is interrupted by a power failure or a system crash before it has time to write everything, the filesystem could be in an inconsistent state. For example, if a file is being moved from a directory to another, it's possible that the disk block with the content of the old directory has already been written, but the disk block with the content of the new directory has not been written. If the system halts just at this time, the file is no longer referenced from either directory and is effectively lost.
There are several techniques to avoid this problem (which is usually known as resilience in filesystem design). Many filesystems, including NTFS, use a journal for this purpose. The journal records actions in the order they are taken, and each action is added atomically, so reading the journal always yields a consistent state. There are filesystems, called log-structured filesystems, where the journal is where all the information about the content of the filesystem is recorded. With others, including NTFS, all the information is eventually written outside the log: the log only contains recent information which might not yet have been written in its “normal” place. Reading a file does not access the log, it access the data directly in the normal place. The log is only read at boot time (more precisely: when mounting the filesystem) to finish any action that has not yet been carried out.
Generally, with a journaling filesystem that isn't log-structured, the journal will only contain very recent actions. The journal usually has limited space and old entries can be overwritten as soon as the corresponding actions have been written to disk, which typically takes no more than a few seconds. You may still be able to see old journal entries if there isn't much activity compared to the journal size, but it isn't something you can count on.
Some Linux filesystems (for example ext4) use a log. But Btrfs isn't one of them. Btrfs achieves resilience through copy-on-write. It never overwrites a disk block that's in use. To make an update, it creates a new block with the new data, then creates a new block for any place that contains the location of the block that needed to be updated, then creates new blocks for the places that contains the location of that, and so on. When it reaches the root¹, it ensures that all child blocks are written, then it updates the root. This way, the root always references always valid blocks.
If you want to track file operations, a filesystem journal is not the way to do it, either on Linux or on Windows. The main tools for that on Linux are LoggedFS and the audit subsystem. See Is it possible to find out what program or script created a given file? and List the files accessed by a program.
¹ That's the root of the block tree, not the root of the directory tree. The distinction isn't really apparent at this level of detail.
|
NTFS provides something called journal. I think it is a record of actions like file rename/move/deletes done by any application. Can I get the similar journal or log on Linux + BTRFS? One BTRFS partition, which is used by only one Linux installation.
Example of NTFS Journal on Google Images:
|
Does Linux provide file system journaling with Btrfs?
|
$ man mkfs.ext4
The size of the journal must be at least 1024 filesystem blocks (i.e., 1MB if using 1k blocks, 4MB if using 4k blocks, etc.) and may be no more than 102,400 filesystem blocks.I think the default size is 128MB but not sure, that might be dated. Anyways I don't think moving journal to another partition on the same HDD will be an improvement. If you move to another physical disk that can help.
The best you can do is to try different sizes and compare to current state with your real workload (not some benchmark tool that may or may not simulate operations similar to your real workload).
|
I'm going to move journal to another partition, but I don't know how to correctly caculate the size needed for journal?
I'm running ext4 file system with 15GB capacity.
|
Keep ext4 journal on another system, how much space would be necessary?
|
You don't need to switch to ext2, you can tune ext3.You can change fsck requirements of a filesystem using tune2fs. A quick look tells me the correct command is tune2fs -c <mount-count>, but see the man page for the details.
You can change how data will be written to the ext3 filesystem during mounting. You want either data=journal or data=ordered. You can further optimize journal commits via other options. Please see this page.Last but not least, on big drives fsck can take a long time while using ext3. Why don't you consider ext4 as an option?
Please comment this answer if I left anything in dark.
|
Leaving out many details, I need to create a read/write file system on a device with the following main goals:Eliminate all writes while data is not being explicitly written.
Reduce all indirect writes when data is written.
Run fsck on boot after unclean unmount.Currently I am using ext3, mounted with noatime. I am not familiar with the details of ext3. In particular, is data written to an ext3 system during "idle" time when no programs are explicitly writing data (specifically, I'm thinking of kjournald and the commit= mount option)?
If I switch to ext2, will that meet all the above requirements? In particular, do I have to set anything up to force an fsck after a sudden power cut?
My options are fat32, ext, ext2, and ext3, plus all of the settings available via mount. Performance is not critical, neither is robustness wrt bad sectors developing over time.
|
Minimizing "idle" writes on a file system
|
By passing -o norecovery to mount, you could mount the filesystem without making use of the journal at all.
Man page for mount, ext3 section:norecovery/noload
Don't load the journal on mounting. Note that if the filesystem was not unmounted cleanly, skipping the journal replay will lead to the filesystem containing inconsistencies that can lead to any number of problems.
|
I hope that this is not a duplicate question. I have seen several similar questions, where the answer was to blacklist the respective device or partition. But in my case, I can't do that (see below). Having said this:
On a debian buster x64 host, I have created a VM (based on QEMU). The VM runs on a block device partition, let's say /dev/sdc1. I have installed the debian system on that partition basically like that (some steps omitted):
#> mkfs.ext4 -j /dev/sdc1
#> mount /dev/sdc1 /mnt/target
#> debootstrap ... bullseye /mnt/targetThen I bind-mounted the necessary directories (/dev, /sys etc.), chrooted into /mnt/target, completed the guest OS installation and booted the VM.
The VM first started without issues. But with every VM reboot, the VM got more problems, which I was repairing at the GRUB and initramfs prompts, until repairing was not possible any more because obviously the ext4 file system had been damaged.
Because I originally thought that I had done something wrong, e.g. forgot to unmount the ext4 partition before starting the VM, I repeated the whole installation from scratch multiple times. The result was the same in every case: After a few restarts, the ext4 file system was so damaged that I couldn't repair it.
Accidentally, I have found the reason for this, but have no idea how to solve the problem. I noticed that e2fsck refused to operate on that partition, claiming that is was in use although it was not mounted and the VM was not running. Further investigation showed that there existed a kernel thread jbd2/sdc.
That means that the host kernel accesses the journal on that partition / file system. When I start the VM, the guest kernel of course does the same. I am nearly sure that the corruption of the file system is due to both kernels accessing the file system, notably the journal, at the same time.
How can I solve the problem?
I cannot blacklist the respective disk or the respective partition on the host, because I need to mount them there to prepare or complete the guest OS installation in a chroot. On the other hand, it doesn't seem possible to tell the host kernel to release the journal as soon as the VM starts.
I have installed a lot of VMs in the past years exactly the same way, but did not turn on the journal when creating their ext4 file system. Consequently, I didn't have that issue with those VMs.
Edit 1
In case it is relevant, when mounting the partition and chrooting into it to complete the guest OS installation, I use the following commands:
cd /mnt
mkdir targetmount /dev/sdc1 targetmount --rbind /dev target/dev
mount --make-rslave target/dev
mount --rbind /proc target/proc
mount --make-rslave target/proc
mount --rbind /sys target/sys
mount --make-rslave target/sysLANG=C.UTF-8 chroot target /bin/bash --loginWhen unmounting, I just do
umount -R targetThe umount command does not report any error.
|
How to keep the kernel from accessing the journal on an ext4 partition?
|
I've finally managed to reduce dramatically this constant writing activity on the disk, though still I don't understand totally how all this is linked. I guess this is not a perfect solution to the problem, but fixed it to me some way, so for if it helps someone:I've edited the /etc/fstab file adding to the options column for the root partition "defaults", since it was set by default to "error..." (I was just experimenting, I don't understand why it makes any difference, but apparently it does).
I've set swappiness to 0, but again, even when this seems to affect to the writing rate, I don't understand why it does in my case, since the computer has 16GB of RAM, so IMHO this (as with the fstab issue) shouldn't make any difference.With this new "low-frecuency-writing-rate" at least I've achieved to be less worried about the disk health, but I'm still concerned about the logic behind this behaviour, so any explanation and/or better solutions will be really welcomed.
|
I'm quite sure it didn't happen before I started using LUKS and LVM on my disk (2 or 3 weeks ago), but now root user is constantly (every 2-3 seconds) writing (not reading, just writing) on disk and I can't figure out why.
The disk has one LUKS partition with one LVM group, which contains both root (ext4) and home (ext4) logical partitions (besides the swap one).
I've used "iotop" command to check what processes are accessing the disk and I've seen it's "jbd2/dm-X-8", executed by root, the process which is writing constantly to the disk.
It only happens with the disk containing the LVM; I have two more ext4 disks mounted (just for storage purposes; they also use LUKS encryption but not LVM) and they "stay quite" while no file operations are made on them.
I've checked log files to see if this writing activity could be due to some kind of logging, but it doesn't seem to be the case.
I've also read questions like this one:
LVM keeping harddisk awake?
But I can't understand why would the system keep on writing the disk even when no changes are being made to it.
On the other hand, I've had some issues with the disk which I though that could be related to other programs crashes, but now I don't know whether it could be related to this constant writing to disk, so I'm quite worried about it.
Is it normal? Can I do something to avoid it or is it something that just "comes with" LUKS/LVM? Or maybe it has nothing to do with LUKS/LVM and I should check some other thing?
|
Why is OS constantly writing to disk (ext4) on a Ubuntu 14.04 machine? Is it normal?
|
Removing the drive mid-session did cause file system corruption. However, what made the problem difficult to solve was that it was compounded by a hardware issue. The external enclosure turned out to be defective. I tried the original IDE/USB adapter cable again, and was able to interface with the drive.
It initially went to an error screen due to booting from the drive after it was removed during sleep. It told me to run fsck manually to clean up the corruption. I did that and it appeared to work normally (i.e., operated without throwing error messages). However, fsck did not correct all of the corruption. The installation was plagued with strange symptoms, like windows losing focus on their own after a few seconds. I finally just reinstalled Linux and that seems to have solved the issues.
|
I need help recovering from a stupid mistake. I was using an old laptop hard drive to evaluate a Linux distro (PCLinuxOS), and have invested some time in customizing it or I would just start over.
It was connected via an IDE/USB adapter cable and was in the middle of a session with the laptop asleep. Without thinking, I decided that was a good time to stick the drive in an enclosure. I disconnected it from the laptop, mounted it in an enclosure, and plugged it into another computer to verify that it was working.
The other computer threw a message that the drive was locked. I disconnected it and plugged it back into the sleeping laptop. The laptop then didn't like the drive either and wouldn't wake from sleep (I forget what the error message was), so I rebooted.
At that time, it booted but didn't accept a login. I tried looking at the drive after booting another Linux distro, but the file manager wouldn't open anything. I used dmesg to check the log and it reported recovery failed, error loading journal.
I tried booting into the recovery option. That reached the point where it tried to mount the drive and failed (message about kernel panic). I tried rebooting normally again (the previous time, it offered to let me start a new session but I didn't understand the options). This time it never got to the login. After the initial loading, it went directly to the same kernel panic message.
Is there a way to bypass these protections to clean out the previous session (contains nothing important), and clear the journal, or do I need to reinstall Linux on the drive?
Update: This problem had two unexpected twists. First, I diagnosed a concurrent hardware issue. However, the actual Linux issue turned out to be non-trivial. Removing the drive (and perhaps accessing it on another system and/or running the Linux recovery?), caused corruption that fsck did not completely fix, and which caused problems but no error messages. So it's a cautionary warning not to blindly trust a tool like fsck to perfectly recover from known corruption. You need to remain vigilant for what may seem like unrelated problems that manifest after the recovery.
|
How to recover after messing with hard drive during mid-session sleep? [closed]
|
You cannot see the real sum of all write from iotop.iotop row number is limited by your terminal height, processes maybe push off the screen by other processes with more recent I/O activities.
Processes that wrote to disk then ended will not stay on the list. (eg. httpd spawn/fork process. Base on PID of httpd, I believe many of httpd child process exit already.)Check size of httpd log files, I believe the size should show noticeable increase.
JBD2 : http://en.wikipedia.org/wiki/JBD2
Overview Quote from wikipedia:The Journaling Block Device (JBD) provides a filesystem-independent interface for filesystem journaling. ext3, ext4 and OCFS2 are known to use JBD. OCFS2 starting from linux 2.6.28 and ext4 use a fork of JBD called JBD2
|
Total DISK READ: 1056.26 K/s | Total DISK WRITE: 9.20 M/s
TID PRIO USER DISK READ DISK WRITE SWAPIN IO> COMMAND
1055 be/4 root 0.00 B 11.64 M 0.00 % 1.99 % [kjournald]
1054 be/4 root 0.00 B 9.72 M 0.00 % 1.70 % [kjournald]
1053 be/4 root 0.00 B 5.21 M 0.00 % 0.73 % [kjournald]
1056 be/4 root 4.00 K 2.77 M 0.00 % 0.39 % [kjournald]
1082 be/4 root 0.00 B 0.00 B 0.00 % 0.34 % [flush-8:48]
1078 be/4 root 0.00 B 0.00 B 0.00 % 0.33 % [flush-8:32]
1080 be/4 root 0.00 B 0.00 B 0.00 % 0.09 % [flush-8:16]
493 be/3 root 0.00 B 1128.00 K 0.00 % 0.04 % [jbd2/sda3-8]
1081 be/4 root 0.00 B 0.00 B 0.00 % 0.01 % [flush-8:64]
1079 be/4 root 16.00 K 228.00 K 0.00 % 0.01 % [flush-8:0]
1126 be/4 root 0.00 B 0.00 B 0.00 % 0.00 % [kjournald]
1125 be/0 root 0.00 B 56.00 K 0.00 % 0.00 % [loop0]
2974 be/4 nobody 4.00 K 12.00 K 0.00 % 0.00 % httpd -k start -DSSL
5506 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
301 be/4 nobody 0.00 B 8.00 K 0.00 % 0.00 % httpd -k start -DSSL
311 be/4 nobody 0.00 B 8.00 K 0.00 % 0.00 % httpd -k start -DSSL
314 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
332 be/4 nobody 0.00 B 8.00 K 0.00 % 0.00 % httpd -k start -DSSL
24916 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
347 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
348 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
16741 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
367 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
368 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
384 be/4 nobody 0.00 B 12.00 K 0.00 % 0.00 % httpd -k start -DSSL
394 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
414 be/4 nobody 0.00 B 12.00 K 0.00 % 0.00 % httpd -k start -DSSL
421 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
422 be/4 nobody 0.00 B 8.00 K 0.00 % 0.00 % httpd -k start -DSSL
21049 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
29281 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
29289 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
3517 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
29389 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
29390 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
29398 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
32207 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSL
874 be/4 nobody 0.00 B 8.00 K 0.00 % 0.00 % httpd -k start -DSSL
29562 be/4 nobody 0.00 B 4.00 K 0.00 % 0.00 % httpd -k start -DSSLkjournald writes 11.64 mb data and stuff. THe sum of ALL other writes are not that much. Also what is jbd2/sda3-8
|
why kjournald uses writes so much?
|
Since this is your root filesystem, adding the mount option in /etc/fstab would pose a bit of a chicken-vs-egg problem: the system would need to know the mount option before starting to mount the root filesystem, but the /etc/fstab file cannot be read until the root filesystem is already mounted.
That's why there is a separate way for specifying mount options for your root filesystem: the rootflags= kernel boot option.
Within GRUB boot menu, you can press E to edit the selected boot entry (non-persistently, for the current boot only!), find the line that starts with the linux or linuxefi keyword, and add rootflags=data=journal to the end of that line. Then follow the on-screen instructions to boot with the modified entry.
If this results in a successful boot, you can add the boot option to /etc/default/grub file (to the GRUB_CMDLINE_LINUX variable) and then run sudo update-grub to make it persistent.
If the initial boot attempt with the rootflags=data=journal fails, you can simply boot again to return to previous state, as the changes made in GRUB boot menu will not be stored on disk.
|
Preface (my 1st attempt ended badly): Fstab adding data=journal crashed my Linux' ext4 upon boot, how to fix?I can't find some reliable step-by-step instructions on How to enable data=journal ext4 fs mode? (It is my root file system.)
Can anyone help? Thank you!
OS: Linux Mint 21.1 CinnamonHere is the tune2fs dump:
$ sudo tune2fs -l /dev/nvme0n1p2
[sudo] password for vlastimil:
tune2fs 1.46.5 (30-Dec-2021)
Filesystem volume name: <none>
Last mounted on: /
Filesystem UUID: f1fc7345-be7a-4c6b-9559-fc6e2d445bfa
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 122093568
Block count: 488354304
Reserved block count: 20068825
Free blocks: 387437462
Free inodes: 121112327
First block: 0
Block size: 4096
Fragment size: 4096
Group descriptor size: 64
Reserved GDT blocks: 817
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 512
Flex block group size: 16
Filesystem created: Sat Jun 16 11:26:24 2018
Last mount time: Sun Jul 2 17:28:19 2023
Last write time: Sun Jul 2 17:28:11 2023
Mount count: 1
Maximum mount count: 1
Last checked: Sun Jul 2 17:28:11 2023
Check interval: 1 (0:00:01)
Next check after: Sun Jul 2 17:28:12 2023
Lifetime writes: 39 TB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 32
Desired extra isize: 32
Journal inode: 8
First orphan inode: 132249
Default directory hash: half_md4
Directory Hash Seed: 48360d76-0cfb-4aed-892e-a8f3a30dd794
Journal backup: inode blocks
Checksum type: crc32c
Checksum: 0xe1a6cb12
|
How to enable data=journal ext4 fs mode?
|
When I do
dbus-send --system --print-reply \
--dest=org.freedesktop.login1 /org/freedesktop/login1/session/self \
"org.freedesktop.login1.Session.SetIdleHint" boolean:falseI get
Error org.freedesktop.DBus.Error.NotSupported: Idle hint control is not supported on non-graphical sessions.which suggests that the problem is logind thinking the session isn't graphical. Indeed:
$ loginctl show-session --property=Type self
Type=ttyThis is why using sddm helps: it sets the session type.
But can we set the session type manually?
org.freedesktop.login1(5) says:SetType() allows the type of the session to be changed dynamically. It can only be called by session's current controller. If TakeControl() has not been called, this method will fail. In addition, the session type will be reset to its original value once control is released, either by calling ReleaseControl() or closing the D-Bus connection. This should help prevent a session from entering an inconsistent state, for example if the controller crashes. The only argument type is the new session type.Xorg server becomes the session controller but doesn't set the type, so it's probably not possible to just set it elsewhere (xinitrc, xsession or something like that) as only the session controller can do it.
But there is a somewhat hack-ish way to do it, by setting $XDG_SESSION_TYPE for pam_systemd(8). I tried putting this into /etc/systemd/system/[emailprotected]/override.conf:
[Service]
Environment=XDG_SESSION_TYPE=x11Now when I log into vt10 and exec startx /etc/X11/Xsession, IdleHint can be updated and is indeed being updated by xss-lock.
To make this a little more robust, my .bash_profile checks $XDG_SESSION_TYPE as well as whether the session is primary (only one session should push its environment variables to the user systemd instance) and starts X, turning vt10 into a very simple desktop manager. :-)
#!bashif [[ ! $DISPLAY && $XDG_SESSION_TYPE == "x11" ]]; then
[[ "$(loginctl show-user --property=Display "$USER")" == "Display=$XDG_SESSION_ID" ]] && primary=: || primary=
journal=(/usr/bin/systemd-cat --priority=info --stderr-priority=warning --level-prefix=false)
[[ $primary ]] && session=(/etc/X11/xinit/xinitrc) || session=(~/.xsession) exec startx "${journal[@]}" "${session[@]}"
exit 1
fi. ~/.bashrc
|
I want to use logind for power management. After 30 minutes of inactivity, I would like the computer to suspend.
Problem is, right now, it suspends after 30 minutes, even when I am active with mouse and keyboard. My logind.conf:
[Login]
HandlePowerKey=suspend
IdleAction=suspend
IdleActionSec=30minMy Ubuntu 15.04 setup is very minimal, and I would like to keep it that way. I login at the console (I don't want a session manager) and then type startx, which launches my ~/.xinitrc that executes i3, my preferred window manager. I do not want to use a desktop environment.
I want the computer to suspend and lock after a given amount of time.
So, my ~/.config/i3/config file includes:
exec "xss-lock -- i3lock -c 000000"The screen locker works fine, and integrates fine. So no problems there.
In case it is of interest:
loginctl show-seat -p IdleHintYields:
IdleHint=yesSeems like that should be "no" if I am active, right?
And if I do this:
gdbus call --system --dest org.freedesktop.login1 --object-path /org/freedesktop/login1/session/c1 --method org.freedesktop.login1.Session.SetIdleHint falseor this:
dbus-send --system --print-reply --dest=org.freedesktop.login1 /org/freedesktop/login1/session/c1 "org.freedesktop.login1.Session.SetIdleHint" boolean:falseReading IdleHint still outputs "IdleHint=yes"!
So what am I missing? How do I keep systemd-logind from suspending while I am active, without using a session manager or desktop environment?
I know that I could use lxqt-powermanagement, for instance, but I think I am correct in assuming this is unnecessary. Of course I can change my personal preferences regarding desktop environment, and will if necessary. This problem seems solvable, though.
|
How do I tell systemd-logind that the session is not idle, without using a desktop environment or session manager?
|
Pulseaudio is started via xdg autostart, which can be found under ~/.config/autostart/ . There's a file called pulseaudio.desktop, and in that file I've changed the default exec line to this one:
Exec=/usr/bin/sg audio -c "pulseaudio -D"When I log in to the system, the pulseaudio process looks like this:
$ ps -eo user,group,args | grep pulse
morfik audio pulseaudio -D
morfik audio /usr/lib/pulseaudio/pulse/gconf-helperAnd now I'm able to listen to the music all the time. I think this is the solution I was looking for.
|
As you can read, for instance here, logind, which is a part of systemd, can set permissions to some devices for user sessions. There's also a vid showing how this kind of behavior works in practice. In short, if you start, let's say, amarok, and you play some song, you will hear the sound till you switch to another user or TTY where you have only the login prompt. That's because the active session became inactive.
I know that you can simply add a user (or users) to a specific group, in this case "audio", and that will 'fix' this issue, but I'm wondering if there's another solution. What I really want is to set some permissions for the process so it could use the sound card all the time, even when all users have their sessions locked.
Is that possible? I'm asking because I often listen to the music and I don't really need my monitor to be on most of the time, so I just lock the screen. But when I lock the screen, the active session becomes inactive and amarok stops playing. And yes, the screen should be locked, and not just turned off.
EDIT:
I don't think that it matters which distro I'm using because if there's systemd on board, it would be the exact same issue. Anyways, I'm using debian sid, but some packages like systemd, udev (and some dependencies) are from experimental branch, and now it's the 219-9 version.
|
Is there a way to set permissions so a process could use a specific device?
|
I found out that after changing /etc/passwd it didn't have the right SELinux settings anymore. I don't really need SELinux on my machine so I solved the problem by disabling SELinux altogether. This is easily done by modifying the file /etc/selinux/config and setting the option SELINUX=permissive (if you want to keep SELinux file labeling to enable it later) or SELINUX=disabled (turning it off completely).
|
I've got a VirtualBox instance of Oracle Linux 7.2 which won't start because of Failed to start Login Service. On the booting sequence the process hangs on this message and doesn't continue, so I can't even log in and execute systemctl status systemd-logind.service.
The probable cause for this is, that I removed zsh while all my users (including root) have zsh set as the default shell (duh!). After that the machine started and I got to the login prompt, but I couldn't login since the shell couldn't be found. I then inserted a Live CD and went into /etc/passwd to change the default shell for users to /bin/bash. After this the login service won't start at all. Any ideas how to fix this?
|
Cannot login: Failed to start Login Service
|
The PAM module does not create a session if the current process is already a member of an existing session. I found the following workaround to create a session from an existing session:
systemd-run --system --scope \
su -lBasically you run su -l inside a system level scope, this is not part of the current user session and so the PAM module will create a session for the su -l process. Once the process has been moved to the session the temporary scope is empty and will be removed.
The only issue is that your current user must have the permission to create scopes at system level and you have to authenticate twice, once for the current user to authenticate creation of the scope and then again as the user for whom you want to create a session.
|
When I use ssh to log in to the root user on my server, an entry 0 is created in /var/run/user because pam_systemd tells systemd-logind to do this. This is an indicator that a user session has been started for uid 0.
Then, when I run su jack, I still only see the 0 entry in /var/run/user; no entry has been made for this session.
However, journalctl shows that a pam session was opened, and /etc/pam.d/su includes common-session, which adds session optional pam_systemd.so. So I think that a user session should have been created.
How can I make su create a user session?
If it's relevant, I'm on Debian 11.
|
Why isn't a systemd user session started by `su`?
|
The login binary is pretty straightforward (in principle). It's just a program that runs as root user (started, indirectly through getty or an X display manager, from init, the first user-space process). It performs authentication of the logging-in user, and if that is successful, changes user (using one of the setuid() family of system calls), sets appropriate environment variables, umask, etc, and exec()s a login shell.
It may be instructive to read the source code, but if you do so, you'll find it easiest (assuming the standard shadow-utils login that Debian installs) to read it assuming USE_PAM is not set, at least until you are comfortable with its operation, or you'll find too much distraction.
|
I am wondering how the login actually works. It certainly is not part of the kernel, because I can set the login to use ldap for example, or keep using /etc/passwd; but the kernel certainly is able to use information from it to perform authentication and authorization activities.
There is also a systemd daemon, called logind which seems to start up the whole login mechanism.
Is there any design document I can look at, or can someone describe it here?
|
How does the Linux login work? [duplicate]
|
I don't know a way to show the currently loaded settings, but the next best thing is to use systemd-analyze:
systemd-analyze cat-config systemd/logind.confAs you probably already read in the manual:Initially, the main configuration file in /etc/systemd/ contains commented out entries showing the defaults as a guide to the administrator.So in /etc/systemd/logind.conf you can see the defaults and if you don't get any entries with systemd-analyze that are not commented out, those are still your settings, because with systemd-analyze you get all config-files shown at once, so if you have an additional drop-in configuration-file under /etc/systemd/logind.conf.d/*.conf it will also gets listed. E.g.:
[root@client systemd]# systemd-analyze cat-config systemd/logind.conf
# /etc/systemd/logind.conf
(...)
[Login]
#NAutoVTs=6
(...)
#SessionsMax=8192# /etc/systemd/logind.conf.d/logind.conf
[Login]
HandlePowerKey=ignoreSo in this example only HandlePowerKey=ignore is set manually and overwrites the default HandlePowerKey=poweroff
If you only want to see the manually set non-defaults, just grep with an invert-match, e.g.
systemd-analyze cat-config systemd/logind.conf | grep -v "^#"Changed settings get loaded by restarting the service
systemctl restart systemd-logind
|
The logind.conf page says something about compiled defaults and multiple configurations files that has precedence rules. All those make it difficult for me to figure out what the current setting is. Is there a way to print the current settings that systemd-logind.service has currently loaded and is using?
|
systemd-logind.service, get current settings?
|
Yes, there is a kexec command-line tool that you can use to kexec into a new kernel.
From an user's point of view, using kexec is about the same as using reboot, except it tends to be quicker since the current kernel loads the new one and starts executing it (bypassing BIOS, firmware, boot loader, etc.)
The point of logind offering idle actions such as "kexec" (or "reboot") is to help with keeping your system always up-to-date, which for kernel upgrades typically needs a reboot. The idle detection helps figure out when it would be a good time to reboot your system (hopefully at a time when it won't cause too big of a disruption) and rebooting it often (assuming it's idle frequently enough) will ensure it boots into a new kernel not too long after the package manager installs an updated one.
It's, of course, a setting not all users would agree with, so of course it's not the default setting for this option (the default is "ignore" which doesn't do anything...)To understand what the kexec action triggers exactly, you can start looking at systemctl kexec, which is a parallel to systemctl reboot. Its documentation says:Shut down and reboot the system via kexec. This is equivalent to systemctl start kexec.target --job-mode=replace-irreversibly --no-block.So this goes through a special kexec.target, which is typically configured to require a systemd-kexec.service, which then calls the /usr/lib/systemd/systemd-shutdown tool with a kexec argument (through a systemctl --force kexec, it turns out...).
To go further, you need to look at the source code, and you'll see that systemd-shutdown kexec will simply try to reboot using kexec -e, with logic to fallback to a "normal" reboot if that fails.
Looking at the kexec(8) man page, you'll see kexec -e is all that's needed to execute a kexec reboot, so that's all that systemd integrates with.
The other part that's missing is the part that loads the booting kernel into memory, the part that executes the kexec -l so that the actual execute will work. That's another rabbit hole to follow. I suggest that as an exercise to the reader (or perhaps quite appropriate for a separate question here at U&L!)
|
The logind.conf man page says:IdleAction=
Configures the action to take when the system is idle. Takes one of "ignore", "poweroff", "reboot", "halt", "kexec", "suspend", "hibernate", "hybrid-sleep", "suspend-then-hibernate", and "lock". Defaults to "ignore".I've not seen the kexec value explained anywhere. What exactly does kexec do here?
Is there an equivalent kexec(8) command line that it runs?
In what cases would it be useful to hot reboot into a new kernel on system idle anyway?
|
What does logind.conf `IdleAction=kexec` do exactly?
|
Ok, I discovered a solution. I'm not sure how correct it is, but it is working, although with a few glitches.
The main solution was to add line
-session optional pam_systemd.soto file /etc/pam.d/login and
session optional pam_systemd.soto file /etc/pam.d/common-session. This requires package libpam-systemd.
This worked for sessions in a tty console, but still had no effect on gui sessions. In order to have it effective for gui sessions, I worked around that by bypassing slim, logging in at the console, and running startx.
|
I have one Debian Sid system that uses logind for its user sessions. It is odd that that system is not even running systemd. The logind sessions are independent of X and are in effect for the tty sessions before X is even started. However, I do not know how this occurred and even the distro's lead developer cannot explain it.
However, my main system is another Debian Sid distro (Siduction Linux) that is running systemd 204-7. logind is running and active, but it is not managing the user sessions. My question is, how would I go about switching session control from console-kit to logind?
|
How do I get Debian to use systemd-logind for user session control?
|
Masking the getty services turned out to be the way to go. Adding console-getty.service and [emailprotected] to the list of masked services disabled the login prompt on TTY1. Effectively systemd-logind is responsible for starting additional virtual terminal sessions, and getty is responsible for serving login prompts on them, in seeming direct contradiction of their names.
|
I'm running essentially an X-based kiosk program on an embedded Linux and I want to disable the ability to log-in under some configurations. I want to run some distro-nonspecific console commands in the Exec of one systemd service early in boot to disable all login prompts, including the one on the first virtual terminal, so that only the output of systemd services appears on the mandatory VT. Also I need another service to be able to start X and a fullscreen application.
Currently my service file is ordered
Before=systemd-logind.service systemd-networkd.service NetworkManager.service dhclient.service
Before=MyKioskApp.serviceWantedBy=basic.targetAnd the executable runs
for UNIT in systemd-logind.service systemd-networkd.service systemd-networkd.socket NetworkManager.service dhclient.service
do
systemctl stop $UNIT
systemctl mask --runtime $UNIT
doneThis combined with other tricks does most of what I want, but if my kiosk application hits an error and exits I still see a login prompt. Adding the getty service to the list seems to break things so X refuses to start. I think there's a PAM module of some sort I need to disable but I don't have the command I've seen recommended for updating that config.
I can't add new packages for this task but I can modify the filesystem.
|
How do I disable all login prompts, including on VT 1 on a systemd system
|
No. The code does not listen for it, and it can blithely continue running without access to any devices (and no expectation of re-gaining access). I believe this is an oversight in Xorg's integration with systemd-logind.
Currently Xorg requires to be run in the "scope" unit associated with the session. Although it could be extended to accept the XDG_SESSION_ID environment variable instead. That's what originally prompted my question.
If the session ends by the session leader (first process) exiting, the scope will only be stopped if the upstream default KillUserProcesses=yes has been left in logind.conf. Otherwise, the session is "abandoned", allowing processes like GNU Screen or tmux to continue running. Most distributions disable KillUserProcesses; it's a very questionable default.
loginctl terminate-session will always stop the scope unit. Although, stopping the scope unit initially sends SIGHUP, apparently because "bash and friends" tend to ignore SIGTERM. For some reason. Xorg, like many daemons, treats SIGHUP specially. Xorg treats SIGHUP as a signal to reset the server, instead of quitting. I think this means systemd would then send SIGKILL, after a timeout had elapsed and Xorg had still not exited. Xorg would be forcibly killed without having properly cleaned up.
Steps to reproduce Xorg not quitting:Run nohup /usr/libexec/Xorg :5 vt5 -keeptty -novtswitch as a non-root user. (vt5 assuming you run this from text console 5, AKA ctrl+alt+f5).
Switch to a different text console. Log in. Use ps -ax | grep bash to find the PID of the bash shell running on tty5. Run kill -SIGHUP <PID>
The bash process exits, logging out your session. If you switch back to VT 5, you will see the console login prompt. But the Xorg process is actually still running!
In the log file for this instance of Xorg, you will see that it tried to release and re-open all the devices it still thinks belong to it. That's what happens when Xorg is reset. None of the devices are available to it now the session is over, so all the attempts to open devices fail.
Xorg resets because it is sent SIGHUP (despite nohup :-). I noticed this because I'd attached gdb to it. SIGHUP is received because Xorg re-opened /dev/tty5 itself, acquiring it as the "controlling terminal". You can see the controlling terminal in ps -ax | grep Xorg. When you killed bash to force a logout, the system generated a hangup (HUP) on the TTY. Unless you have KillUserProcesses set, nothing stronger than SIGHUP will be sent to Xorg.Without novtswitch, the reset also attempts to switch VTs. But non-root X can never change the active VT. Since step 3 is run from a different VT, this VT switch attempt will fail. The failure to switch VTs causes Xorg to exit.
The nohup in these steps is required otherwise Xorg will be terminated. This has to do with shell job management. Proof: Xorg also continues running if you don't use nohup, but instead disable job management using the command set +m.
|
Xorg integrates with systemd-logind, allowing it to effectively open the devices it needs without being run as the super-privileged root user. When the systemd-logind session ends, systemd-logind revokes Xorg's access to the devices (revoking the file descriptors[1]).
But does ending the session actually cause Xorg to quit?
This question was written as of Fedora version 26, xorg-x11-server-Xorg-1.19.3-4.fc26.x86_64.[1] Or technically, I think logind revokes the descriptions created when it opened the devices. File descriptors are per-process; logind can't directly affect the descriptors in the Xorg process.
|
Does the current version of Xorg listen for the systemd-login session being closed?
|
I had to install libpam-systemd.
Once I installed it and rebooted, it worked.
|
I have an headless Raspbian Jessie on a Raspberry Pi. I've set it up as read-only root to prevent SD card corruption.
When I try to use loginctl on it, it doesn't show any active sessions. But as I understand, it should at lease show the current SSH session I'm working on.
$ loginctl
SESSION UID USER SEAT 0 sessions listed.After trying search a lot on Google to solve this, I think that it might have something to do with systemd and/or dbus not working properly. See the output of following commands.
$ systemctl --user
Failed to get D-Bus connection: Connection refused$ pgrep -af dbus
542 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
|
loginctl doesn't show anything
|
The relevant manual page can be invoked with man authconfig.
In EL variants, the configuration file is /etc/sysconfig/authconfig, but the documentation does not specify any setting for systemd. On CentOS7/RHEL7, authconfig is a symbolic link to the file, /usr/share/authconfig/authconfig.py.
command -v authconfig
ls -l /usr/bin/authconfigWithin /usr/share/authconfig, the file, authinfo.py contains references to systemd.
cd /usr/share/authconfig
grep systemd *Within this file, there are many arrays defining "stacks." In particular, there is an array specified for sessions. One might change the value from True to False and afterward test if the change caused the desired effect; but, I think this file probably gets overwritten on update.
[True, SESSION, LOGIC_OPTIONAL, "systemd", []]One could script the removal of the configuration line instead of calling authconfig directly.
#!/usr/bin/env bash
#
# File: /usr/local/sbin/enable_sssd.sh
#
authconfig --update --enablesssd
sed -ie "/-session[[:space:]]\+optional[[:space:]]\+pam_systemd.so/d" /etc/pam.d/system-auth
sed -ie "/-session[[:space:]]\+optional[[:space:]]\+pam_systemd.so/d" /etc/pam.d/password-authThe PAM session software creates and destroys the login session. So, PAM session handler does things like modifying utmp, setting up an environment, storing Kerberos tickets, et al. But, you should also have session sufficient pam_sss.so to handle sessions.
|
After converting a server to use SSSD for authentication the following line in /etc/pam.d/system-auth and /etc/pam.d/password-auth caused very long (10-20 second) hangs when SSHing into the server:
-session optional pam_systemd.so
Removing this line fixed the hang, but of course whenever authconfig --update --enablesssd is run it regenerates those files, with that line.
How can I prevent this line from being generated? And what is causing it to be generated? It still was there after removing /etc/systemd/logind.conf and rerunnning authconfig...
It also seems that the man pages for system-auth, password-auth, pam_systemd don't have any useful info, but perhaps that's just me
|
Where does the pam_systemd.so line come from in system-auth and password-auth?
|
Finally I found a solution, but by luck because I'm using openbox:
And in my case under LXDE, then, edit ~/.config/openbox/lxde-rc.xml and in <keyboard> ... </keyboard> section add:
<keybind key="XF86PowerOff">
<action name="Execute">
<command>command or script to run</command>
</action>
</keybind>For example for my test I just open a popup saying "Power off pressed":
<keybind key="XF86PowerOff">
<action name="Execute">
<command>zenity --info --text="Power off pressed"</command>
</action>
</keybind>Then in a terminal type openbox-lxde --reconfigure so that it is taken into account, press your tower case power button and the following message will appear:Edit: I forgot to mention (but not sure this is mandatory), I have system shutdown button set to nothing, to check this, go to "Start menu" -> "System" -> "Preferences" -> "Power Manager", and ensure that "When power button is pressed" is set to "Do nothing":
|
I looked around and didn't found anything on this, for what I've seen, people always have been satisfied with what logind.conf is offering, here is the interesting part of man logind.conf:
HandlePowerKey=, HandleSuspendKey=, HandleHibernateKey=, HandleLidSwitch=, HandleLidSwitchDocked=
Controls how logind shall handle the system power and sleep keys and the lid switch to trigger actions such as system power-off or suspend. Can be one of "ignore", "poweroff", "reboot", "halt", "kexec", "suspend", "hibernate", "hybrid-sleep", and "lock". If "ignore", logind will never handle these keys. If
"lock", all running sessions will be screen-locked; otherwise, the specified action will be taken in the respective event. Only input devices with the
"power-switch" udev tag will be watched for key/lid switch events. HandlePowerKey= defaults to "poweroff". HandleSuspendKey= and HandleLidSwitch= default to
"suspend". HandleLidSwitchDocked= defaults to "ignore". HandleHibernateKey= defaults to "hibernate". If the system is inserted in a docking station, or if
more than one display is connected, the action specified by HandleLidSwitchDocked= occurs; otherwise the HandleLidSwitch= action occurs. A different application may disable logind's handling of system power and sleep keys and the lid switch by taking a low-level inhibitor lock
("handle-power-key", "handle-suspend-key", "handle-hibernate-key", "handle-lid-switch"). This is most commonly used by graphical desktop environments to take
over suspend and hibernation handling, and to use their own configuration mechanisms. If a low-level inhibitor lock is taken, logind will not take any action
when that key or switch is triggered and the Handle*= settings are irrelevant.I then repeat the interesting part here:Controls how logind shall handle the system power and sleep keys and the lid switch to trigger actions such as system power-off or suspend. Can be one of
"ignore", "poweroff", "reboot", "halt", "kexec", "suspend", "hibernate", "hybrid-sleep", and "lock".Or I am in the wrong way and this is just for keyboard keys, and not power button?
In any case, previously, it was easy with acpi, one just had to replace the power_button script in /usr/lib/acpid/, isn't there something equivalent for systemd ?
NB (IMPORTANT): How can I run a script on keyboard power key press with systemd? is NOT a duplicate since has been wrongly marked as duplicate of How to change Power button shutdown action to run a script under systemd that DOES NOT answer my question, since this is to manage power key from keyboard, not power button:And as suggested by @TooTea it may be true that button integrated into the case is seen as a keyboard button press, anyway, after having checked I have no such /dev/input/by-path/platform-i8042-serio-0-event-kbd file to monitor key pressed, then it definitively does not answer my question.
|
Is it possible to run a script on power button press with systemd?
|
Presumably the commands run by at are in a different environment, without access to your tty device and dbus settings and so on.
Systemd has its own version of the at command. You can use it to run your command in an environment that seems to be ok for further systemd commands.
So use the equivalent command:
systemd-run --user --on-active=5min /bin/systemctl suspendFor perfect accuracy in the wait time of 5 minutes, you need to add option --timer-property=AccuracySec=1.
|
I'd like to suspend my laptop using at:
echo "systemctl suspend" | at now + 5 minutesSuspension does not happen, instead I find a mail from at in /var/spool/mail/me:
Failed to set wall message, ignoring: Interactive authentication required.
Failed to suspend system via logind: Interactive authentication required.
Failed to start suspend.target: Interactive authentication required.
See system logs and 'systemctl status suspend.target' for details.Alright, logind requires authentication when at runs systemctl suspend. This is interesting since when I run systemctl suspend directly, without at, no authentication is required and the machine goes into suspension.
I've made sure that the commands executed with at are run by the same non-root user as the commands run directly using echo "echo $(who) > who.txt" | at now.
Suspecting that authentication is required in at because it runs the commands via /bin/sh (which is an alias for bash), I executed systemctl suspend after starting /bin/sh: Suspending happens immediately without authentication, indicating that the nested shell is not the reason why suspending fails when done with at.
I get the same behavior and very similar mails when doing echo "reboot" | at now and echo "shutdown now" | at now.
My question is: How does logind figure out that it's at that tries to suspend, reboot, or shut down the machine and how can I tell logind that it should allow at to execute those commands without authentication?I'm on Arch Linux 4.18.1 with at version 3.1.19.
|
Shutdown, suspend require authentication when scheduled in at
|
So, after a lot of head scratching I was able to get a workable solution to this which turned out to be simpler, if less than elegant, than I thought. Let's cut to the chase and look at the functional unit file:
[Unit]
Description=Emby Podman Container
[emailprotected]
[emailprotected][Service]
User=emby
Group=media
Restart=on-failure
ExecStartPre=/usr/bin/rm -f /home/emby/%n-pid /home/emby/%n-cid
ExecStartPre=-/usr/bin/podman rm emby
ExecStart=/usr/bin/podman run --conmon-pidfile /home/emby/%n-pid --cidfile /home/emby/%n-cid \
--name=emby --rm --cgroup-manager=systemd \
-e TZ="$TZ" \
-p 8096:8096 -p 8920:8920 \
-v /opt/docker/storage/emby:/config \
-v /media/media/:/media \
emby/embyserver
ExecStop=/usr/bin/sh -c "/usr/bin/podman rm -f `cat /home/emby/%n-cid`"
KillMode=none
Type=forking
PIDFile=/home/emby/%n-pid[Install]
WantedBy=multi-user.targetThe key insight here is to let systemd manage the user session itself (not that it will let you do anything else). The use of BindsTo and After are essential in this configuration as they will force the user session for the emby user to be fully created before the emby service is actually started. Additionally, this makes it so that the administrator (read: me) won't have to log into every user to enable the session which should help as more services and users are added.
Some other useful notes about the setup:The -d flag has been removed from podman so that stdout can be viewed via journalctl -fu emby _TRANSPORT=stdout. Handy for testing and verification.
Per the [emailprotected] man page, the user service must be instantiated with the UID and not the name (on my system emby == 1012). I haven't found a way to do expansions in any of the non-Exec commands so, for now, this is hardcoded. If anybody knows how to clean this up I would love to hear it.
The PID file has been moved into the user's home directory as /run is not word writable (good, thing, too).Some other approaches I tried which didn't work:Starting the user service directly in ExecPre. This unit runs as the user so it can't start systmd for that user (chicken, meet egg).
Automatically logging the user in. Note: this probably could work but there are security implications to a fully logged in user.
Changing users via su. The systemd maintainer takes a pretty dim view of su and refuses to fix it. Religious arguments aside, su plain doesn't work.Additional References:systemd.unit man page: As always, grokking the man pages is a goodness.
Arch Wiki Page for systemd/User: Has a great description of some of the internals of systemd's user management.EDIT:
Of course, as soon as I post this I manage to find the magic search string which leads me to an article that obviates my approach.
In the interest of brevity, the salient points from the article above involve running the service as root and using --uidmap/--gidmap to map the container's root user to the desired system user.
This solution is, however, podman specific so I will leave the above in place for anyone else whose non-root, non-podman processes need access to systemd.
Finally, I think my solution is a hair more secure as, if an attacker compromises the container runtime, the scope is still limited to my unprivileged user. Though, this might be offset by the increased attack surface of another user service running so, perhaps, it is a wash.
|
Question
How do I run an arbitrary service as an arbitrary user at boot with a logind session (specifically including all of the goodies under /run/user/uid) created for this user and without having to explicitly log in as this user?
Background
I am in the process of converting a docker-compose deployment for use with rootless podman + systemd services. I have figured out most of the podman stuff but am specifically struggling with getting it to run via systemd.
In my previous deployment I had created a user account for each service and configured the containers to run as this user. This was very handy from a filesystem control and maintenance standpoint and is really the primary property I wish to preserve.
To that end, I found this askubuntu question which gets me the ability to embed the user directly into my systemd job and have it execute as said user. Perfect.
Now comes the wrench: Fedora moved to cgroups v2 which is now handled by systemd and is, in fact, the reason for this effort in the first place. As a result, podman requires the ability to talk to systemd which, in turn, basically requires the login session set up by logind (if I am understanding this link correctly). I am no systemd expert so please correct me on any of this.
I did find another question about waiting for a user session which comes close to what I am after but seems to indicate this isn't possible. My case is different in two primary respects:I do not want to wait for any session (eg. this should run on boot with no interaction).
My solution needs to be robust enough to suffer manual intervention bringing the service up and down.So, as stated above, I am really looking for any way to get a systemd service to run as a particular user with enough of a login environment for the service application to connect to systemd (or, at least, the cgroups v2 portion of it).
Finally, below is a sample systemd unit file for one of the services which works as expected until it needs to connect to systemd. Additionally, the podman invocation works completely when executed manually as my logged in user.
[Unit]
Description=Emby Podman Container[Service]
User=emby
Group=emby
Restart=on-failure
ExecStartPre=/usr/bin/rm -f /%t/%n-pid /home/emby/%n-cid
ExecStart=/usr/bin/podman run --conmon-pidfile /%t/%n-pid --cidfile /home/emby/%n-cid -d --name=emby --cgroup-manager=systemd -e TZ="$TZ" -p 8096:8096 -p 8920:8920 -v /opt/docker/storage/emby:/config -v /media/media/:/media emby/embyserver
ExecStop=/usr/bin/sh -c "/usr/bin/podman rm -f `cat /home/emby/%n-cid`"
KillMode=none
Type=forking
PIDFile=/%t/%n-pid[Install]
WantedBy=multi-user.target
|
Run Systemd Service as Another User with Logind Session
|
There's no universal and guaranteed reliable way to tell if a screen is internal.
There's simply no standardized hardware flag that would tell you "this screen is physically built into the same case as the rest of the computer". So you need to guess, and the type of the interface is a good source of some hints, just because there aren't any video interfaces that would be commonly used both internally and externally.
Your idea to look at logind is reasonable. The important piece is manager_count_external_displays in logind-core.c, which uses this list of "likely external" interfaces:
"VGA-", "DVI-I-", "DVI-D-", "DVI-A-"
"Composite-", "SVIDEO-", "Component-",
"DIN-", "DP-", "HDMI-A-", "HDMI-B-", "TV-"As mentioned in an accompanying comment, they prefer to possibly miss some external displays than to mistake an internal one for external (and block suspending the system for no reason). If you'd rather do it the other way, you probably need to look just for eDP and LVDS as the "likely internal" interfaces.
|
I am looking for a consistant way of getting the name of the built-in monitor in a laptop. To be exact, I am looking for the name of the monitor that will be turned off when the lid is closed. I was just wondering if there is a way without any hypothesis on the name (not listing every existing names...).
At first, it seems that the only difference is the way that the monitor is plugged to the motherboard, so names must be a relevent clue but I was wondering if it was possible without that.
For example, I was looking at how logind was able to differenciate HandleSwitchLid and HandleSwitchLidDocked, but I did not find anything very useful as sometimes sources are not very easy to understand
|
Differentiate internal and external monitors
|
I think the VT switch caused gnome-shell to release input devices (ReleaseDevice method in logind dbus API). This causes logind to remove the FD for the device.
So this is most likely affected by the issue #8344 "session_device_free(sd) also drops all other device fds of that session" . A fix is merged for systemd v239.
I confirmed this by testing a pre-release version of systemd, which included the fix.... to check if it was a similar issue to "What could be using 6GB of my swap?"Quite possibly. The fix for that is also merged for v239, and hence not present in systemd-238-7.fc28.1.x86_64.
|
Right now my system is doing disk IO when I switch from a text console on tty6 to GNOME on tty3. 1.4GB of swap is in use.
On tty6, I ran sudo lsof -p 1 | grep dev, to check if it was a similar issue to "What could be using 6GB of my swap?". Based on the background information there, I would expect PID 1 to have open file descriptors for /dev/dri/.... But it didn't have any!
The same is true when I ran the command from tty3. The output is different though, as it now includes open file descriptors for /dev/input/....
These results are repeatable, if I switch back to tty3 and try again etc.
N.B. This is code that I have touched in upstream systemd, so it could well be my fault :-). Looking at the systemd git commit messages for src/login, I can't find a clear deliberate change in this behaviour.
I have a VM for each of Fedora 27 and Fedora 28. They Fedora 27 looks ok when I boot them and run lsof on the serial console. However, on the Fedora 28 VM, if I run chvt 6, then the same problem shows up.EDIT: this apparent regression goes away if I set SELinux to "permissive" (policy violations are logged, but allowed). I've submitted it as an issue in Fedora. SELinux interferes with systemd-logind restart codesystemd-238-7.fc28.1.x86_64 (should include the fix for "What could be using 6GB of my swap?")
gnome-shell-3.28.1-3.fc28.x86_64This does not happen on the Fedora 27 VM withsystemd-234-10.git5f8984e.fc27.x86_64
gnome-shell-3.26.2-5.fc27.x86_64
|
Why does systemd *not* have `/dev/dri/...` open?
|
I had the same issue and eventually found this:
https://github.com/systemd/systemd/issues/7074
I tried all kinds of tricks but what finally fixed it for me was simply:
sudo apt-get install nscdHere's what "apt-cache show nscd" says:
Description-en: GNU C Library: Name Service Cache Daemon
A daemon which handles passwd, group and host lookups
for running programs and caches the results for the next
query. You should install this package only if you use
slow services like LDAP, NIS or NIS+.
|
I have recently upgraded the workstations from Debian 9 to Debian 10. With the
old version people have been able to mount USB drives and play and record sound
(for video conferences). After the update neither of it works.
Remote user accounts
There have been some peculiarities with the user accounts, so perhaps that is
the source of the issue. We use NIS and NFS to provide user accounts and home
directories on all the machines. After the upgrade to Debian 10 I needed to add
a NIS to /etc/nsswitch.conf because they were on compat before and now
only had files. Also ypbind was not running because it no longer used
-broadcast as a default startup option. I added a new systemd file at
/etc/systemd/system/ypbind.service:
[Unit]
Description=ypbind
Wants=network-online.target nis.service
After=network-online.target nis.service[Service]
Type=simple
ExecStart=/usr/sbin/ypbind -broadcast -foreground[Install]
WantedBy=multi-user.targetWith that the user accounts were there and the home directories as well. On the
command line I could also log in. But the LightDM display manager was still not
letting the users in. So in /etc/lightdm/lightdm.conf in section [LightDM]
I added the option greeter-show-manual-login = True and from then on the
remote users could log in. Some machines still had GDM as their default display manager, there the logins showed the same behavior that LightDM did before I changed the configuration. The password check passed, the screen might turn black for a brief moment and then the login screen is shown again. The same occurs when users have exceeded their quota and the files needed to establish the session (.Xauthority?) could not be created.
The peculiar thing is that when I am logged in via SSH and also on the actual
screen, these sessions show up properly with who:
$ who
ueding pts/0 2019-08-26 12:42 (131.220.226.20)
ueding tty7 2019-08-26 12:43 (:0)But then at the same time the session is not listed with loginctl:
$ loginctl
No sessions.When I do the same on my personal Fedora 30 laptop with local user accounts I
have this output of who:
$ who
mu tty1 2019-08-25 10:33 (:0)
mu pts/0 2019-08-25 10:34 (:0)
mu pts/1 2019-08-26 12:08 (:0)
mu pts/2 2019-08-26 12:14 (:0)
mu pts/3 2019-08-26 12:42 (:0)
mu pts/4 2019-08-26 12:38 (:0)
mu pts/5 2019-08-26 12:55 (:0)And also loginctl shows something sensible:
$ loginctl
SESSION UID USER SEAT TTY
1 1000 mu seat0 1 sessions listed.I have created a new local user account with UID 50000 on one of the Debian 10 workstations and found that I can log in, have the session show up in loginctl and also the removable media and sound issues described below are not there, sound and removable media works. So this definitely is an issue with the users coming from NIS.
The one thing that has hit me a few times so far is that for historical reasons
the user ids that we have given out start with 500. But my user ueding has
uid 1085, so even if that was a problem with accounts not being listed, this
account should be fine because the default starting values for user ids which
are not considered system users is 1000.
I do not have sufficient experience but I just have the feeling that somehow
the user accounts are not fully in the system, that there is just something
still missing.
One user with uid 536 had to enter his GNOME keychain password after login. I
am not sure whether he has different passwords there, but it could as well be
that it was not unlocked during startup. This might not mean anything, though.
auth.log
With the current state this is everything that shows up in /var/log/auth.log since booting the machine, connecting as root via SSH to retrieve the log and logging in on the machine itself with my NIS user. Also the monitoring user has logged in via SSH to retrieve some information for my monitoring system.
Sep 3 12:45:42 helios systemd-logind[497]: New seat seat0.
Sep 3 12:45:42 helios systemd-logind[497]: Watching system buttons on /dev/input/event1 (Power Button)
Sep 3 12:45:42 helios systemd-logind[497]: Watching system buttons on /dev/input/event0 (Power Button)
Sep 3 12:45:42 helios systemd-logind[497]: Watching system buttons on /dev/input/event3 (Cherry USB keyboard)
Sep 3 12:45:42 helios systemd-logind[497]: Watching system buttons on /dev/input/event4 (Cherry USB keyboard System Control)
Sep 3 12:45:46 helios sshd[650]: Server listening on 0.0.0.0 port 22.
Sep 3 12:45:46 helios sshd[650]: Server listening on :: port 22.
Sep 3 12:45:57 helios lightdm: pam_unix(lightdm-greeter:session): session opened for user lightdm by (uid=0)
Sep 3 12:45:57 helios systemd-logind[497]: New session c1 of user lightdm.
Sep 3 12:45:57 helios systemd: pam_unix(systemd-user:session): session opened for user lightdm by (uid=0)
Sep 3 12:47:08 helios sshd[1339]: rexec line 16: Deprecated option UsePrivilegeSeparation
Sep 3 12:47:08 helios sshd[1339]: rexec line 19: Deprecated option KeyRegenerationInterval
Sep 3 12:47:08 helios sshd[1339]: rexec line 20: Deprecated option ServerKeyBits
Sep 3 12:47:08 helios sshd[1339]: rexec line 31: Deprecated option RSAAuthentication
Sep 3 12:47:08 helios sshd[1339]: rexec line 38: Deprecated option RhostsRSAAuthentication
Sep 3 12:47:08 helios sshd[1339]: Connection closed by 131.220.226.3 port 39932 [preauth]
Sep 3 12:47:16 helios sshd[1341]: rexec line 16: Deprecated option UsePrivilegeSeparation
Sep 3 12:47:16 helios sshd[1341]: rexec line 19: Deprecated option KeyRegenerationInterval
Sep 3 12:47:16 helios sshd[1341]: rexec line 20: Deprecated option ServerKeyBits
Sep 3 12:47:16 helios sshd[1341]: rexec line 31: Deprecated option RSAAuthentication
Sep 3 12:47:16 helios sshd[1341]: rexec line 38: Deprecated option RhostsRSAAuthentication
Sep 3 12:47:16 helios sshd[1341]: reprocess config line 31: Deprecated option RSAAuthentication
Sep 3 12:47:16 helios sshd[1341]: reprocess config line 38: Deprecated option RhostsRSAAuthentication
Sep 3 12:47:19 helios sshd[1341]: Accepted password for root from 131.220.226.160 port 44060 ssh2
Sep 3 12:47:19 helios sshd[1341]: pam_unix(sshd:session): session opened for user root by (uid=0)
Sep 3 12:47:19 helios systemd-logind[497]: New session 2 of user root.
Sep 3 12:47:19 helios systemd: pam_unix(systemd-user:session): session opened for user root by (uid=0)
Sep 3 12:47:20 helios sshd[1367]: rexec line 16: Deprecated option UsePrivilegeSeparation
Sep 3 12:47:20 helios sshd[1367]: rexec line 19: Deprecated option KeyRegenerationInterval
Sep 3 12:47:20 helios sshd[1367]: rexec line 20: Deprecated option ServerKeyBits
Sep 3 12:47:20 helios sshd[1367]: rexec line 31: Deprecated option RSAAuthentication
Sep 3 12:47:20 helios sshd[1367]: rexec line 38: Deprecated option RhostsRSAAuthentication
Sep 3 12:47:20 helios sshd[1367]: reprocess config line 31: Deprecated option RSAAuthentication
Sep 3 12:47:20 helios sshd[1367]: reprocess config line 38: Deprecated option RhostsRSAAuthentication
Sep 3 12:47:20 helios sshd[1367]: Accepted publickey for monitoring from 131.220.226.3 port 39970 ssh2: RSA SHA256:ulxULyONiGRB8VUFctWd/WSBcRxjGX+5Dq/IXyZS+gI
Sep 3 12:47:20 helios sshd[1367]: pam_unix(sshd:session): session opened for user monitoring by (uid=0)
Sep 3 12:47:20 helios systemd-logind[497]: New session 4 of user monitoring.
Sep 3 12:47:20 helios systemd: pam_unix(systemd-user:session): session opened for user monitoring by (uid=0)
Sep 3 12:47:20 helios sshd[1385]: Received disconnect from 131.220.226.3 port 39970:11: disconnected by user
Sep 3 12:47:20 helios sshd[1385]: Disconnected from user monitoring 131.220.226.3 port 39970
Sep 3 12:47:20 helios sshd[1367]: pam_unix(sshd:session): session closed for user monitoring
Sep 3 12:47:20 helios systemd-logind[497]: Session 4 logged out. Waiting for processes to exit.
Sep 3 12:47:20 helios systemd-logind[497]: Removed session 4.
Sep 3 12:47:30 helios systemd: pam_unix(systemd-user:session): session closed for user monitoring
Sep 3 12:47:32 helios sshd[1398]: rexec line 16: Deprecated option UsePrivilegeSeparation
Sep 3 12:47:32 helios sshd[1398]: rexec line 19: Deprecated option KeyRegenerationInterval
Sep 3 12:47:32 helios sshd[1398]: rexec line 20: Deprecated option ServerKeyBits
Sep 3 12:47:32 helios sshd[1398]: rexec line 31: Deprecated option RSAAuthentication
Sep 3 12:47:32 helios sshd[1398]: rexec line 38: Deprecated option RhostsRSAAuthentication
Sep 3 12:47:32 helios sshd[1398]: reprocess config line 31: Deprecated option RSAAuthentication
Sep 3 12:47:32 helios sshd[1398]: reprocess config line 38: Deprecated option RhostsRSAAuthentication
Sep 3 12:47:32 helios sshd[1398]: Accepted publickey for monitoring from 131.220.226.3 port 39992 ssh2: RSA SHA256:ulxULyONiGRB8VUFctWd/WSBcRxjGX+5Dq/IXyZS+gI
Sep 3 12:47:32 helios sshd[1398]: pam_unix(sshd:session): session opened for user monitoring by (uid=0)
Sep 3 12:47:32 helios systemd-logind[497]: New session 6 of user monitoring.
Sep 3 12:47:32 helios systemd: pam_unix(systemd-user:session): session opened for user monitoring by (uid=0)
Sep 3 12:47:32 helios sshd[1416]: Received disconnect from 131.220.226.3 port 39992:11: disconnected by user
Sep 3 12:47:32 helios sshd[1416]: Disconnected from user monitoring 131.220.226.3 port 39992
Sep 3 12:47:32 helios sshd[1398]: pam_unix(sshd:session): session closed for user monitoring
Sep 3 12:47:32 helios systemd-logind[497]: Session 6 logged out. Waiting for processes to exit.
Sep 3 12:47:32 helios systemd-logind[497]: Removed session 6.
Sep 3 12:47:42 helios systemd: pam_unix(systemd-user:session): session closed for user monitoring
Sep 3 12:48:14 helios lightdm: pam_unix(lightdm-greeter:session): session closed for user lightdm
Sep 3 12:48:14 helios systemd-logind[497]: Removed session c1.
Sep 3 12:48:14 helios lightdm: pam_unix(lightdm:session): session opened for user ueding by (uid=0)
Sep 3 12:48:14 helios lightdm: pam_systemd(lightdm:session): Failed to create session: No such file or directory
Sep 3 12:48:24 helios systemd: pam_unix(systemd-user:session): session closed for user lightdmI guess the second last line is the really interesting one.
Accompanying syslog
Sep 04 14:10:10 helios systemd[1]: session-c3.scope: Killing process 28814 (lightdm) with signal SIGTERM.
Sep 04 14:10:10 helios systemd[1]: session-c3.scope: Killing process 28829 (lightdm-gtk-gre) with signal SIGTERM.
Sep 04 14:10:10 helios systemd[1]: Stopping Session c3 of user lightdm.
Sep 04 14:10:10 helios lightdm[28814]: pam_unix(lightdm-greeter:session): session closed for user lightdm
Sep 04 14:10:10 helios systemd[1]: session-c3.scope: Succeeded.
Sep 04 14:10:10 helios systemd[1]: Stopped Session c3 of user lightdm.
Sep 04 14:10:10 helios systemd-logind[497]: Removed session c3.
Sep 04 14:10:10 helios lightdm[28869]: pam_unix(lightdm:session): session opened for user ueding by (uid=0)
Sep 04 14:10:10 helios lightdm[28869]: pam_systemd(lightdm:session): Failed to create session: No such file or directory
Sep 04 14:10:10 helios lightdm[28869]: Failed to open CK session: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ConsoleKit was not provided by any .service files
Sep 04 14:10:10 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='org.a11y.Bus' requested by ':1.3' (uid=1085 pid=28933 comm="xfce4-session ")
Sep 04 14:10:10 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'org.a11y.Bus'
Sep 04 14:10:10 helios org.a11y.Bus[28914]: dbus-daemon[28940]: Activating service name='org.a11y.atspi.Registry' requested by ':1.0' (uid=1085 pid=28933 comm="xfce4-session ")
Sep 04 14:10:10 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='org.xfce.Xfconf' requested by ':1.3' (uid=1085 pid=28933 comm="xfce4-session ")
Sep 04 14:10:10 helios org.a11y.Bus[28914]: dbus-daemon[28940]: Successfully activated service 'org.a11y.atspi.Registry'
Sep 04 14:10:10 helios org.a11y.Bus[28914]: SpiRegistry daemon is running with well-known name - org.a11y.atspi.Registry
Sep 04 14:10:10 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'org.xfce.Xfconf'
Sep 04 14:10:11 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='org.gtk.vfs.Daemon' requested by ':1.9' (uid=1085 pid=28954 comm="Thunar --sm-client-id 2e9ea3a26-363a-4e06-b723-b6d")
Sep 04 14:10:11 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'org.gtk.vfs.Daemon'
Sep 04 14:10:11 helios org.gtk.vfs.Daemon[28914]: fusermount: failed to open mountpoint for reading: Permission denied
Sep 04 14:10:11 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='org.freedesktop.thumbnails.Thumbnailer1' requested by ':1.16' (uid=1085 pid=28972 comm="xfdesktop --display :0.0 --sm-client-id 24fe00ba0-")
Sep 04 14:10:11 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='org.freedesktop.Notifications' requested by ':1.20' (uid=1085 pid=28988 comm="xfce4-power-manager --restart --sm-client-id 270b9")
Sep 04 14:10:11 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'org.freedesktop.Notifications'
Sep 04 14:10:12 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='org.freedesktop.Tracker1' requested by ':1.28' (uid=1085 pid=29060 comm="gdbus call -e -d org.freedesktop.DBus -o /org/free")
Sep 04 14:10:12 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='ca.desrt.dconf' requested by ':1.29' (uid=1085 pid=29045 comm="light-locker ")
Sep 04 14:10:12 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'ca.desrt.dconf'
Sep 04 14:10:12 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'org.freedesktop.Tracker1'
Sep 04 14:10:12 helios org.freedesktop.thumbnails.Thumbnailer1[28914]: Registered thumbailer /usr/bin/gdk-pixbuf-thumbnailer -s %s %u %o
Sep 04 14:10:12 helios org.freedesktop.thumbnails.Thumbnailer1[28914]: Registered thumbailer evince-thumbnailer -s %s %u %o
Sep 04 14:10:12 helios org.freedesktop.thumbnails.Thumbnailer1[28914]: Registered thumbailer gnome-thumbnail-font --size %s %u %o
Sep 04 14:10:12 helios org.freedesktop.thumbnails.Thumbnailer1[28914]: Registered thumbailer /usr/bin/gdk-pixbuf-thumbnailer -s %s %u %o
Sep 04 14:10:12 helios org.freedesktop.thumbnails.Thumbnailer1[28914]: Registered thumbailer atril-thumbnailer -s %s %u %o
Sep 04 14:10:12 helios org.freedesktop.thumbnails.Thumbnailer1[28914]: Registered thumbailer /usr/share/blender/scripts/blender-thumbnailer.py %i %o
Sep 04 14:10:12 helios org.freedesktop.thumbnails.Thumbnailer1[28914]: Registered thumbailer /usr/bin/totem-video-thumbnailer -s %s %u %o
Sep 04 14:10:12 helios kernel: traps: light-locker[29045] trap int3 ip:7f6a78690c75 sp:7ffec8e2fea0 error:0 in libglib-2.0.so.0.5800.3[7f6a78658000+7e000]
Sep 04 14:10:12 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='org.gnome.evolution.dataserver.Sources5' requested by ':1.38' (uid=1085 pid=29044 comm="/usr/lib/evolution/evolution-data-server/evolution")
Sep 04 14:10:13 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='org.gnome.OnlineAccounts' requested by ':1.40' (uid=1085 pid=29094 comm="/usr/lib/evolution/evolution-source-registry ")
Sep 04 14:10:13 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'org.gnome.evolution.dataserver.Sources5'
Sep 04 14:10:13 helios goa-daemon[29107]: goa-daemon version 3.30.1 starting
Sep 04 14:10:13 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='org.gnome.Identity' requested by ':1.41' (uid=1085 pid=29107 comm="/usr/lib/gnome-online-accounts/goa-daemon ")
Sep 04 14:10:13 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'org.gnome.OnlineAccounts'
Sep 04 14:10:13 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'org.gnome.Identity'
Sep 04 14:10:13 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='org.gnome.evolution.dataserver.Calendar7' requested by ':1.38' (uid=1085 pid=29044 comm="/usr/lib/evolution/evolution-data-server/evolution")
Sep 04 14:10:13 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='org.gtk.vfs.UDisks2VolumeMonitor' requested by ':1.23' (uid=1085 pid=28986 comm="/usr/lib/x86_64-linux-gnu/tumbler-1/tumblerd ")
Sep 04 14:10:13 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'org.gtk.vfs.UDisks2VolumeMonitor'
Sep 04 14:10:13 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='org.gtk.vfs.AfcVolumeMonitor' requested by ':1.23' (uid=1085 pid=28986 comm="/usr/lib/x86_64-linux-gnu/tumbler-1/tumblerd ")
Sep 04 14:10:13 helios org.gtk.vfs.AfcVolumeMonitor[28914]: Volume monitor alive
Sep 04 14:10:13 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'org.gtk.vfs.AfcVolumeMonitor'
Sep 04 14:10:13 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'org.gnome.evolution.dataserver.Calendar7'
Sep 04 14:10:13 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='org.gnome.evolution.dataserver.AddressBook9' requested by ':1.43' (uid=1085 pid=29125 comm="/usr/lib/evolution/evolution-calendar-factory ")
Sep 04 14:10:13 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='org.gtk.vfs.GoaVolumeMonitor' requested by ':1.23' (uid=1085 pid=28986 comm="/usr/lib/x86_64-linux-gnu/tumbler-1/tumblerd ")
Sep 04 14:10:13 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'org.gnome.evolution.dataserver.AddressBook9'
Sep 04 14:10:13 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'org.gtk.vfs.GoaVolumeMonitor'
Sep 04 14:10:13 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='org.gtk.vfs.MTPVolumeMonitor' requested by ':1.23' (uid=1085 pid=28986 comm="/usr/lib/x86_64-linux-gnu/tumbler-1/tumblerd ")
Sep 04 14:10:14 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'org.gtk.vfs.MTPVolumeMonitor'
Sep 04 14:10:14 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='org.gtk.vfs.GPhoto2VolumeMonitor' requested by ':1.23' (uid=1085 pid=28986 comm="/usr/lib/x86_64-linux-gnu/tumbler-1/tumblerd ")
Sep 04 14:10:14 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'org.gtk.vfs.GPhoto2VolumeMonitor'
Sep 04 14:10:14 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'org.freedesktop.thumbnails.Thumbnailer1'
Sep 04 14:10:14 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Activating service name='org.gtk.vfs.Metadata' requested by ':1.14' (uid=1085 pid=28972 comm="xfdesktop --display :0.0 --sm-client-id 24fe00ba0-")
Sep 04 14:10:14 helios dbus-daemon[28914]: [session uid=1085 pid=28912] Successfully activated service 'org.gtk.vfs.Metadata'
Sep 04 14:10:20 helios systemd[1]: Stopping User Manager for UID 116...
Sep 04 14:10:20 helios systemd[28818]: Stopping D-Bus User Message Bus...
Sep 04 14:10:20 helios gvfsd[28842]: A connection to the bus can't be made
Sep 04 14:10:20 helios systemd[28818]: Stopping Accessibility services bus...
Sep 04 14:10:20 helios systemd[28818]: Stopping Virtual filesystem service...
Sep 04 14:10:20 helios systemd[28818]: Stopped target Default.
Sep 04 14:10:20 helios systemd[28818]: gvfs-daemon.service: Main process exited, code=killed, status=15/TERM
Sep 04 14:10:20 helios systemd[28818]: at-spi-dbus-bus.service: Succeeded.
Sep 04 14:10:20 helios systemd[28818]: Stopped Accessibility services bus.
Sep 04 14:10:20 helios systemd[28818]: dbus.service: Succeeded.
Sep 04 14:10:20 helios systemd[28818]: Stopped D-Bus User Message Bus.
Sep 04 14:10:20 helios systemd[1]: run-user-116-gvfs.mount: Succeeded.
Sep 04 14:10:20 helios systemd[28818]: run-user-116-gvfs.mount: Succeeded.
Sep 04 14:10:20 helios systemd[25779]: run-user-116-gvfs.mount: Succeeded.
Sep 04 14:10:20 helios systemd[28818]: gvfs-daemon.service: Succeeded.
Sep 04 14:10:20 helios systemd[28818]: Stopped Virtual filesystem service.
Sep 04 14:10:20 helios systemd[28818]: Stopped target Basic System.
Sep 04 14:10:20 helios systemd[28818]: Stopped target Sockets.
Sep 04 14:10:20 helios systemd[28818]: gpg-agent-browser.socket: Succeeded.
Sep 04 14:10:20 helios systemd[28818]: Closed GnuPG cryptographic agent and passphrase cache (access for web browsers).
Sep 04 14:10:20 helios systemd[28818]: gpg-agent.socket: Succeeded.
Sep 04 14:10:20 helios systemd[28818]: Closed GnuPG cryptographic agent and passphrase cache.
Sep 04 14:10:20 helios systemd[28818]: gpg-agent-ssh.socket: Succeeded.
Sep 04 14:10:20 helios systemd[28818]: Closed GnuPG cryptographic agent (ssh-agent emulation).
Sep 04 14:10:20 helios systemd[28818]: dirmngr.socket: Succeeded.
Sep 04 14:10:20 helios systemd[28818]: Closed GnuPG network certificate management daemon.
Sep 04 14:10:20 helios systemd[28818]: gpg-agent-extra.socket: Succeeded.
Sep 04 14:10:20 helios systemd[28818]: Closed GnuPG cryptographic agent and passphrase cache (restricted).
Sep 04 14:10:20 helios systemd[28818]: pulseaudio.socket: Succeeded.
Sep 04 14:10:20 helios systemd[28818]: Closed Sound System.
Sep 04 14:10:20 helios systemd[28818]: Stopped target Timers.
Sep 04 14:10:20 helios systemd[28818]: Stopped target Paths.
Sep 04 14:10:20 helios systemd[28818]: dbus.socket: Succeeded.
Sep 04 14:10:20 helios systemd[28818]: Closed D-Bus User Message Bus Socket.
Sep 04 14:10:20 helios systemd[28818]: Reached target Shutdown.
Sep 04 14:10:20 helios systemd[28818]: systemd-exit.service: Succeeded.
Sep 04 14:10:20 helios systemd[28818]: Started Exit the Session.
Sep 04 14:10:20 helios systemd[28818]: Reached target Exit the Session.
Sep 04 14:10:20 helios systemd[28819]: pam_unix(systemd-user:session): session closed for user lightdm
Sep 04 14:10:20 helios systemd[1]: [emailprotected]: Succeeded.
Sep 04 14:10:20 helios systemd[1]: Stopped User Manager for UID 116.
Sep 04 14:10:20 helios systemd[1]: Stopping User Runtime Directory /run/user/116...
Sep 04 14:10:20 helios systemd[25779]: run-user-116.mount: Succeeded.
Sep 04 14:10:20 helios systemd[1]: run-user-116.mount: Succeeded.
Sep 04 14:10:20 helios systemd[1]: [emailprotected]: Succeeded.
Sep 04 14:10:20 helios systemd[1]: Stopped User Runtime Directory /run/user/116.
Sep 04 14:10:20 helios systemd[1]: Removed slice User Slice of UID 116.Present conclusion
I feel that there is something that prevents users from becoming “fully logged
in”, in a sense that they do have an Xfce session and can see their home
directories, but not enough to be registered with the “fancy” stuff like
logind or Pulse Audio. Or perhaps they are missing a special user group. A local user account on of the machines works just as expected, so this definitely is some issue with the user accounts in general and not with one of the symptoms (loginctl output, sound, removable media).
I cannot really grasp this and I am not sure where exactly I should look.
Pointers or (hopefully) solutions are very much welcome!
|
NIS users sessions are incomplete after upgrade to Debian 10
|
The assumption is correct - at time of writing, IdleAction=lock is not implemented. Bug report has been filed - 16391
|
Per logind.conf(5), the file has IdleAction=, and one of the values it can take is lock
I have tried IdleAction=lock with IdleActionSec=1min (with a view to setting this to 15min for our organization) but it does nothing.
Did the systemd developers remove this functionality without also removing the documentation from the manpage? or am I doing something wrong here?
|
IdleAction=lock no longer works in systemd, correct?
|
There are a number of benefits to this, but the primary one is to place each application in its own kernel cgroup. This allows gnome-shell to do application matching more reliably, and one can use resource controls to (for example) say Epiphany only gets 20% of system RAM.
Furthermore, this lays some fundamental groundwork for application sandboxing.https://wiki.gnome.org/ThreePointThirteen/Features/SystemdUserSession
I can understand GNOME being interested in CGroups. Systemd provides an existing framework for this.
I didn't find any rationale for KDE Plasma doing this in my searching. The closest I came wasMy idea so far is that a Plasma on Wayland shell needs to be brought up by systemd. Especially I consider using socket activation to start the KWin session compositor.https://plus.google.com/+MartinGr%C3%A4%C3%9Flin/posts/GMtZrNCeaLD
but there was no explanation why socket-activating KWin makes sense when it's essential for a Plasma session.I haven't looked at why systemd killed off systemd --session and enshrined systemd --user in pam_systemd. Maybe a per-session instance would have been a cleaner system in principle, but I'm not sure. I expect there was some practical reason that made it not quite as attractive.
|
Desktops such as GNOME have moved processes from the per-session scope, into the per-user systemd manager (systemd --user). This includes GUI apps such as GNOME Terminal.
What does GNOME use the systemd user manager to achieve? Is there a rationale somewhere I can read?GNOME appears to copy the environment variables of the session into the user manager. Note that GNOME does not support the user logging in more than once at the same time. These environment variables include, intentionally or not, XDG_SESSION_ID.
loginctl, as in loginctl lock-session, ended up being modified to support this second, less well-defined concept of a session.
I'm curious what prompted people to create this strangeness.
|
Why is a systemd user manager used in desktop sessions e.g. GNOME?
|
I don't have enough points to comment, but there's some chance this might also answer your question.
If I'm understanding you correctly, you want to allow local user logins, and once a user is logged in, spin up a new VM from scratch and auto-configure a user session of the same name? That could get pretty hair very quickly, if I'm understanding your requirement correctly.
How about this instead, which sounds like your intended goal--a "kiosk" mode except where the user has unlimited local power even to destroy the whole OS, but it's easily reset. (In this case, automatically.) The only difference, I think, is that there are no specific individual user sessions involved, because for this idea to work, individual user sessions aren't actually needed, and in fact complicate things. (But if individual user sessions ARE a requirement, then at least this solution could still get you started in the right direction. Think "read-only, immutable Base VM disk image that is accessible by all users, but each user has their own VM definition file and read/write differencing disk, both of which get deleted and restored with each login.)
First some quick definitions:"Host", or "Machine": The physical machine. Might be running Windows, MacOS, or Linux, it shouldn't matter too much--each of those can be configured this way, although it's not always obvious how to intercept logouts and shutdowns in any of them. (I know both can be done in Windows and Linux, and strongly suspect in MacOS. All of them can also be configured for auto-login on startup.)
"VM", "virtual machine", or "guest": A virtual machine running on a host machine. By the sounds of it, you want this to be Linux, but it could just as easily be Windows, except for potential licensing headaches. (E.g. if a user screws up the licensing, that screw-up persists even if the OS itself starts completely over from a checkpoint.)Every host machine will have a single "user" session, and within that user session, a single, transparent guest session. The user will only see or necessarily know of the existence of, the guest session. (But the security of the host session shouldn't--and doesn't have to--rely on that obscurity.)
General steps:Set up the host machine to automatically log into one locked-down user account upon startup, e.g. "vmuser". Deactivate session timeout/lock, and screensaver. (Screen power off OK but without locking the session.)
Create a VM for that user session, with an immutable disk and a differencing file, or a snapshot to roll back to.
Upon initial host login (at startup), have a login script launch a VM session in full screen mode (with an obscure redefined "host" key. e.g. scroll lock). That script should wait until the VM powers down, because it will have more work to do later.
That VM also then auto-logs-in to root, or a user with admin rights.
Guest logout script: Shut down the whole VM.
Once the VM shuts down, your login script resumes. It rolls the back to a predefined snapshot. If the host user session is not also ending, that script should then start the VM back up again. (It then auto-logs in again and your back and rolling with a fresh new session.)
Host logout script: You'll need to communicate with the login script in one of myriad possible ways, to either abort it, or tell it to not start the VM back up after doing its rollback stuff. Either way, what you want to happen is to power off the VM (even a "hard" power off is acceptable). Rolls the VM back to snapshot. Then either have the host auto-logs back in again (which would require a service or daemon watching and would result in a clean restored VM coming back up), or power-down the host machine completely.
If the user shuts down the host, the same thing happens as logging out (because the user session first logs out), except you'd want to communicate with that script to preempt logging back in, or shutting down the host (redundantly).
Whenever the host user session logs in (which ironically may be more reliable in terms of timing than doing this on host startup), the login script should always roll the VM back to snapshot before starting it up (or at least check to make sure), just in case it wasn't cleanly shut down last time. Or if you REALLY want to be robust, a host machine startup script could do all the cleanup it needs to--deleting any files potentially used for inter-process communication, rolling back the VM just in case, etc.--all the while the login script, if inevitably initiated while all this is going on, waits until that process is done before proceeding.This way, the user can do whatever they want in the VM, including "rm -rf /", and a VM shutdown, a logout of the host user session, or a host reboot will restore it automagically. As long as the host user session is reasonably well locked down and secure, and the immutable VM disk not user-deletable (which would be a good reason to set it up that way rather than snapshots), then it would be REALLY hard for users to screw the system up, even if they broke out of the VM. (That said, anyone with physical access can compromise a computer. And it should go without saying--therefore I wish it didn't need to be said--that any exploits to the host OS could also compromise your solution. But at least exploits to the guest are mostly moot in terms of permanent guest OS damage, as it gets rolled-back/reset anyway.)
I'm pretty confident something along these lines is possible, reasonably close to what was outlined--because I know each of the individual steps are possible and have done many of them myself.
Your general need is something along the idea of "kiosk-mode", which you can Google for. Granted, kiosk modes usually also involve locking down the user's experience, which is the opposite of what you want, but there may be some ideas out there that get you close, or similar to this but with different tech (e.g. containers).
Good luck!
|
I had a question earlier, it is tied into this, that one was looking for the proper procedure, this one is looking how to implement. If you need a backstory refer to My first question
I have a local device. I am the only one I want to have "local access". lets call this device charles.local
I want to have it, so when I do addusr bob it spins up a VM bob.charles.local
When bob is at the computer, and logs in, it drops him into his little environment instead of
I know how to spin up a VM, a full instance with an OS, not what I am looking to do, but I can make mods where needed, I know how to manage a local computer using linux, I know how to fdisk create loop dev's.Would init be able to handle the login process that I am aiming for, so when the login screen pops up, and bob logs in, it automatically drops him in the VM, or would I need a separate login server, such as kerberus?
Is it possible to spin up a VM with only 1 user, no additional user to be added and make it look like bob just logged into the computer like normal.
I was able to track down, skel, login, logout, adduser, deluser, passwd, shadow, config files, would I have to modify the initd config? are there any other configs I need to get this ball running?Do I need any other specific software outside of a VMM?I am trying to get a local device setup, so that a class can login to a machine, and have 0 access to the actual machine so they can tinker with root without disrupting the other students, and with minimal input from them... Basically, the only input to the local machine they can do is their user name and password. Everything else would be handled in their environment.
|
Setting up VM login instead of Local login [closed]
|
Solved!
Alright, although i wasn't able to fix everything yet im at a point where i consider the above to be fixed.
The problem is easier to solve than i thought, so if you wonder around here i guess you are just as clueless as me so im gonna try to go slow in order to prevent people from wasting time.
LoginD
LoginD was fixed by going to Proxmox dashboard, going to options on the left tab, double clicking on features and then enabling "Nesting"(im unsure if this contributed, either way i needed it for docker), and "keyctl". After rebooting systemd-logind service stopped reporting errors. This also caused a sharp reduction on accessing speed to tty console or ssh stuff
Kernel Stuff
This took me a bit more time, i had already came across this github page but when he said:
Ran into this on Proxmox and I resolved it by adding lxc.cap.drop: sys_rawio to my config and this is the result
I was completely clueless, as until a few hours ago i had never messed around outside of my CT's tab.
Regardless i was eager to learn about proxmox and lxc containers and after messing around some commands i found lxc-config, doing lxc-config -l, shows you some "variables" one of these will be lxc.lxcpath
Doing lxc-config lxc.lxcpath will return the lxc path(duh), changing directory to it and listing the contents of it should(at least in my case) give you the various Containers and Virtual machines, im unsure if its a case of my Proxmox setup having numbers as CT's names or its just a version thing but in some troubleshooting videos/media i saw that instead of the id they had some kind of name.
Regardless i changed to the appropriate directory and then stopped the machine from running(i think this is required as i had some steps i will detail now rollback twice), and then edited the config file with nano
i appended:
lxc.cap.drop = sys_rawiosaved, rebooted the CT and... 2 services were now working these being sys-kernel-config.mount, sys-kernel-debug.mount im unshure what they are supposed to be responsible for, but i think the failing results from my container being unprivileged.
Im still kinda green about the second solution and im scared this will screw me over in the future so i will read the manual a bit more and if i find anything to be scared of i will update this answer appropriately.
|
Background/Context
Im running a Debian GNU/Linux 11 (bullseye) x86_64(5.4.174-2-pve) virtualized server on a LVC container(proxmox stuff). Im really new to both debian(i tipically use arch linux which is roll and release) and proxmox as i barely touch on it(basically a family member of mine gave me a container for me to develop my website, and whatever i want on it)
I've started doing my stuff and it all went well, despite spending some time learning how the whole setting up mirrors for version thing and after some months i had a built website, along with the usual system attacks
I decided to help the family member that provided me the server by downloading somekind of pyhole to block ads, the thing was i wanted to do it through docker as i wasn't aware if it was gonna make a mess or not.
And i think it was when i downloaded docker and docker-compose when it all came down hill either that or due to the updates and upgrades i made during that time
The visible problem
I started noticing that ssh took a lot more time to do the login stuff(like 5 seconds more). And i stress this enough it is NOT SSH itself as when i press the comand the usual motd shows up in a split second
Another thing i noticed is that:
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.Is printed twice, on proxmox console i think it shows the full message printed twice alternated. Like if the original message Was A B C, its prints A B A C B C.
Diagnosis
Although i have some years(like 4) on arch linux, i use it for personal use, and... its a full installation instead of a container. So i never had to touch a lot on kernel stuff or other OS stuff.
Either way heres some ideas to share so hopefully i can get some help:
journalctl -b
Sep 04 13:05:51 LinuxJD systemd-journald[59]: Journal started
Sep 04 13:05:51 LinuxJD systemd-journald[59]: Runtime Journal (/run/log/journal/c5b67cb2fb4c49678a4fd62f7e4a2b20) is 8.0M, max 116.3M, 108.3M free.
Sep 04 13:05:51 LinuxJD systemd[1]: Starting Flush Journal to Persistent Storage...
Sep 04 13:05:51 LinuxJD mount[55]: mount: /sys/kernel/debug: permission denied.
Sep 04 13:05:51 LinuxJD mount[65]: mount: /sys/kernel/config: cannot mount configfs read-only.
Sep 04 13:05:51 LinuxJD systemd-journald[59]: Time spent on flushing to /var/log/journal/c5b67cb2fb4c49678a4fd62f7e4a2b20 is 2.371449s for 5 entries.
Sep 04 13:05:51 LinuxJD systemd-journald[59]: System Journal (/var/log/journal/c5b67cb2fb4c49678a4fd62f7e4a2b20) is 80.0M, max 1.1G, 1.0G free.
Sep 04 13:05:51 LinuxJD systemd[1]: Finished Helper to synchronize boot up for ifupdown.
Sep 04 13:05:52 LinuxJD systemd[1]: Finished Apply Kernel Variables.
Sep 04 13:05:55 LinuxJD apparmor.systemd[94]: Not starting AppArmor in container
Sep 04 13:05:52 LinuxJD systemd[1]: Finished Create System Users.
Sep 04 13:05:52 LinuxJD systemd[1]: Starting Create Static Device Nodes in /dev...
Sep 04 13:05:52 LinuxJD systemd[1]: Finished Create Static Device Nodes in /dev.
Sep 04 13:05:52 LinuxJD systemd[1]: Reached target Local File Systems (Pre).
Sep 04 13:05:52 LinuxJD systemd[1]: Reached target Local File Systems.
Sep 04 13:05:52 LinuxJD systemd[1]: Starting Load AppArmor profiles...
Sep 04 13:05:55 LinuxJD systemd-journald[59]: Forwarding to syslog missed 1 messages.
Sep 04 13:05:52 LinuxJD systemd[1]: Condition check resulted in Store a System Token in an EFI Variable being skipped.
Sep 04 13:05:52 LinuxJD systemd[1]: Condition check resulted in Commit a transient machine-id on disk being skipped.
Sep 04 13:05:52 LinuxJD systemd[1]: Condition check resulted in Rule-based Manager for Device Events and Files being skipped.
Sep 04 13:05:55 LinuxJD systemd[1]: Reached target Network is Online.
Sep 04 13:05:55 LinuxJD systemd[1]: Finished Create Volatile Files and Directories.
Sep 04 13:05:55 LinuxJD systemd[1]: Condition check resulted in Network Time Synchronization being skipped.
Sep 04 13:05:55 LinuxJD systemd[1]: Reached target System Time Set.
Sep 04 13:05:55 LinuxJD systemd[1]: Reached target System Time Synchronized.
Sep 04 13:05:55 LinuxJD systemd[1]: Starting Update UTMP about System Boot/Shutdown...
Sep 04 13:05:55 LinuxJD systemd[1]: Finished Update UTMP about System Boot/Shutdown.
Sep 04 13:05:55 LinuxJD systemd[1]: Reached target System Initialization.
Sep 04 13:05:55 LinuxJD systemd[1]: Started Daily apt download activities.
Sep 04 13:05:55 LinuxJD systemd[1]: Started Daily apt upgrade and clean activities.
Sep 04 13:05:55 LinuxJD systemd[1]: Started Periodic ext4 Online Metadata Check for All Filesystems.
Sep 04 13:05:55 LinuxJD systemd[1]: Started Daily rotation of log files.
Sep 04 13:05:55 LinuxJD systemd[1]: Started Clean PHP session files every 30 mins.
Sep 04 13:05:55 LinuxJD systemd[1]: Listening on D-Bus System Message Bus Socket.
Sep 04 13:05:55 LinuxJD cron[162]: (CRON) INFO (pidfile fd = 3)
Sep 04 13:05:55 LinuxJD systemd[1]: Reached target Sockets.
Sep 04 13:05:56 LinuxJD cron[162]: (CRON) INFO (Running @reboot jobs)
Sep 04 13:05:55 LinuxJD systemd[1]: Reached target Basic System.
Sep 04 13:05:55 LinuxJD systemd[1]: Starting LSB: Set up cgroupfs mounts....
Sep 04 13:05:55 LinuxJD systemd[1]: Started Regular background program processing daemon.
Sep 04 13:05:55 LinuxJD systemd[1]: Started D-Bus System Message Bus.
Sep 04 13:05:55 LinuxJD systemd[1]: Starting Remove Stale Online ext4 Metadata Check Snapshots...
Sep 04 13:05:55 LinuxJD systemd[1]: Condition check resulted in getty on tty2-tty6 if dbus and logind are not available being skipped.
Sep 04 13:05:55 LinuxJD systemd[1]: Starting A high performance web server and a reverse proxy server...
Sep 04 13:05:55 LinuxJD systemd[1]: Starting The PHP 7.4 FastCGI Process Manager...
Sep 04 13:05:55 LinuxJD systemd[1]: Starting Postfix Mail Transport Agent (instance -)...
Sep 04 13:05:55 LinuxJD systemd[1]: Starting System Logging Service...
Sep 04 13:05:56 LinuxJD systemd[173]: systemd-logind.service: Failed to set up mount namespacing: /run/systemd/unit-root/proc: Permission denied
Sep 04 13:05:56 LinuxJD systemd[173]: systemd-logind.service: Failed at step NAMESPACE spawning /lib/systemd/systemd-logind: Permission denied
Sep 04 13:05:56 LinuxJD systemd[1]: systemd-logind.service: Main process exited, code=exited, status=226/NAMESPACE
Sep 04 13:05:56 LinuxJD systemd[220]: systemd-logind.service: Failed to set up mount namespacing: /run/systemd/unit-root/proc: Permission denied
Sep 04 13:05:56 LinuxJD systemd[220]: systemd-logind.service: Failed at step NAMESPACE spawning /lib/systemd/systemd-logind: Permission denied
Sep 04 13:05:57 LinuxJD systemd[241]: systemd-logind.service: Failed to set up mount namespacing: /run/systemd/unit-root/proc: Permission denied
Sep 04 13:05:57 LinuxJD systemd[241]: systemd-logind.service: Failed at step NAMESPACE spawning /lib/systemd/systemd-logind: Permission denied
Sep 04 13:05:57 LinuxJD systemd[1]: systemd-logind.service: Main process exited, code=exited, status=226/NAMESPACE
Sep 04 13:05:57 LinuxJD systemd[1]: Finished Load Kernel Module drm.
Sep 04 13:05:57 LinuxJD systemd[245]: systemd-logind.service: Failed to set up mount namespacing: /run/systemd/unit-root/proc: Permission denied
Sep 04 13:05:57 LinuxJD systemd[245]: systemd-logind.service: Failed at step NAMESPACE spawning /lib/systemd/systemd-logind: Permission denied
Sep 04 13:05:57 LinuxJD systemd[1]: systemd-logind.service: Scheduled restart job, restart counter is at 4.
Sep 04 13:05:57 LinuxJD systemd[249]: systemd-logind.service: Failed to set up mount namespacing: /run/systemd/unit-root/proc: Permission denied
Sep 04 13:05:58 LinuxJD postfix[253]: Postfix is running with backwards-compatible default settings
Sep 04 13:05:57 LinuxJD systemd[249]: systemd-logind.service: Failed at step NAMESPACE spawning /lib/systemd/systemd-logind: Permission denied
Sep 04 13:05:58 LinuxJD postfix[253]: See http://www.postfix.org/COMPATIBILITY_README.html for details
Sep 04 13:05:58 LinuxJD systemd[1]: [emailprotected]: Failed with result 'start-limit-hit'.
Sep 04 13:05:58 LinuxJD postfix[253]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
Sep 04 13:05:58 LinuxJD systemd[1]: systemd-logind.service: Failed with result 'exit-code'.
Sep 04 13:05:58 LinuxJD rsyslogd[168]: imuxsock: Acquired UNIX socket '/run/systemd/journal/syslog' (fd 3) from systemd. [v8.2102.0]
Sep 04 13:05:58 LinuxJD systemd[1]: Failed to start User Login Management.
Sep 04 13:05:58 LinuxJD rsyslogd[168]: imklog: cannot open kernel log (/proc/kmsg): Permission denied.
Sep 04 13:05:58 LinuxJD systemd[1]: Started System Logging Service.
Sep 04 13:05:58 LinuxJD rsyslogd[168]: activation of module imklog failed [v8.2102.0 try https://www.rsyslog.com/e/2145 ]
...(im cutting due to retries)
Sep 04 13:05:58 LinuxJD systemd[1]: Failed to start User Login Management.
Sep 04 13:05:58 LinuxJD rsyslogd[168]: imklog: cannot open kernel log (/proc/kmsg): Permission denied.
Sep 04 13:05:58 LinuxJD systemd[1]: Started System Logging Service.
Sep 04 13:05:58 LinuxJD rsyslogd[168]: activation of module imklog failed [v8.2102.0 try https://www.rsyslog.com/e/2145 ]
Sep 04 13:05:58 LinuxJD rsyslogd[168]: [origin software="rsyslogd" swVersion="8.2102.0" x-pid="168" x-info="https://www.rsyslog.com"] start
Sep 04 13:05:59 LinuxJD sshd[299]: Server listening on 0.0.0.0 port 22.
Sep 04 13:05:59 LinuxJD sshd[299]: Server listening on :: port 22.
Sep 04 13:05:59 LinuxJD systemd[1]: Started OpenBSD Secure Shell server.
Sep 04 13:06:00 LinuxJD postmulti[301]: postsuper: fatal: scan_dir_push: open directory hold: Permission denied
Sep 04 13:06:00 LinuxJD postfix/postsuper[301]: fatal: scan_dir_push: open directory hold: Permission denied
Sep 04 13:06:01 LinuxJD postfix/postfix-script[302]: fatal: Postfix integrity check failed!
Sep 04 13:06:01 LinuxJD systemd[1]: nginx.service: Failed to parse PID from file /run/nginx.pid: Invalid argument
Sep 04 13:06:01 LinuxJD systemd[1]: Started A high performance web server and a reverse proxy server.
Sep 04 13:06:02 LinuxJD systemd[1]: [emailprotected]: Control process exited, code=exited, status=1/FAILURE
Sep 04 13:06:02 LinuxJD systemd[1]: [emailprotected]: Failed with result 'exit-code'.
Sep 04 13:06:02 LinuxJD systemd[1]: Failed to start Postfix Mail Transport Agent (instance -).
Sep 04 13:06:02 LinuxJD systemd[1]: Starting Postfix Mail Transport Agent...
Sep 04 13:06:02 LinuxJD systemd[1]: Finished Postfix Mail Transport Agent.So i proceeded to watch what some of the systemctl stuff was doing and what i got from all of this is that the failure of sys-kernel-config.mount, sys-kernel-debug.mount or systemd-logind.service are most likely causing various other services to fail, i tried to go around the internet but i only found unrelated answers
journalctl -u of login service
this are the only relevant lines that are printed into oblivion
Aug 23 13:04:14 LinuxJD systemd[132]: systemd-logind.service: **Failed to set up mount namespacing: /run/systemd/unit-root/proc: Permission denied**
Aug 23 13:04:14 LinuxJD systemd[132]: systemd-logind.service: Failed at step NAMESPACE spawning /lib/systemd/systemd-logind: Permission denied
Aug 23 13:04:14 LinuxJD systemd[1]: systemd-logind.service: Main process exited, code=exited, status=226/NAMESPACE
Aug 23 13:04:14 LinuxJD systemd[1]: systemd-logind.service: Failed with result 'exit-code'.
Aug 23 13:04:14 LinuxJD systemd[1]: Failed to start User Login Management.as you can see its dated august 23rd,
as a joke you can see how lazy i am to only start fixing it some days ago
Before that the boot didnt display any errors although it did print some warnings saying Unknown lvalue in section 'Service', ignoring. Variable names include ProtectProc, ProtectKernelLogs, etc...
journalctl -u sys-kernel-config.mount
-- Journal begins at Mon 2022-08-22 10:01:37 WEST, ends at Sun 2022-09-04 13:23:49 WEST. --
Aug 22 10:01:37 LinuxJD systemd[1]: Mounting Kernel Configuration File System...
Aug 22 10:01:37 LinuxJD mount[66]: mount: /sys/kernel/config: permission denied.
Aug 22 10:01:37 LinuxJD systemd[1]: sys-kernel-config.mount: Mount process exited, code=exited, status=32/n/a
Aug 22 10:01:37 LinuxJD systemd[1]: sys-kernel-config.mount: Failed with result 'exit-code'.
Aug 22 10:01:37 LinuxJD systemd[1]: Failed to mount Kernel Configuration File System.
-- Boot 5e947e1d71c347de842d58ff83346b46 --
Aug 23 13:04:12 LinuxJD mount[67]: mount: /sys/kernel/config: cannot mount configfs read-only.
-- Boot 7cb1cef78bec4260b9b08de48728723f --
Aug 29 23:07:53 LinuxJD mount[67]: mount: /sys/kernel/config: cannot mount configfs read-only.
-- Boot f52c4a767b8343808ac8b2ae0c459494 --
Aug 30 17:03:10 LinuxJD mount[66]: mount: /sys/kernel/config: cannot mount configfs read-only.
-- Boot 3533ad0f42464deda95142c7eea10fc8 --
Aug 30 17:16:20 LinuxJD systemd[1]: Mounting Kernel Configuration File System...
Aug 30 17:16:20 LinuxJD mount[69]: mount: /sys/kernel/config: cannot mount configfs read-only.
Aug 30 17:16:20 LinuxJD systemd[1]: sys-kernel-config.mount: Mount process exited, code=exited, status=32/n/a
Aug 30 17:16:20 LinuxJD systemd[1]: sys-kernel-config.mount: Failed with result 'exit-code'.
Aug 30 17:16:20 LinuxJD systemd[1]: Failed to mount Kernel Configuration File System.nothing to say here i was even unaware that there was some kind of mounting happening on sys/kernel/
journalctl -u sys-kernel-debug.mount
-- Journal begins at Mon 2022-08-22 10:01:37 WEST, ends at Sun 2022-09-04 13:25:01 WEST. --
Aug 22 10:01:37 LinuxJD mount[55]: mount: /sys/kernel/debug: permission denied.
-- Boot 5e947e1d71c347de842d58ff83346b46 --
Aug 23 13:04:12 LinuxJD mount[55]: mount: /sys/kernel/debug: permission denied.
-- Boot 7cb1cef78bec4260b9b08de48728723f --
Aug 29 23:07:53 LinuxJD mount[55]: mount: /sys/kernel/debug: permission denied.
-- Boot f52c4a767b8343808ac8b2ae0c459494 --
Aug 30 17:03:10 LinuxJD mount[55]: mount: /sys/kernel/debug: permission denied.
-- Boot 3533ad0f42464deda95142c7eea10fc8 --
Aug 30 17:16:20 LinuxJD mount[55]: mount: /sys/kernel/debug: permission denied.
-- Boot adf79f39689b4cad9b0c5f25601a1e16 --
Aug 30 17:36:16 LinuxJD mount[55]: mount: /sys/kernel/debug: permission denied.
-- Boot 7670161016694d8cbebb490d8da76048 --
Aug 30 17:50:51 LinuxJD mount[55]: mount: /sys/kernel/debug: permission denied.
-- Boot 33d84ff5be5845fa87731c4ea0042c99 --
Sep 04 00:38:07 LinuxJD mount[55]: mount: /sys/kernel/debug: permission denied.
-- Boot e2851d364555457a873de23656622b8b --
Sep 04 00:49:40 LinuxJD mount[55]: mount: /sys/kernel/debug: permission denied.
-- Boot a7fff694cd6d4585b911d0ee40275b3c --
Sep 04 00:54:00 LinuxJD mount[55]: mount: /sys/kernel/debug: permission denied.
-- Boot 4fefd1bd372d47218eed549cd0044aa9 --
Sep 04 01:00:18 LinuxJD mount[55]: mount: /sys/kernel/debug: permission denied.
Sep 04 01:00:18 LinuxJD systemd[1]: sys-kernel-debug.mount: Mount process exited, code=exited, status=32/n/a
Sep 04 01:00:18 LinuxJD systemd[1]: sys-kernel-debug.mount: Failed with result 'exit-code'.
Sep 04 01:00:18 LinuxJD systemd[1]: Failed to mount Kernel Debug File System.What about the others
If comments so advise i will post the logs but i feel as though these three are most likely causing a cascade of problems. for example modprobe just says its failing due to trying to being rerun too many times
Attempts to fix it?
I've tried updating and upgrading stuff
Hit:1 http://ftp.pt.debian.org/debian bullseye InRelease
Get:2 https://packages.microsoft.com/debian/11/prod bullseye InRelease [10.5 kB]
Get:3 https://packages.microsoft.com/debian/11/prod bullseye/main arm64 Packages [15.8 kB]
Get:4 https://packages.microsoft.com/debian/11/prod bullseye/main amd64 Packages [77.8 kB]
Get:5 https://packages.microsoft.com/debian/11/prod bullseye/main armhf Packages [17.7 kB]heres the mirrors its hitting.
I've tried turning containerd off and on. I've tried removing pyhole container, I've tried some systemctl command sudo systemctl log-level debug hopping that it would give me some more text to fetch answers.
I've uninstalled docker and docker-compose as i was also having some problem with /proc stuff so i couldnt lauch anything.
I've tried rebooting bunch of times, and lastly i've turned some services related to nginx, php, posgresql, etc... off while boot to see if that was the problem.
The only thing that showed any kind of progression was... masking logind service, and although when i pressed enter i didnt fully know what the command did, it just seemed to temporarily symlink it no nowhere, which caused another bunch of problems but now there was no visible delay when logging in
i then proceeded to systemctl unmask systemd-logind and it bringed the issue back.
TL;DR:
Theres a visible delay when loggin in to the server,
A mixture of systemd-logind, sys-kernel-config.mount, sys-kernel-debug.mount are in my eyes causing a bunch of services to fail.
A lot of errors always point to lack of permissions when mounting
Somehow the folder /proc is related
|
sys-kernel-debug, and logind service fail causing noticeable delay on logging in
|
I'm not sure of the precise cause; but the root of my problems ended up being that I hadn't booted with the resume & resume_offset kernel parameters. I had thought that these were only required on the resuming boot; not the boot that hibernates, but that seems not to be the case.
|
After resuming from a hybrid-sleep, I can log in (swaylock) and initially it seems ok - pwd, journalctl -xe run as expected in the shell still open from when I put it to sleep.
After a short while though, tens of seconds, when I'd exited journalctl (I just wanted to confirm it had actually been asleep) CPU load increases, I hear the fan spin up, and anything I try to run in the same shell (pwd again, say) results in a SIGSEGV - address boundary error.
Consequently, I can't even issue a shutdown command, so I have to force it off with the power button. Once rebooted, journalctl --boot=-1 has no entries from after it went to sleep, like it never woke. I assume when I saw them they were stored only in RAM, and when I shut down it was unable to write them to disk with the same segfault.
The behaviour is quite erratic - after drafting the above I tested again and was able to 'log in' (bypass swaylock) by entering a single key, not my full password, but any command I tried to run in the open (resumed) shells crashed the terminal emulator, and as before I couldn't re-open any more (the command run by my keybinding for that presumably segfaulted too).
Any ideas what the cause could be? Or even how I can debug this without access to the logs when the system is stable?Some possibly relevant info, I'll edit in more if anyone can suggest what might be relevant/suspect:
# /etc/systemd/system/swapfile.swap
[Unit]
Description=providing a swapfile[Swap]
What=/swapfile
Priority=20[Install]
WantedBy=multi-user.target# /etc/systemd/system/swapfile-creation.service
[Unit]
Description=creating a swap file at /swapfile
ConditionPathExists=!/swapfile
Before=swapfile.swap[Service]
Type=oneshot
ExecStart=/bin/sh -c 'dd if=/dev/zero of=/swapfile bs=1M count="$(expr "$(cat /sys/power/image_size)" / 1024 / 1024)" status=progress'
ExecStart=/usr/bin/chmod 600 /swapfile
ExecStart=/usr/bin/mkswap /swapfile[Install]
RequiredBy=swapfile.swapI was going to include the systemd-boot entry (or script I used to create it) but actually realised I haven't tested from power loss - this is occurring when resuming from RAM. I will double check that the (unused) suspense to disk isn't somehow the culprit, that it doesn't work when resuming from a plain systemctl suspend.
|
SIGSEGV address boundary error shortly after waking from sleep
|
By default the Linux kernel enforces RFC 1812 when performing route validation on packets with such source or destination. Here are a few samples: IPv4: 1 2 3 4 5, ARP: 6. They all look about the same: if (ipv4_is_loopback(saddr) && !IN_DEV_ROUTE_LOCALNET(in_dev))
return -EINVAL;If the source or destination of address is within 127.0.0.0/8 and this doesn't happen within the host, ie through the loopback interface, the packet will be dropped... unless the dedicated sysctl toggle route_localnet (checked by the macro above) is enabled, in which case the address is considered a normal routable address:route_localnet - BOOLEAN
Do not consider loopback addresses as martian source or destination
while routing. This enables the use of 127/8 for local routing
purposes.
default FALSESo to have an interface accept to receive or emit such traffic without it being dropped by the routing stack, the toggle has to be enabled on it. For an interface eth5 this would be done with:
sysctl -w net.ipv4.conf.eth5.route_localnet=1Depending on how the encapsulation is done and on the overall setup, possibly other interfaces could be involved, use all instead of eth5 first, in case of doubt.Here's a question I answered on SU about such packet on the wire:
Sending packets meant for an address on 127.0.0.1/8 to the network on Ubuntu
Hint: also disable rp_filter everywhere (including all and default) when debugging until it starts working. That's what causes some of the RTNETLINK answers: Invalid argument until all routes for both directions are properly configured.Beside this RFC 4379 use case, one possibly more common case is when a Destination NAT is done to change a normal address into a loopback address to cheaply overcome an application that binds its service only on a loopback address. Simplified example:
iptables -t nat -I PREROUTING -p tcp --dport 80 -j DNAT --to-destination 127.0.0.1:8080It can work only with the toggle enabled, because the routing stack itself sees packets not on the loopback with a loopback address inside (destination for incoming, source for reply). No such packet actually appears on the wire (NAT happens) but the routing stack doesn't know this, so the check has to be ignored.
|
I would like to know if it is possible in linux to receive an UDP packet in userspace that has a 127.0.0.0/8 dst address but coming from an external interface.
I tested it with nc and I can see although nc binds to all addresses it doesn't receive the packet.
On Device 1 I manipulated the local routing table to route this packet to desired interface then I send a test packet.
Device 1:
frr:~# ip route show table local
...
127.1.1.1 nhid 17 encap mpls 16 via 10.10.10.5 dev eth5
...
frr:~# echo "foo" | nc -w1 -u -v -s 3.3.3.3 127.1.1.1 3503Device 2:
frr:~# nc -l -u -p 3503The following packet is generated and captured in wireshark on Device 2 interface:I know that according to RFC 1812 this should never happen. On the other hand this is a valid use case according RFC4379. The trick here that the packet I'm sending is actually not IP routed but MPLS switched and on the last hop the MPLS label is missing due to PHP (Penultimate Hop Popping) and the goal of using 127.0.0.0/8 address as dst is to make sure that when label stack runs out or no valid nexthop then the router will not forward based on IP address but process the packet. This is called MPLS OAM or LSP Ping.
|
How to receive UDP packet with 127.0.0.0/8 dst address in userspace
|
As hinted at in lo(4), you may create /etc/hostname.lo1:
inet 127.0.0.2 255.0.0.0This will create the lo1 interface when the boot process runs /etc/netstart. With that file in place, you may also set up the interface without rebooting through
$ doas sh /etc/netstart lo1The interface is reported as
lo1: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 32768
index 4 priority 0 llprio 3
groups: lo
inet 127.0.0.2 netmask 0xff000000by ifconfig.
For further info, see hostname.if(5), netstart(8) and ifconfig(8).
|
I need one more loopback interface in my OpenBSD 6.1, with the IP address 127.0.0.2.
I can create it by hand with the command:
ifconfig lo1 127.0.0.2And to have it at boot time, I just inserted that command into /etc/rc.local.
I have researched for a more standard way to do that, was not successful.
Having it in /etc/rc.local also means I only have that interface late in the boot process.
How may I configure it in a cleaner "OpenBSD" way?
|
OpenBSD: Defining a new loopback interface
|
In short, they are two different interfaces (192.168.1.97 vs 127.0.0.1), and may have different firewall rules applied and/or services listening. Being on the same machine means relatively little.
|
According to https://networkengineering.stackexchange.com/a/57909/, a packet sent to 192.168.1.97 "doesn't leave the host but is treated like a packet received from the network, addressed to 192.168.1.97." So same as sending a packet to loop back 127.0.0.1.
why does nmap 127.0.0.1 return more services than nmap 192.168.1.97?
Does nmap 127.0.0.1 necessarily also return those services returned by nmap 192.168.1.97? Does a server listening at 192.168.1.97 necessarily also listen at 127.0.0.1?
$ nmap -p0-65535 192.168.1.97Starting Nmap 7.60 ( https://nmap.org ) at 2019-03-23 19:18 EDT
Nmap scan report for ocean (192.168.1.97)
Host is up (0.00039s latency).
Not shown: 65532 closed ports
PORT STATE SERVICE
22/tcp open ssh
111/tcp open rpcbind
3306/tcp open mysql
33060/tcp open mysqlxNmap done: 1 IP address (1 host up) scanned in 9.55 seconds$ nmap -p0-65535 localhostStarting Nmap 7.60 ( https://nmap.org ) at 2019-03-23 19:18 EDT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00033s latency).
Other addresses for localhost (not scanned):
Not shown: 65529 closed ports
PORT STATE SERVICE
22/tcp open ssh
111/tcp open rpcbind
631/tcp open ipp
3306/tcp open mysql
5432/tcp open postgresql
9050/tcp open tor-socks
33060/tcp open mysqlxNmap done: 1 IP address (1 host up) scanned in 5.39 secondsThanks.
|
why `nmap 192.168.1.97` returns less services than `nmap 127.0.0.1`? [duplicate]
|
Can you add a virtual tap device and do the testing on that?
ip tuntap add dev tap0 mode tapYou may need to insert the tun module first.
modprobe tun
|
I would like to add a second loopback network device on Linux, so that I have lo and (e.g.) lo2. This is so that I can use netem to simulate a throttled network over lo2 without compromising my standard loopback interface.
Note that I can not use an alias interface here (such as lo:1) since netem will affect the underlying (lo) interface, not the interface alias.
How can that be done?
|
Second loopback network interface (for netem)
|
No it doesn't affect other interfaces. But the routing involved makes that any access from the server to itself stays local and uses the lo (loopback) interface whatever interface the IP address was assigned to. So lo is affected by tc ... netem.
You can verify this with the ip route get command, which will give something similar to this for your case:
$ ip route get 192.168.0.1
local 192.168.0.1 dev lo table local src 192.168.0.1 uid 1000
cache <local> As you can see the lo interface is used.
There is no reason to disable this behavior. If you somehow manage to emit a packet to 192.168.0.1 through eth1 guess what: you won't receive it on the interface it was emitted from, so it will be lost. You could imagine further a whole convoluted setup, including configuring the switch port where eth1 is plugged to send back to its emitter traffic it received, but sooner or later this will defeat the original purpose of the experiment and the experiment won't work as intended anymore.
To do correct tests when dealing with networking one should always separate local tests and remote tests. If no remote system is available, this can be simulated by using an other network namespace which has its own separate complete network stack. Below is an example (that will not be affected by OP's tc ... netem).
As root user:
ip netns add remote
ip link add name vethtest up type veth peer netns remote name veth0
ip address add 192.0.2.1/24 dev vethtest
ip -n remote link set dev veth0 up
ip -n remote address add 192.0.2.2/24 dev veth0
ip netns exec remote ping 192.0.2.1There are ways to reuse the original interface but this would require some disruption in configuration.
|
I'm trying to modify the network behaviour of my server(s), to simulate external/WAN connection behaviours (what ever that means).
After doing tc qdisc add dev lo root netem delay 100ms, I can successfully add 100ms delay to all traffic from (and to?) 127.0.0.1. E.g. ping 127.0.0.1 will have 200ms response time.
However, this also affect my traffic to other interfaces. For example, I have interface eth1 with IP address 192.168.0.1 on the current server A. If I do ping 192.168.0.1, it will also have the 100ms delay (resulting in 200ms response time).
I'm confused by this behaviour. I would expect lo has nothing to do with eth1, but it seems not to be the case.
I assume this means Linux kernel automatically identifies 192.168.0.1 is a local address, and re-routes all traffic (originally to eth1) to lo?
And if so, is there a way to disable this behaviour?Background:
I would like to simulate external network behaviour even when processes on server A want to communicate to each other (through TCP/IP on the given local addresses and ports, of course). Essentially I want to add delay to eth1, but that's above this question (see my other question).
My servers are running Ubuntu 18.04, but I believe that does not matter.
|
Why does tc-netem on loopback also affects other interfaces?
|
Introduction
For a host system, while sending to a multicast IP address is quite similar to sending to an unicast address, receiving multicast is different and uses additional APIs: an host doesn't assign a multicast address to an interface, instead it joins multicast addresses of interest to receive select multicast traffic when an application (using a socket) on it requests it. This is described in RFC 1112. The RFC's JoinHostGroup and LeaveHostGroup functions are transposed on the BSD socket API used by most *nix by the use of setsockopt(2) options to join and leave multicast groups. IPv6 follows this just as IPv4 but there are differences (including in routing behavior). POSIX even describes in a few places how should be implemented the IPv6 API (it doesn't appear to describe IPv4's multicast so much, perhaps because it's a bit more fragmented among OSes and thus not worth it).
On Linux, the main socket options used are IP_MULTICAST_IF plus IP_ADD_MEMBERSHIP for IPv4 and IPV6_MULTICAST_IF plus IPV6_ADD_MEMBERSHIP (with an alias of IPV6_JOIN_GROUP to follow POSIX) for IPv6. Also of interest to OP's question, but enabled by default: IP_MULTICAST_LOOP and IPV6_MULTICAST_LOOP.
Knowing what happens on the wire to have this work inside a network (IGMP for IPv4 or MLD for IPv6...) or across networks (for example using PIM-SM) isn't needed at the application level (but could be needed to troubleshoot problems, especially those involving switches and multicast snooping).
The remaining answer expects that no special tinkering to network configuration was done on the systems: no multicast address added to any interface and no autojoin option. Note also that 224.4.19.42 belongs to an AD-HOC Block II block assigned to the London Stock exchange. Private Organization-Local Scope blocks can be picked within 239.0.0.0/8.
netcat
netcat (all of its variants) doesn't handle multicast. So while by tweaking the network settings (autojoin is normally intended to be used along configurations involving tunnels) OP managed to use netcat with IPv4 multicast addresses but not IPv6 anyway, any application actually using multicast follows the standards and uses the additional APIs for proper multicast support. A diagnostic tool such as netcat is used to replace a more complex software, but this replacement should be able to do the same: netcat won't.
socat
IPv4
socat has (almost) complete IPv4 multicast support.
The way to send to such multicast group is by stating through which multicast-enabled interface it should be sent through (actually socat only appears to support the address variant of this API, so an interface can't be provided when using socat while the API supports it, unless using dalan raw setsockopt socat option, see below) and optionally by stating if multicast loopback is required (it's enabled by default so useless here, so I'll put it in only one example):
On strawberry, if a default route exists or at least a route to multicast 224.4.19.42 using the expected interface is present, then simply this is enough (the first command doesn't require any multicast-related feature, so that's the only case that nc can also be used for):
echo "Hello 1" | socat -u - UDP4-DATAGRAM:224.4.19.42:9988
echo "Hello 1" | socat -u - UDP4-DATAGRAM:224.4.19.42:9988,ip-multicast-loop=1else the interface has to be specified by an address on it:
echo "Hello 1" | socat -u - UDP4-DATAGRAM:224.4.19.42:9988,ip-multicast-if=192.168.178.109Using the documented dalan format one can use arbitrary socket options in socat using its setsockopt option for the unsupported part of the API described in Introduction paragraph. It is OS and can be architecture dependent. Here it will be about Linux (>= 3.5) on amd64 (x86_64) architecture.
SOL_IP = 0
IP_MULTICAST_IF = 32
expected alternate structure for an in_mreq variant of the API: one IPv4 multicast address (4 bytes in hex for the IPv4 address in big endian format, introduced by a leading x) plus one local address (4 more bytes). For an in_mreqn variant: same plus also one index of integer size introduced by a leading i. Not all parameters must be filled in. Working examples (using JSON format and the jq command to compute the interface index from wlan0):
echo "Hello 1" | socat -u - UDP4-DATAGRAM:224.4.19.42:9988,setsockopt=0:32:x00000000xc0a8b26d
echo "Hello 1" | socat -u - UDP4-DATAGRAM:224.4.19.42:9988,setsockopt=0:32:x00000000x00000000i$(ip -j link show enp4s0 | jq '.[].ifindex')If using ip-multicast-loop=0, then strawberry will not receive its own emitted multicast traffic.
The receiving part has to use IP_ADD_MEMBERSHIP to specify the multicast IP address group to join, and optionally a local address or an interface if one doesn't want to rely on the routing stack to pick the correct choice (again one of these options is needed if there is no correct route to the multicast address, for example if there is no default route or if the default is wrong). Stating this local address shouldn't be needed either when the socket is bound to an address other than INADDR_ANY since then the OS will follow this choice.
The receiving part can use UDP4-RECV (to merge what is received) or UDP4-RECVFROM (to split on each datagram) usually along a fork option. For example:
If there is a route (incl. default) for 224.4.19.42, then on both hosts:
socat -u UDP4-RECV:9988,ip-add-membership=224.4.19.42:0.0.0.0 -Else (here choosing the interface name syntax),for strawberry:
socat -u UDP4-RECV:9988,ip-add-membership=224.4.19.42:wlan0 -for ero:
socat -u UDP4-RECV:9988,ip-add-membership=224.4.19.42:enp4s0 -IPv6
It appears IPv6 support was partially implemented: similar to ip-add-membership for IPv4, the equivalent option ipv6-add-membership does exist in sources and works but is not documented anywhere. All tests were made with socat 7.4.1 so showing this release. The option exists:
#ifdef IPV6_JOIN_GROUP
IF_IP6 ("ipv6-add-membership", &opt_ipv6_join_group)
#endifor an alias:
#ifdef IPV6_JOIN_GROUP
IF_IP6 ("ipv6-join-group", &opt_ipv6_join_group)
#endifwith the format declaration for using setsockopt(2) later:
#ifdef IPV6_JOIN_GROUP
const struct optdesc opt_ipv6_join_group = { "ipv6-join-group", "join-group", OPT_IPV6_JOIN_GROUP, GROUP_SOCK_IP6, PH_PASTSOCKET, TYPE_IP_MREQN, OFUNC_SOCKOPT, SOL_IPV6, IPV6_JOIN_GROUP };
#endifSo basic listening to multicast IPv6 is actually supported (else this would require a dalan setsockopt-listen socat option which requires a recent version). Choosing to send not using the default routing stack's choice isn't natively possible because there is no ipv6-multicast-if option (yet?). It's still available with the dalan format. The structure used for IPV6_MULTICAST_IF requires only an interface index. Using IPV6_MULTICAST_IF is probably always required if the IPv6 multicast scope is below site-local (eg: ff01::/16 or ff02::/16) but is often required for other cases too (see below). Likewise, the parameter ipv6-multicast-loop has not been implemented so also requires a dalan format setsockopt option.
IPv6 routing behavior differs slightly from IPv4 here. It might not follow the default route and might have undefined behavior on a system using multiple interface where routes have not be explicitly defined, depending on the order the interfaces are (re)configured: the routing table could switch from:
# ip -6 route show table all type multicast
multicast ff00::/8 dev wlan0 table local proto kernel metric 256 pref medium
multicast ff00::/8 dev dummy0 table local proto kernel metric 256 pref mediumto
# ip -6 route show table all type multicast
multicast ff00::/8 dev dummy0 table local proto kernel metric 256 pref medium
multicast ff00::/8 dev wlan0 table local proto kernel metric 256 pref mediumjust because an interface went down then up, changing the default interface to be used. Running any kind of container, VM or dynamic interface could lead to this.
In the end, just sending blindly trusting the system's routing stack choice (or if routes are known to be configured correctly) on strawberry (mind the quotes to avoid the shell interpreting brackets needed for IPv6):
echo "Hello 1" | socat -u - UDP6-DATAGRAM:'[ff05::4141]':9988Specifying an interface to send through and explicitly stating to use multicast loopback requires dalan format setsockopt option:
SOL_IPV6 = 41
IPV6_MULTICAST_LOOP = 19
IPV6_MULTICAST_IF = 17
IPV6_MULTICAST_LOOP's boolean: actually integer (hence the letter i used in dalan data format)
IPV6_MULTICAST_IF's index: integer
echo "Hello 1" | socat -u - UDP6-DATAGRAM:'[ff05::4141]':9988,setsockopt=41:19:i1,setsockopt=41:17:i$(ip -j link show wlan0 | jq '.[].ifindex')receiving on strawberry:
socat -u UDP6-RECV:9988,ipv6-add-membership='[ff05::4141]':wlan0 -likewise receiving on ero:
socat -u UDP6-RECV:9988,ipv6-add-membership='[ff05::4141]':enp4s0 -IPv6 multicast communication between an arbitrary number of peers is possible. Here's an example, while disabling receiving its own looped back multicast traffic and specifying the interface:strawberry:
socat UDP6-DATAGRAM:'[ff05::4141]':9988,bind=:9988,ipv6-add-membership='[ff05::4141]':wlan0,setsockopt=41:19:i0,setsockopt=41:17:i$(ip -j link show wlan0 | jq '.[].ifindex') -ero (same, only the interface name chances):
socat UDP6-DATAGRAM:'[ff05::4141]':9988,bind=:9988,ipv6-add-membership='[ff05::4141]':enp4s0,setsockopt=41:19:i0,setsockopt=41:17:i$(ip -j link show enp4s0 | jq '.[].ifindex') -additional systems can run the same command too, only the interface name will possibly differ.Each socat will send data (typed on the terminal) to all other multicast peers and will also read back traffic sent from them (but not from itself).
|
So far I use multicast with ipv4 and it works; all involved computers run linux. I listen on two machines and send on one of those two (in a separate terminal). In the below example 'Hello 1' is received on the sending machine (strawberry) and on the remote machine (ero).
ero:~$ sudo ip addr add 224.4.19.42 dev enp4s0 autojoin
ero:~$ netcat -l -k -u -p 9988strawberry:~ $ sudo ip addr add 224.4.19.42 dev wlan0 autojoin
strawberry:~ $ netcat -l -k -u -p 9988strawberry:~ $ echo "Hello 1" | netcat -s 192.168.178.109 -w 0 -u 224.4.19.42 9988With ipv6 it works as long as only remote machines listen; 'Hello 2' in the below example is received by ero. Once the sender (strawberry) has also joined the multicast group, neither the sender (strawberry) nor the remote machine (ero) receives 'Hello 3':
ero:~$ sudo ip addr add ff05:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:4141 dev enp4s0 autojoin
ero:~$ netcat -l -k -u -p 9988strawberry:~ $ echo "Hello 2" | netcat -w 0 -s 2001:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:76d0 -u ff05:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:4141 9988strawberry:~ $ sudo ip addr add ff05:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:4141 dev wlan0 autojoin
strawberry:~ $ netcat -l -k -u -p 9988strawberry:~ $ echo "Hello 3" | netcat -w 0 -s 2001:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:76d0 -u ff05:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:4141 9988Maybe of interest: when I do not provide a sender address, i.e., no -s option, then the ipv4 example shows the same behaviour as ipv6: message only received as long as strawberry has not joined the multicast group. Thus I tried different sending addresses with ipv6: the global address shown in the example (2001:...), a unique local address (ULA; fd00:...) and a link-local address (LLA; fe80:...). Neither helps.
Any hints what I am doing wrong?
|
ipv6 multicast fails when it should loop back to self
|
What constitutes a “network” (a set of endpoints which are reachable without the help of routers) is determined by the netmask here. Thus docker0 is on the 172.17.x.x network (and can talk to any 172.17.x.x endpoint in the same layer 2 network), lo is on the 127.x.x.x network, virbr0 is on the 192.168.122.x network (and can talk to any 192.168.122.x endpoint in the same layer 2 network), and wlx8 is on the 192.168.1.x network (I’ll let you fill in), and they’re all separate. The loopback network is special in that by default, all 127.x.x.x addresses correspond to the local host.Are docker0, lo and virbr0 are virtual network interfaces?Yes, they don’t correspond to physical network interfaces.Why are docker0 and virbr0 assigned private not loopback IP address?Because they are not loopback interfaces. Such interfaces are generally used to communicate with containers or VMs, which are separate (from a networking perspective, which is what concerns us here) from the local host.If private IP address can work like a loopback address, can lo be assigned a prviate instead of loopback IP address?No, private IP addresses don’t work like a loopback address. (They can be made to work in any way you want, but that’s for networking experts and people who design systems such as Istio with Envoy, which uses an interesting loopback trick for multi-cluster setups.)Loopback addresses are 127.*.*.*. Do they always form a network instead of being split into several smaller networks, as in the example?See my first point.192.168.*.* is a range of private IP addresses. Are they often split into several smaller networks, as in the example (wlx8 and virbr0)?Yes; again, see my first point.
|
Are docker0, lo and virbr0 are virtual network interfaces?
Why are docker0 and virbr0 assigned private not loopback IP address?
If private IP address can work like a loopback address, can lo be assigned a prviate instead of loopback IP address?
Loopback addresses are 127.*.*.*. Do they always form a network instead of being split into several smaller networks, as in the example?
192.168.*.* is a range of private IP addresses. Are they often split into several smaller networks, as in the example (wlx8 and virbr0)?
Thanks.
$ ifconfig
docker0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
ether 02:42:a6:79:a6:bc txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 1552397 bytes 88437726 (88.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1552397 bytes 88437726 (88.4 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:b1:aa:1f txqueuelen 1000 (Ethernet)
RX packets 123 bytes 12102 (12.1 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 39 bytes 4300 (4.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0wlx8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.97 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::a0df:c436:afb1:8b45 prefixlen 64 scopeid 0x20<link>
ether txqueuelen 1000 (Ethernet)
RX packets 991338 bytes 536052615 (536.0 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 618233 bytes 101520924 (101.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
Why is some virtual network interface assigned private IP address, while some is assigned loopback IP address?
|
Use awk and FILENAME variable.
To strip off the extension, you can use the gsub function:
awk -F'\t' 'BEGIN{OFS=FS}{gsub(/.txt$/,"",FILENAME); print FILENAME,$0}' *.txtAdd > MERGE.txt to the end to put the result in a new text file.
|
I have 139 different tab-delimited .txt files. I want to add a column to each file containing the name of that .txt file and finally attached all .txt files in one file; Let's say I have A.txt, B.txt, C.txt files, and in each of these files I have such columns
chrM 10458 C T
chrM 13960 C T
chrM 14173 T C
chr1 920552 G AI need something like
A chrM 10458 C T
A chrM 13960 C T
A chrM 14173 T C
A chr1 920552 G A
B chr1 1350208 G A
B chr1 1447367 T G
B chr1 1909310 G A
B chr1 2172675 G C
C chr1 2846623 C T
C chr1 3057894 G A
C chr1 3096688 G C
C chr1 3154525 G ACan you help me in doing that please?
Thank you
|
How I manupulate these files in terminal at the same time
|
Since the lo interface is not associated with a hardware network interface (it's a virtual loopback interface), it does not have an Ethernet hardware address (MAC address).
Communication though the loopback interface is not MAC-based. No routing needs to take place to send packets between NICs.
|
From https://networkengineering.stackexchange.com/questions/57935/is-a-network-interface-supposed-to-have-no-more-than-one-mac-address/57937?noredirect=1#comment100988_57937A network interface in a MAC-based network always requires a MAC address, virtual or physical. However, there are networks that are not MAC-based.Doesifconfig show lo as a virtual network interface? ifconfig doesn't show its MAC address, does it mean lo has no MAC address, and the network of loopback IP addresses is not MAC-based?
Thanks.
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 2403613 bytes 138542051 (138.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2403613 bytes 138542051 (138.5 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
Does `lo` have no MAC address?
|
What is a loopback file? A file that is treated as a deviceDoes "loopback" in a loopback file mean the same as in loopback IP address?No; the former is sub content the latter is a self reference.Is a loopback file related to https://en.wikipedia.org/wiki/Loop_device, which I am not familiar with either?Yes.
|
man pvcreate sayspvcreate initializes a PV so that it is recognized as belonging to LVM, and allows the PV to be
used in a VG. A PV can be a disk partition, whole disk, meta device, or loopback file.What is a loopback file? Does "loopback" in a loopback file mean the same as in loopback IP address?
Is a loopback file related to https://en.wikipedia.org/wiki/Loop_device, which I am not familiar with either?
Thanks.
|
Does "loopback" in a loopback file mean the same as in loopback IP address?
|
An alternative approach is to use an application forwarder. No iptables or kernel level forwarding is required. In this example I've used socat, but other possibilities may exist. Here the set of permitted source IP addresses is defined as an application argument.
socat TCP-LISTEN:1025,fork,range=192.168.10.0/24,reuseaddr,bind=192.168.10.106 TCP4:127.0.0.1:1025Here, we've two sets of arguments:Listening addressLISTEN:1025 - Listen on this port
fork - Fork a subprocess to handle each inbound request
range=192.168.10.0/24 - Accept requests from devices in this network range
reuseaddr - Allow rapid reuse of address/port tuples
bind=192.168.10.106 - Listen on this address (your eth0)Forwarding/relay addressTCP4:127.0.0.1:1025 - Relay to this address:port
|
Let me open by saying I have scoured the internet, even companies I purchased the software from and it's been 5 months!! So I am turning to the community as my eyes and brain are bleeding from reading and trying this long getting no where. In short, can this be done, YES. Apparently I am too stupid to do it, however at least I have a huge knowledge of iptables now :-)
My requirement: I use protonmail for my email. If you didn't know, it's so secure, that you have to run a "bridge software" running on each machine that needs to send/receive email. I simply want to send emails from myself, to myself, for my smart home, cameras, alerts, etc etc. As you can imagine I can not install this software on 20 devices let alone cameras!!! So I need a single linux server running this software to act as the email "hub"
My network is 192.168.10.0/24 no vlans, no complications (pfsense as my router/firewall)
I am using mxlinux / debian as my "email host" 192.168.10.106 IMAP is listening on port 1143 SMTP is listening on port 1025
All I wanted to do was make it so that ANY device on my network can use 192.168.10.106 to send emails using SMTP on port 1025. Thought this would be easy..but noooooooooooooooooooo simply because the damn software will ONLY listen on 127.0.0.1 !!! I can not change it to something like 0.0.0.0 etc.
First you should know I contacted protonmail directly as it's a paid email service they actually have techs that know what they are doing and talk with you. However, they feel it's a "security risk" to allow their service to listen on 0.0.0.0 so the code will not allow this to be changed. I did the below on the "email server / 192.168.10.106"Edited /etc/sysctl.conf and uncommented the # in front of net.ipv4.ip_forward=1Updated iptables
sudo iptables -t nat -A PREROUTING -i eth0 -p tcp -s 192.168.10.0/24 --dport 1025 -j DNAT --to-destination 127.0.0.1:1025
sudo iptables -t nat -A POSTROUTING -o lo -p tcp --dport 1025 -j SNAT --to-source 192.168.10.106
sudo iptables -A FORWARD -i eth0 -o lo -p tcp --dport 1025 -j ACCEPTMake my entries save on reboot and it's going to ask me if I want to save my above tables, I need to say yes, so I will:
sudo apt install iptables-persistentGo into MX "firewall configuration" and turn off "public, private and office", basically turn off the firewallReboot the computerOK now listing out after a reboot it looks like this. I tried from a windows computer on my network 192.168.10.50 to telnet and as you can see I am seeing packets but it's not working :-( :-( :-( :-( :-( :-( :-( :-( :-( :-( :-(
sudo iptables -t nat -L -n -v
Chain PREROUTING (policy ACCEPT 15748 packets, 1719K bytes)
pkts bytes target prot opt in out source destination
5 260 DNAT tcp -- eth0 * 192.168.10.0/24 0.0.0.0/0 tcp dpt:1025 to:127.0.0.1:1025Chain INPUT (policy ACCEPT 15748 packets, 1719K bytes)
pkts bytes target prot opt in out source destinationChain OUTPUT (policy ACCEPT 730 packets, 73256 bytes)
pkts bytes target prot opt in out source destinationChain POSTROUTING (policy ACCEPT 730 packets, 73256 bytes)
pkts bytes target prot opt in out source destination 0 0 SNAT tcp -- * lo 0.0.0.0/0 0.0.0.0/0 tcp dpt:1025 to:192.168.10.106This is me testing the service on the local host email computer
$ telnet 127.0.0.1 1025
Trying 127.0.0.1... Connected to 127.0.0.1.
Escape character is '^]'.
220 127.0.0.1 ESMTP Service ReadyNotice the dropped packets in eth0 received side
$ uname -a
Linux email 5.10.0-23-amd64 #1 SMP Debian 5.10.179-2 (2023-07-14) x86_64 GNU/Linuxbob@email:~ $ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.10.106 netmask 255.255.255.0 broadcast 192.168.10.255
ether 00:0c:29:63:d5:4f txqueuelen 1000 (Ethernet)
RX packets 126620 bytes 24077186 (22.9 MiB)
RX errors 0 dropped 6447 overruns 0 frame 0
TX packets 30080 bytes 3728557 (3.5 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 57 bytes 4931 (4.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 57 bytes 4931 (4.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0None of the above worked so I tried different variations. I also found a command I was suggested to use that did not seem to help but tried it anyway.
sysctl -w net.ipv4.conf.eth0.route_localnet=1
|
Service only listens on 127.0.0.1 port 1025. How do you allow any computer on your local network to communicate with this service?
|
For RHEL X, where 8 <= X < 9.1
This is addressed explicitly in a knowledgebase article:NetworkManager traditionally did not manage the loopback interface by design.
Red Hat customer Requests For Enhancement resulted in upstream work to add it, which was done in NetworkManager 1.41.6 with:Support loopback interface (v2)This is a large feature and was deemed too risky to backport to RHEL 8's earlier NetworkManager code.The same article suggests creating a systemd unit to manage the configuration of the loopback interface. For example, for what you're doing, something like this would work:
[Unit]
Description=Manage Loopback service
After=network.target[Service]
Type=oneshot
User=root
ExecStart=/bin/bash -c '/usr/sbin/ip addr add 130.100.0.5/24 dev lo'[Install]
WantedBy=multi-user.targetPlace the service in e.g. /etc/systemd/system/configure-loopback.service
Enable it by running systemctl enable configure-loopback.service
RebootYou should end up with:
[root@localhost ~]# ip addr show lo
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet 130.100.0.5/24 scope global lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft foreverOn a RHEL 7 system, if I edit /etc/sysconfig/network-scripts/ifcfg-lo so that it looks like this:
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
IPADDR1=130.100.0.5
NETMASK1=255.255.255.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopbackThen when the system reboots, lo looks like:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet 130.100.0.5/24 brd 130.100.0.255 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft foreverThat seems to accomplish what you want.
|
I can use ip addr add 130.100.0.5/32 dev lo to create a loopback interface.
However, if I use /etc/sysconfig/network-scripts/ifcfg-lo to config it, it doesn't show up:
DEVICE=lo
IPADDR=130.100.0.5
NETMASK=255.255.255.255
ONBOOT=yes
NAME=myloopback:1
|
how can I create additional loopback interface permanentely?
|
If you have multiple interfaces that are all members of the same subnet, then you will see via 'ip route' command that the server has multiple routes it can follow, to get to the same subnet. See Dual Network Gateway on CentOS 6.7 and Routing from 2 WAN to same LAN... even though they describe ifupdown interfaces, the theory applies to netplan. The default gateway will route out all non-LAN traffic fine, but you will lose packets (spoofing security) if they arrive at another 'local' interface but are then routed back out the gateway interface (for example).
To support multiple local interfaces properly, the purist approach would say you should create separate routing tables for each interface. But if you want, just try removing the gateway route (which is effectively what happens when you remove eno1), leaving the local interfaces only, and you should be fine. Of course, you will have to add explicit routes for the gateway traffic, which is another topic.
|
I have a set of 5 static ip addresses. Currently I only have 1 server, so I want to route 2 static IP's to the same server. At the same time I still want the server to be part of the local network.
I have a nic with interfaces eno1, eno2, eno3, eno4. eno1 is connected to my router, which leases using dhcp.
I've set eno2 and eno4 up like this:
network:
version: 2
renderer: networkd
ethernets:
eno2:
dhcp4: no
addresses: [83.111.42.21/29]
gateway4: 83.111.42.26
nameservers:
addresses: [75.75.75.75,75.75.76.76]
eno4:
dhcp4: no
addresses: [83.111.42.22/29]
gateway4: 83.111.42.26
nameservers:
addresses: [75.75.75.75,75.75.76.76]I thought, because these were static IP's directly linked to the server, that locally I would be able to access them using the actual static IP, but I'm unable. Do statically assigned IP's also suffer from loopback?
I did notice that if I disable eno1 (no connection to lan) that I am able to directly connect to the IP's. As soon as I re-enable eno1, I am once more no longer able.
I could really use help understanding the issue. Thanks!
|
Understanding Netplan / NIC [closed]
|
The fact that the block 127.0.0.0/8 is reserved for loopback doesn't imply that your machine is configured for the whole block.
For example, on my Linux deskop:
root:~# ifconfig |grep '127.'
inet 127.0.0.1 netmask 255.0.0.0
root:~# ping -c 1 127.1.1.1
PING 127.1.1.1 (127.1.1.1) 56(84) bytes of data.
64 bytes from 127.1.1.1: icmp_seq=1 ttl=64 time=0.035 ms--- 127.1.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.035/0.035/0.035/0.000 ms
root:~# ifconfig lo 127.0.0.1 netmask 255.255.255.0
root:~# ping -c 1 127.1.1.1
PING 127.1.1.1 (127.1.1.1) 56(84) bytes of data.--- 127.1.1.1 ping statistics ---
1 packets transmitted, 0 received, 100% packet loss, time 0msThis depends on the way interface lo has been configured, especially for the netmask.
|
As we know, the range for loopback addresses is 127.0.0.0 – 127.255.255.255.
On my Linux box, I am able to ping all the addresses like 127.0.0.1, 127.0.0.2, 127.0.0.254, etc. (i.e., all addresses from 127.0.0.1 through 127.0.0.254). But I am unable to ping other addresses, like 127.0.1.1, etc. (It works on my Windows10 laptop, though.) Can someone throw some light on this?
|
Can't ping all the loop back addresses
|
You have missed allowing the loopback device, which is non-optional:
-A INPUT -i lo -m comment --comment loopback -j ACCEPTadd this as the very first rule and you're done. I found a good extensive explanation for you as for what this device represents, etc. on AskUbuntu.Further, I advise optional steps - step 2: allowing ICMP protocol:
-A INPUT -p icmp -m limit --limit 5/sec --limit-burst 15 -m comment --comment icmp -j ACCEPTAnd finally, I advise optional steps - step 3: restrict your SSH connections to local network only, just make sure to change to your subnet:
-A INPUT -s 192.168.0.0/24 -p tcp -m conntrack --ctstate NEW,ESTABLISHED -m tcp --dport 22 -m comment --comment ssh -j ACCEPTSide note: After a few hours you should see such DROP numbers when using INPUT DROP rule:
Chain INPUT (policy DROP 8354 packets, 732K bytes)
num pkts bytes target prot opt in out source destination
1 6315 612K ACCEPT all -- lo any anywhere anywhere /* loopback */
2 13 1072 ACCEPT icmp -- any any anywhere anywhere limit: avg 5/sec burst 15 /* icmp */
3 190K 697M ACCEPT all -- any any anywhere anywhere ctstate RELATED,ESTABLISHED /* traffic */
4 0 0 ACCEPT tcp -- any any 192.168.0.0/24 anywhere ctstate NEW,ESTABLISHED tcp dpt:ssh /* ssh */
|
This is my IPv4 iptables list at this moment:
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:httpsChain FORWARD (policy ACCEPT)
target prot opt source destinationChain OUTPUT (policy ACCEPT)
target prot opt source destinationWhen I try to use apt-get, it fails to translate the DNS names to IPs.
How can I fix this and make it work?
|
IPv4 iptables blocks things, but output policy is ACCEPT, what is the problem with my INPUT DROP chain?
|
There is the pdfnup (or pdfjam) command line tool. You can install it from the repositories of your distribution (sudo apt-get install pdfjam for Debian-based distributions, yaourt -S pdfnup on Arch etc).
The default options will take the input PDF file and produce an output PDF with two input pages per page:
pdfnup -o output.pdf input.pdf
|
Say I start off from a PDF document, say of 12 pages, viewed with evince.
To produce another PDF of 6 sheets, with a page setup of two pages per side,
I normally use the "Print to File" device listed in the ^P dialogue window.
This works out pretty neatly.
I would like to translate this operation for the command line. To my understanding, this is not an operation that pdftk can do. Please cross check.
The command lp, which would accept the option -o number-up=2, does not recognize any device called "Print to File", which indeed does not show up in lpstat -p -d.
I am aware of the post What is “Print to File” and can it be used from command line?. I have installed cups-pdf whereby a new printer named PDF is acknowledged. However, the print quality of a simple text file is way too raw (for example, no print margins to start with). Moreover, if I reprint an existing PDF file on this device, say lp -p PDF existing.pdf, evince can't even manage to open that copycatted output, while this is not the case with the "Print to File" way.
I had a look at man evince. At the bottom, it touches upon a few print preview options and redirects to a GNOME-developer project page. Admittedly I am not able to make sense and use of it. Is there actually a way to combine the flexibility of the command line with the print quality that I obtain from that "Print to File" option in the GUI evince?
My test case, again, would be to create from the command line a PDF out of a source document printed with two pages per sheet.
Thanks for thinking along.
|
Printing two pages per sheet from the command line
|
The right place to set options for the (/this) printer, is in /opt/brother/Printers/mfc9340cdw/inf/brmfc9340cdwrc. The problem of always resulting in a DuplexTumble printing, was forced by the respective code-line (BRDuplex=DuplexTumble) in this configurations file.
Setting the option in question to BRDuplex=DuplexNoTumble, and restarting the cupsd service (in my case, using rc-service cupsd restart for OpenRC) results in double-sided prints binded along a document's long-edge.I came up to check for a file named like br(model name)rc only after reading this section of a relevant Ubuntu-Wiki page: http://wiki.ubuntuusers.de/Brother/Drucker#Problembehebung
|
The default options for a Brother MFC-9340CDW printer, are reportedly (e.g. querried via lpoptions -l) set to:
PageSize/Media Size: *A4 Letter Legal Executive A5 A6 B5 JISB5 JISB6 EnvDL EnvC5 Env10 EnvMonarch Br3x5 FanFoldGermanLegal EnvPRC5Rotated Postcard EnvYou4 EnvChou3 210x270mm 195x270mm 184x260mm 197x273mm
BRDuplex/Two-Sided: DuplexTumble *DuplexNoTumble None
BRInputSlot/Paper Source: AutoSelect *Tray1 Manual
BRResolution/Print Quality: 600dpi *600x2400dpi
BRMonoColor/Color / Mono: Auto FullColor *Mono
BRMediaType/Media Type: *Plain Thin Thick Thicker BOND Env EnvThick EnvThin Recycled Label Glossy PostCard
BRColorMatching/Color Mode: *Normal Vivid None
BRGray/Improve Gray Color: OFF *ON
BREnhanceBlkPrt/Enhance Black Printing: OFF *ON
BRTonerSaveMode/Toner Save Mode: OFF *ON
BRImproveOutput/Improve Print Output: OFF *BRLessPaperCurl BRFixIntensity
BRSkipBlank/Skip Blank Page: *OFF ON
BRBrightness/Brightness: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
BRContrast/Contrast: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
BRRed/Red: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
BRGreen/Green: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
BRBlue/Blue: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
BRSaturation/Saturation: -20 -19 -18 -17 -16 -15 -14 -13 -12 -11 -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 *0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20Though a simple lp(r) command should make use of the default options, duplex printing does not work as expected, e.g., the option *DuplexNoTumble should result in a double sided print of the document so as to turn the paper along its long edge. The result, however, for a PDF document, is a DuplexTumble one!
Even manually setting the options of interest in the command line directly does not complete as expected, e.g.
lp -o PageSize=A4 -o BRDuplex=DuplexNoTumble -o BRInputSlot=Tray1 -o BRResolution=600dpi -o BRMonoColor=Auto -o BRMediaType=Plain -o BRColorMatching=Normal -o BRTonerSaveMode=ON -o BRImproveOutput=BRLessPaperCurl SomeDocument.pdfprints a Short-Edge binded print-out.
Strangely, setting the BRDuplex to None, gives the same Short-Edge Binding. There must be some configuration option set to "Short-Edge Binding" somwhere that overrides the lpoptions.
Where (else) are Duplex printing related options set?DetailsPrinter: Model Name Brother MFC-9340CDW, Main Firmware Version K, Sub1 Firmware Version 1.02, Sub2 Firmware Version F1309271100
OS: Funtoo
Printer Driver Installed via https://github.com/NikosAlexandris/brother-overlay
The http://localhost:631/printers/Brother_MFC-9340CDW reports, however:Driver: Brother MFC-9340CDW CUPS (color, 2-sided printing)
Connection: lpd://192.168.10.6/BINARY_P1
Defaults: job-sheets=none, none media=iso_a4_210x297mm sides=one-sidedSection of interest in the file Brother_MFC-9340CDW.ppd:*%=== BRDuplex ================================
*OpenUI *BRDuplex/Two-Sided: PickOne
*OrderDependency: 25 AnySetup *BRDuplex
*DefaultBRDuplex: DuplexNoTumble
*BRDuplex DuplexTumble/Short-Edge Binding: " "
*BRDuplex DuplexNoTumble/Long-Edge Binding: " "
*BRDuplex None/Off: " "
*CloseUI: *BRDuplex
|
Duplex printing options using lp or lpr
|
CUPS has a filter mechanism to detect the format of its input and convert it to a built-in format (PostScript or to a raster image).
CUPS has a database of file names and magic numbers (distinct from the one used by the file command, but serving a similar purpose and operating on similar principles). It uses this database to construct a transformation chain between the input and a built-in format.
The database is located in /usr/share/cups/mime/ on Arch Linux and Ubuntu; other distributions may use a different path.
If CUPS doesn't recognize the input format, depending on how the filters are set up, it may either assume text or refuse printing. Look for a line containing just application/octet-stream (with nothing else afterwards) in your filters; if it's present, then unrecognized input is passed to the printer, otherwise it'll be rejected as unprintable.
Note that input that looks like text, for example SVG, will be printed as text in any sane configuration. If your installation has nothing that defines the SVG format, then SVG will be recognized under some generic text rule and printed as is.
There's some good documentation about writing filters on the SuSE wiki.
You should install at least the cups-filters package (formerly by Apple and included in CUPS itself, now maintained by OpenPrinting). There's a package in Arch. This includes a filter for JPEG, but not for SVG.
|
I have my default printer set: lpoptions -d HP_ENVY_5530_series.
I can print some text:
echo HELLO > h.txt
lp h.txtCUPS understands many different types of files directly, including text, PostScript, PDF, and image files.I can print a Portable Network Graphics: lp Gnome2.26-printing-dialogue.png.
A Scalable Vector Graphics: lp Cups_simple.svg - prints as its internal text contents, which isn't much use.
A scanned JPEG: lp 022.jpg - gets stopped "Unable to open image file for printing!". If I convert it to a PNG with ImageMagick - convert 022.jpg 022.png, I can then print it lp 022.png.
I would like an explanation for these limitations of the CUPS lp command.
|
limitations of CUPS command line printing of image files
|
No need for the 2 phases to find out the lines beforehand. Just do the whole thing with sed:
sed '/Page # 2/,/Page # 3/!d' < FileName.txt
|
I want to print a text file from X line number to Y line number
The value of X & Y is determined by searching for a specific line in the text file(in this case the page number)
I search for the line by the following command
echo -n |grep -nr "Page # 2" FileName.txt |cut -f1 -d: ; echo -n |grep -nr "Page # 3" FileName.txt |cut -f1 -d:for which I get an out put67
128I want to feed this output to the command below
sed -n 'X,Yp' FileName.txtBut I get them as two different lines how can i feed it to the sed command
There after I want to feed the result of the above command to the lp command something like this...
sed -n 'X,Yp' FileName.txt | lp -dmyprinterCan this be done without creating a file?
|
Print a text file from a line number to another after searching for the lines
|
Use fold. Extracts from the man page:
Wrap input lines in each FILE (standard input by default), writing to
standard output.-b, --bytes
count bytes rather than columns-c, --characters
count characters rather than columns-s, --spaces
break at spaces-w, --width=WIDTH
use WIDTH columns instead of 80Use fold (maybe using the -s option so that it doesn't break your lines mid-word) to set your document to about 80 characters wide and print:
fold -s myfile.txt | lprOr, to save the formatted version:
fold -s myfile.txt > output.txt
|
Whenever I print a text file with the lpr or lp commands, the words are cut off at the end of one line and continue onto the other; for example, 'understand' would be split into 'unde' at the end of line one and 'rstand' at the beginning of other. Is there a way to justify the text of a file somehow for printing ? I've tried lpr -p and -o media=a4, and fit-to-page options, but the words are still cut off.
Solutions that worked for me:garethTheRed's fold: fold -s textfile.txt | lpr
fmt command found here and here: fmt -u -w 80 textfile.txt | lpr ; note , that width 80 could be changed to whatever you like, but for me this seems to work well enough
|
Formatting file in command line for printing
|
That's more the reverse of what groff is designed to do.
What you're looking for can be achieved at least with this combination of tools:aha
wkhtmltopdf
pdf2ps from ghostscriptLike:
printf '\e[31;1mfoo\e[mbar\n' |
aha |
wkhtmltopdf - - |
pdf2ps - output.psA bit overkill but it does the trick. You can probably skip the last part as PDF is as easily printed as postscript nowadays:
printf '\e[31;1mfoo\e[mbar\n' |
aha |
wkhtmltopdf - output.pdfOr you can feed it directly to lp for printing.
|
This question is inspired by this one on SU. How can I print bold or color using lp and ANSI escape sequences? I know how to display, for example, bold text in the terminal:$ echo -e '\033[01;1mthis text will be bold\033[00;0m,this will not'
this text will be bold,this will notHowever, when I pipe this directly to lp I get a file that looks like this:
01;1mthis text will be bold00;0m,this will notSo, I figure the way to do this would be to use groff to create a postscript file and print that. It looks like groff should be able to do this, I know it can correctly convert a man page to a ps file and keep whatever is bold in the man page bold in the postscript. However, the groff documentation is enormous and kind of esoteric to someone with no postscript experience. I have tried various combinations of options, all of which result in a postscript file that looks like the line above:
echo -e '\033[01;1mthis text will be bold\033[00;0m,this will not' | groff >a.ps
echo -e '\033[01;1mthis text will be bold\033[00;0m,this will not' | groff -c >a.ps
echo -e '\033[01;1mthis text will be bold\033[00;0m,this will not' | groff -Pc >a.ps
echo -e '\033\[01;1m\]this text will be bold\033\[00;0m\],this will not' | groff -Tascii >a.ps
echo -e '\033[01;1mthis text will be bold'| groff -man >a.ps
echo -e '\033[01;1mthis text will be bold'| groff -mdoc >a.ps
echo -e '\033[01;1mthis text will be bold'| groff -me >a.ps
echo -e '\033[01;1mthis text will be bold'| groff -mm >a.ps
echo -e '\033[01;1mthis text will be bold'| groff -ms >a.psSo, how can I use lp and groff or any other tool combination to print bold or colored text from the terminal?
|
Can groff create a ps file with interpreted ANSI escape characters?
|
Use the lpoptions command.
That writes settings to ~/.cups/lpoptions or, if run as root, in the system-wide /etc/cups/lpoptions file.
These settings are used when submitting jobs via lp or lpr, hence changes take effect immediately without the need to restart services.
|
I know I can change the characters per inch used by lp with lp -o cpi=12 (or any number you like). But is it possible to change the default value of this option globally? The default, when -o cpi=<N> is not passed, is 10. But I'd like to change this default number to something else so that I do not have to type -o cpi=<mynumber> always and in all scripts I wrote in the past. How can I do this?
|
How to change default cpi for `lp`?
|
Running pdfinfo on the PDF generated by GIMP's print function, as well as checking the PDF file generated by GIMPs's post script function suggests that the program doing the print is Cairo.
Here is the line in the Postscript file:
Creator: cairo 1.14.8 (http://cairographics.org)
|
All programs/commands I attempt to print certain PDFs with (lpr, lp, Okular, Evince, Xpdf) print solid black pages. The one exception is Gimp, which allows me to import PDFs one page at a time and properly print.
Obviously, this isn't a practical solution for multiple PDFs, so I would like to see exactly what command Gimp is using to print so I can try reproducing it from the command line.
I tried running it with the --verbose flag and printing, but there doesn't seem to be any output showing the lp or lpr command Gimp is using. How can I catch this print command?Please Note: I'm not looking for help with the blank page printing problem. There are a ton of posts on that on the internet and it just seems to be black magic how one works for some people but not others. Please refrain from answering/commenting about this.
|
What command is gimp using to print?
|
CUPS replaces lpd and other commands, that's why you see some *.pre-cups files in /usr/sbin.
Usually lpd is configured via /etc/printcap, and more specifically logs will end up in the accounting file specified for each printcap entry with lf= (see man 5 printcap). By default this is /dev/console but as you can see in /etc/examples/printcap this can be redirected to something like /var/log/lpd-errs. CUPS also installs its own printcap.
On the other hand, CUPS logs are inside /var/log/cups/. If you are running CUPS - which has nothing to do with lpd and will in fact replace it when installed - that's where your logs will be in.
If you want to use lpd instead of CUPS you'll need to uninstall the latter. Depending on your printer to use lpd you'll probably need foomatic as well which is available in packages (see the package documentation for installation details).
Also, note that whether you use lpd or CUPS some printers also require a proprietary filter (e.g. EPSON's escpr) which very likely will have to be compiled from source.
|
Where can I find error and log messages from lpd and lpr?
I don't find any ouput when I run "lpr /tmp/test_file"
This terminates without any error.
I had looked for /etc/rc.d/lpd and it is failed. The issue was there is no /usr/sbin/lpd exists. There is only /usr/sbin/lpd.pre-cups
So I far I don't have any luck printing from lpr. On the other hand, using smbclient, I can easily print files.
I am thinking lpr tool is dead or near to stop development, but I don't know.
Can someone provide an alternative or a howto on using lpr?
I also tried CUPS from web interface. But the issue is I cannot use my smb credentials when using cups. It simply takes system user and gives no information.
OS: OpenBSD 6.0
|
where does lpd and lpr log error and messages?
|
Solution found.
On linux if use inetd this line print correct even from unix clients
printer stream tcp nowait lp /usr/lib64/cups/daemon/cups-lpd cups-lpd -o document-format=application/octet-stream -o job-sheets=none,noneThe important part is "-o document-format=application/octet-stream -o job-sheets=none,none"
If use xinetd use this file
service printer
{
socket_type = stream
protocol = tcp
wait = no
user = lp
server = /usr/lib64/cups/daemon/cups-lpd
server_args = -o document-format=application/octet-stream -o job-sheets=none,none
}
|
I have a remote printer by cups(cups-pdf virtual printer) on linux server.
BSD,Hp-ux and linux works fine,on solaris 10 i have
this problem,print the banner only,not the text of file.
I have configured the printer like this
svcadm disable svc:/application/print/server:default
svcadm enable svc:/application/print/server:default
lpadmin -x cupsprinter||echo
lpadmin -p cupsprinter -v /dev/null
lpadmin -p cupsprinter -m netstandard
lpadmin -p cupsprinter -o dest=remotesite -o protocol=bsd -o timeout=22
lpadmin -d cupsprinter
lpadmin -p cupsprinter -I postscript -T PS
accept cupsprinter
/usr/bin/enable cupsprinterOn linux server nothing on error log
What can cause this problem?
|
Solaris 10,print only banner
|
For Ricoh MP C4504, the OpenPrinting database has multiple PPD files available. The recommended one is PDF-based, but since you are using Oracle Linux 6.5, you might perhaps need the PostScript or PCL-XL version; try the PDF version first and see if it works for you.
Download the appropriate PPD file from the OpenPrinting database, then use
lpadmin -p 0321 -P /path/to/the/file.ppdto switch your existing print queue to use the new PPD.
Then run lpoptions -p 0321 -l: on one of the lines, it should list the Finisher option, e.g. something like
Finisher/Finisher: *NotInstalled FinRUBICONB FinVOLGADBK FinVOLGAD FinAMURBBK FinAMURHYThe asterisk indicates the currently selected option.
In the PPD file, this option is defined as:
*OpenUI *Finisher/Finisher: PickOne
*DefaultFinisher: NotInstalled
*Finisher NotInstalled/Not Installed: ""
*Finisher FinRUBICONB/Finisher SR3130: ""
*Finisher FinVOLGADBK/Finisher SR3240: ""
*Finisher FinVOLGAD/Finisher SR3230: ""
*Finisher FinAMURBBK/Finisher SR3220: ""
*Finisher FinAMURHY/Finisher SR3210: ""
*CloseUI: *FinisherSo, apparently FinRUBICONB could be Ricoh's internal project name to the finisher that is officially known as "Finisher SR3130". The stapler is usually part of the finisher unit: you'll need to figure out which type of finisher unit your printer has, then use lpadmin -p 0321 -o Finisher=FinRUBICONB (or whatever matches your actual finisher model) to specify your printer's finisher type.
To find out your printer's finisher type, try using the printer's control panel to get a configuration report printed: it will usually include a list of installed options, and the finisher type should be listed there. Alternatively, you might need to do some physical inspection: the finisher is usually a distinct module with a model number visible somewhere, although it might be inside a door or behind the printer. If all else fails, you could try the finisher types one at a time and see which one works for you and allows the use of all the features your printer+finisher has.
After the finisher type is configured, you should be able to use the stapler.
The options for the stapler are also defined in the PPD file like this:
*JCLOpenUI *StapleLocation/Staple: PickOne
*OrderDependency: 100 JCLSetup *StapleLocation
*DefaultStapleLocation: None
*StapleLocation None/Off: "@PJL SET STAPLE=OFF<0A>"
*StapleLocation StaplessUpperLeft/Top left (stapleless): "@PJL SET STAPLE=STAPLELESSLEFTTOPSLANTPORT<0A>"
*StapleLocation StaplessUpperRight/Top right (stapleless): "@PJL SET STAPLE=STAPLELESSRIGHTTOPSLANTPORT<0A>"
*StapleLocation UpperLeft/Top left: "@PJL SET STAPLE=LEFTTOP<0A>"
*StapleLocation UpperRight/Top right: "@PJL SET STAPLE=RIGHTTOP<0A>"
*StapleLocation LeftW/2 at left: "@PJL SET STAPLE=LEFT2PORT<0A>"
*StapleLocation RightW/2 at right: "@PJL SET STAPLE=RIGHT2PORT<0A>"
*StapleLocation UpperW/2 at top: "@PJL SET STAPLE=TOP2PORT<0A>"
*StapleLocation CenterW/2 at center: "@PJL SET STAPLE=BOOKLET<0A>"
*JCLCloseUI: *StapleLocationYou should see the options also in the lpoptions -p 0321 -l output. However, since this is not a HP printer, the configuration options are worded a bit differently and not prefixed with the letters HP.
Based on the above PPD snippet, the syntax for you would be similar to:
lp -d0321 -n1 -o "StapleLocation=UpperLeft" testpage.pdfYou might have to try the other StapleLocation options: a specific finisher unit might be able to implement only some of them.
The StapleLocation=CenterW is specific to booklet-type finishers: I would hazard a guess that those would be the Fin*BK finishers. A booklet finisher is more complex (= expensive) than a non-booklet one, so I would not expect to find a booklet finisher unless there was a definite need for one.
It might be more convenient to set the printer options using the web GUI at http://localhost:631 (or https://localhost:631), or using some other GUI configuration tool if you have them installed, but the above is the hard-core way of doing it with command-line only. The advantage of it is that it always works, whether you have GUI access available or not.
If your application only takes a printer queue name, you might use the lpoptions command to define multiple "instances"/option sets for the base printer queue, e.g. lpoptions -p 0321/stapled2side -o StapleLocation=whatever -o sides=two-sided-long-edge or whatever, then just tell the application to use printer queue 0321/stapled2side instead of the base queue 0321. You can define several instances for each main queue, each with a different set of options. To list the instances you've already defined, you can use sudo grep Dest /etc/cups/lpoptions.
|
Is it possible to print a document & staple it using the lp command in Linux/Unix? If there are other ways in *nix, I am open for options.
Linux : Oracle Linux Server release 6.5
Printer: Ricoh MP C4504
I tried the "HPStaplerOptions=1StapleRightAngled" option mentioned in below discussion but it did not work.
Print multiple documents and finish all of them with stapler using lp in linux?
This is the command I tried.
lp -c -d0321 -n1 -o "HPStaplerOptions=1StapleRightAngled" testpage.pdfAnd here are the reported options from lpoptions -p 0321:
auth-info-required=none copies=1 device-uri=lpd://print.company.com/0321?timeout=60 finishings=3
job-hold-until=no-hold job-priority=50 job-sheets=none,none marker-change-time=0
number-up=1 printer-info=0321 printer-is-accepting-jobs=true
printer-is-shared=true printer-location printer-make-and-model='Local Raw Printer'
printer-state=3 printer-state-change-time=1666715772 printer-state-reasons=none printer-type=4
printer-uri-supported=ipp://localhost:631/printers/0321Thanks.
|
How to print a document and finish with stapler in Linux/Unix?
|
I stumbled over tea4cups (in Debian the Package is cups-tea4cups), where one can do exactly what I want, like this:
# tea4cups.conf
[myprinter] # just the cups printer name
filter: mycommand
# pipes everything though mycommand, like "<input> | mycommand | lp"
# if the printer URI is prefixed with 'tea4cups://'
|
(How) Is it possible to preprocess lp automatically with a script? Piping inbetween (fileToPrint | script.sh | lp -d myPrinter) is no option for me, because I have a lot of source code that does lp directly (lp -d myPrinter filetoPrint) and there is currently no intention to change this, especially since the script is only needed for one specific printer.
I'm thinking of something like lpoption where I could say (pseduocode) preprocess myPrinter with script.sh (and only for myPrinter, not for myOtherPrinter).
Is this somehow possible?
|
How to preprocess CUPS' `lp` with a script for a specific printer?
|
Solved:
it was a "feature" in lpd. By default, lpd prints a "banner" and creates 2 spool-files. The first spool file has been printet, but it's only the banner and the second file was ignored by cups-pdf.
I had to disable the banner in the xinetd.conf
server_args = -o document-format=application/octet-stream -o job-sheets=none,noneThat solved my problem.
|
I'm using cups-pdf to print via lpd (Port 515)
That's working so far, but all pdf-files are created with its content of the printer configuration. The PDF file includes following:
Media Limits: 0.00 x 0.00 to 8.26 x 11.69 inches
Job ID: PDFPrinter003-197
Driver: CUPS-PDF.PPD
Driver Version: 1.1
Description: SAP2PDF
Driver Version: SAP2PDF
Make and Model: Generic CUPS-PDF Printer (no options)
Printer: PDFPrinter003
Created at: Tue Jun 27 12:42:12 2017
Printed at: Tue Jun 27 12:42:12 2017I can't find anything interesting in the log files.
In /var/log/cups/cups-pdf-PDFPrinter003_log is everything fine about the PDF Creation.
In /var/log/cups/error_log is the following:
W [27/Jun/2017:13:00:11 +0200] CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [27/Jun/2017:13:00:11 +0200] CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [27/Jun/2017:13:00:11 +0200] CreateDevice failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [27/Jun/2017:13:00:38 +0200] CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [27/Jun/2017:13:00:38 +0200] CreateProfile failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [27/Jun/2017:13:00:38 +0200] CreateDevice failed: org.freedesktop.DBus.Error.ServiceUnknown:The name org.freedesktop.ColorManager was not provided by any .service files
W [27/Jun/2017:13:00:46 +0200] Unexpected 'document-format' operation attribute in a Create-Job request.
W [27/Jun/2017:13:00:46 +0200] Unexpected 'document-name' operation attribute in a Create-Job request.My xinetd.conf part for lpd-printing is the following:
service printer
{
socket_type = stream
protocol = tcp
wait = no
user = lp
server = /usr/lib/cups/daemon/cups-lpd
}Please ask if something is missing.
Do you have an idea?
Greetz Eldo.O
|
cups-pdf via cups-lpd creates PDF files with no content but printer config
|
I solved the issue by renaming the file from .mbox to .html and then going into vim example.html and deleting everything that doesn't belong to the html. Then I did firefox example.html and printed from there.
I wrote a small bash script that might help someone with the same problem, but I am not sure if this solution fits every .mbox file with html content.
You can probably also just use lp example.html instead of going into firefox and print from there.
The comments were leading into the right direction I guess.
#!/bin/bash# call this script like this ./scriptname.sh yourfile.mboxFILENAME=$(basename "$1")
FILENAMENOEXT="${FILENAME%.*}"
NEWFILE="${FILENAMENOEXT}.html"# delete old output file if it already exists
if [ -f $NEWFILE ]; then
rm $NEWFILE
fi# cut out everything but html contenthtml_start_string="<!DOCTYPE HTML"html_flag=0while read line
do
if [[ $line =~ $html_start_string ]]; then
html_flag=1
elif [[ $line =~ "--=" ]]; then
html_flag=0
fi
if [ $html_flag -eq 1 ]; then
printf "%s" "${line}" >> "${NEWFILE}"
fi
done < $FILENAMEfirefox $NEWFILE
|
I have to print an email for the district office.
I use Evolution as Email program and I can save the emails in .mbox format.
However when I save those email to a .mbox file and then do lp example.mbox it will print the email in an unreadable way.
It has html content, but I can't open the .mbox in Firefox.
Is there a way I can convert .mbox to .pdf?
Or can I tell the printer how to treat that file somehow?
I don't know how to render that html, it is correctly rendered in Evolution, but I can't print it from there because Evolution does not find my printers.
|
print .mbox file with html content
|
While writing this question I understand my mistake, I should read the command this way:
lp
-d lp1
-h
myfileThe word myfile is just a file name that we print with lp it is not an argument of the -h option.
|
In "Learning the Bash Shell" by O'reilly (third edition), it is written in page 7:
lp -d lp1 -h myfile has two options and one argument.
How come?
I see what I reckon as two options, each one with an argument:
-d lp1
-h myfileNotes
lp prints a file (concretely, via a printer, and not on the terminal).
|
lp -d lp1 -h myfile has two options and one argument or 2 options and 2 arguments?
|
Unfortunately I could not find a fix for this, but I was able to add enough of a transparent border to center the images on the page:
mogrify -bordercolor transparent -border 200 *.png
|
OS is Debian 10. I'm trying to print a batch of images with lp. So far so good. Scaling works great, for example.
Right now I'm printing with:
lp -d "$printer_name" -o ppi=100 -o position=center 1.pngHowever, positioning is not functioning. Leaving position off centers the image top to bottom, but puts it on the left side of the page. position=right has the same result. position=center has the same result. position=left has the same result. position=top puts it at the top left. position=bottom puts it at the bottom left. It's like lp just can't move the image over to the right side of the page for some reason.
What is going on here?
Printing in gimp or firefox works correctly and I can definitely print on the rest of the page.
|
How to center an image on a page with lp?
|
I don't know whether cups (which is probably behind your lp command) supports that printer at all – or whether it's wise to use it; it's not like you want to print complete pages of anything. There might be an lp program
you need if the printer emulates a parallel port, never dealt with that.
Luckily, printers like yours have rather simplistic command languages – ESC/P in your case. You'd want to read the reference manual, especially the example in section R-1.
You'll probably just prepare a "printer setup command sequence" in a file (say "setup"), pipe that file into your printer port (cat setup > /dev/ttyUSB0 or so), and then you'd just pipe lines of text into the same device file.
|
I have a Raspberry Pi running Raspbian and I bought an impact printer (Epson LX-350) that I plan on hooking up to the computer via USB cable once it arrives. My goal is to be able to have a script periodically output lines of ASCII text to the printer as certain events happen. I don't care about it being pretty, in fancy fonts, large font sizes, worrying about files, or worrying about spooling print jobs from multiple users over multiple printers.
It seems like I can plug in the printer, not install any specific drivers, and then use commands like echo "Line 1\r\nLine 2\r\nLine 3\r\n" | lp -d /dev/usb/lpXXX.
I don't have the printer right now to try it out on, but am I missing anything I should research while I'm waiting for the printer to arrive?
|
Printing to Impact Printer from Command Line
|
You are not understanding how iteration works.
Your script says:
Until successful:
print stuff, and delete filesuntil ssh [emailprotected] 'lp -d Brother_HL_L2350DW_series $FILE'
do
echo "trying again"
doneecho "Deleting $FILE"
rm $FILE; There seems to be some other problems:FILE is in capitals (latent bug: capital letters are reserved and should not be used).
Quoting problem $FILE will not be expanded.
It would be a good idea to rate throttle it, put a sleep in there.
|
I wish to keep sending the printer print command until the print succeeds. If it succeeds printing then it should delete the file.
Below is my script.
until ssh [emailprotected] 'lp -d Brother_HL_L2350DW_series $FILE'
do
echo "Deleting $FILE"
rm $FILE;
doneThe issue is that it deletes the file rm $FILE; even if the print command lp -d Brother_HL_L2350DW_series $FILE fails.
Below is a sample failing print command.
ssh root@remotehost 'lp -d Brother_HL_L2350DW_series /home/system/test8.pdf'lp: Transport endpoint is not connected[system@live send4print]$ echo $?
1Can you please suggest how can I meet my requirement?
|
Keep trying a print command LP until successful
|
The Mesa i965 driver doesn’t support all Intel GPUs. There are two Mesa drivers corresponding to the i915 kernel driver: the i965 driver, which supports GPUs since Broadwater (aka 965), and the i915 driver, which supports older GPUs since Grantsdale (aka 915).
The i965 driver was contributed by Tungsten Graphics in Mesa 6.5.1.
|
As I understand, most Intel GPUs are supported on Linux by two different components : i965 (the Mesa/OpenGL part, supporting all recent Intel GPUs) and i915 (kernel part, similarly supporting all recent Intel GPUs).
The relationship between the two is not very clearly explained anywhere I found, especially now that names like iHD (for VAAPI), or Iris (newer chips) are mixed in, but essentially I understand that i965 uses features exposed from the kernel by i915 (syscalls/ioctls?) to expose the OpenGL API to applications.
While Why is the Intel HD Graphics driver called i915? answers the question about the kernel part, why use a similar yet different product name for the Mesa component that supports all Intel GPUs anyway? Is there a reason behind it, or just history?
|
Why is the Mesa OpenGL driver for Intel chips called i965?
|
Don't try to install testing directly on stable! or you'll end up with a FrankenDebian (at best) or will lose a lot of packages due to unrealistic dependencies.
The good news is that those updated packages are available in stretch-backports. Debian's mesa had several packaging changes in testing so also in stretch-backports, related to the vendor neutral's GL dispatch library turning this non-trivial. Also, since you are using multi-arch with both amd64 and i386 packages, those packages must be upgraded in lockstep or you'll get some of the errors you've seen.
I thus can't tell the exact command on how to upgrade mesa only, without upgrading everything (which you should not do: stretch-backports doesn't have security support) but I will give a procedure.
First please follow Debian's instructions on how to add stretch-backports properly. I'll put a simplified summary here:
# echo 'deb http://deb.debian.org/debian/ stretch-backports main contrib non-free' >> /etc/apt/sources.list.d/stretch-backports.list
# apt-get updateAnd DO remove buster/testing/sid entries if you added them.
Some packages might have disappeared (eg libgles1-mesa isn't provided anymore) and others appeared. You will have to upgrade all involved packages in one single apt-get command, so you'd first have to look at the most involved packages with their current version, and let the dependency resolver pick the missing parts (eg: libdrm2). You should do things manually, not in a script because you have to check nothing bad happens (like apt-get offering to delete 100 packages). So something like this:
dpkg -l | fgrep 13.0.6-1+b2or even:
dpkg -l | awk '/^.i/ && $3 == "13.0.6-1+b2" { print $2 }' | xargsto get the main part of the list of packages. DO NOTE that for installed multi-arch packages you must provide both the amd64 package (which is by default so doesn't require the extra :amd64 but you can leave it from the cut/paste) and again the same i386 package (using :i386 appended to the package name) if it was also found in the previous dpkg command. So the final installation command should probably look like:
apt-get -t stretch-backports install libgl1-mesa-dri:amd64 libgl1-mesa-dri:i386 mesa-opencl-icd:amd64 mesa-opencl-icd:i386 ...You get the idea. Now check the number of to be removed packages that are offered. If there are some mesa related packages to be removed (eg: libgles1-mesa) that's fine, if most of them or many unrelated packages are offered to be removed, abort and ponder what might be missing. Of course many others should be offered in addition as upgrade (eg: libdrm2 and libdrm2:i386). It's probably those that might still cause trouble because of multi-arch, so you might have to add them manually twice (once for each arch) to the growing one-liner list if apt-get isn't smart enough.
As suggested by @Stephen Kitt, other useful and related packages, dealing with an improved usage of the hardware, including graphics support, are also available in stretch-backports, and should probably also be upgraded. Among them:linux-image-amd64 which will currently pull linux-image-4.19.0-0.bpo.2-amd64
Various firmware packages (anyway all those that are currently installed should be upgraded), like firmware-misc-nonfree which might include upgraded graphical support and anyway which might have to be upgraded as a (perhaps hidden) dependency for the newer kernel for best results.
|
I need OpenGL 4.5 to be supported by my graphics card's driver, and as far as I know Mesa is actually able to run it.
glxinfo gives me this:
$ glxinfo | grep "OpenGL"
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile
OpenGL core profile version string: 3.3 (Core Profile) Mesa 13.0.6
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 13.0.6
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 13.0.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions:So this means it can only run OpenGL 3.0. So I tried to update it, but I ran into several problems:
If I try to update it through apt, i.e. sudo apt-get upgrade libgl1-mesa-dri -t testing, it is broken:
$ sudo apt-get upgrade libgl1-mesa-dri -t testing
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:The following packages have unmet dependencies:
libsnmp30 : Depends: libsensors4 (>= 1:3.0.0) but it is not going to be installed
mesa-va-drivers : Depends: libsensors4 (>= 1:3.0.0) but it is not going to be installed
mesa-va-drivers:i386 : Depends: libsensors4:i386 (>= 1:3.0.0) but it is not going to be installed
E: Broken packagesOkay, but:
$ apt-cache policy libsensors4
libsensors4:
Installed: 1:3.4.0-4
Candidate: 1:3.4.0-4
Version table:
*** 1:3.4.0-4 900
900 http://ftp.ru.debian.org/debian stretch/main amd64 Packages
100 /var/lib/dpkg/statusSo it depends on the lib version >=1:3.0.0, but I have version 1:3.4.0-4, which is really strange.
Generally, I don't understand how should I upgrade Mesa. If using apt, I don't know which packages should I update. If from source, I don't know how will it interact with apt and if it won't be reverted by an update.
I am using Debian 9 Stretch, and my graphics card is Intel HD Graphics 5000.
|
How to properly update Mesa drivers?
|
You can use the LIBGL_ALWAYS_SOFTWARE environment variable to force software rendering on a per-application basis:
LIBGL_ALWAYS_SOFTWARE=1 [application] [arguments ...]It only works if you are using mesa (which you probably are).
|
I am attempting to figure out if a problem with fonts in Wine is related to my OpenGL driver (r600g). How can I temporarily switch to the llvmpipe software renderer to perform testing, then switch back to r600g? I am using Kubuntu 16.04 with Radeon HD 3200 graphics. Thanks.
|
How to temporarily switch to llvmpipe
|
I wrote up some notes at https://robots.org.uk/LinuxMultiGPUDeviceSelection - these are not complete but could be used as the basis for a more complete answer if someone wants to write one. :)
|
My laptop is a normal, uninteresting machine with two standard, unmultiplexed GPUs and an ordinary Debian stretch installation. The secondary GPU (a Radeon) is usually powered down but I can activate and use it by (for example) DRI_PRIME=1 glxgears. Mesa's source file src/loader/loader.c manages it.
Is DRI_PRIME undocumented?
I wish to read the documentation but cannot find it. Oddly, it isn't here. Moreover, Google cannot locate it. If you know where the documentation is, would you tell?
Switching GPUs is a fairly important system function. One would think that the mechanism that does it would be thoroughly documented, but all I can find are a few oblique changelog entries and some online lore like this.
ADDITIONAL INFORMATION
You won't need Debian to answer my question. Any Linux should do.
In case a reader who wishes to start to learn about GPU switching stumbles in here, he can try sudo cat /sys/kernel/debug/vgaswitcheroo/switch and then read html/newstyle/gpu/vga-switcheroo.html in the Linux kernel source. Also, man 8 lspci. It took me two hours to figure out that much, so I mention it here to save the reader time.
Meanwhile, where is the proper documentation of Mesa environment variables like DRI_PRIME, please?
|
The standard mechanism to switch GPUs isn't undocumented, is it?
|
My understanding is that there's a single kernel driver, amdgpu. Mesa lives in userland and is an OpenGL implementation. amdgpu-pro provides alternative closed-source userland libraries (OpenGL, OpenCL etc).
clover is an OpenCL implementation on top of Mesa. I'm not sure what state it is in (my impression is that it was not very well maintained for some time and development has stalled), but I doubt it will be able to run SYCL programs.
ROCm is more than an OpenCL implementation. It's AMD's GPGPU platform, providing an AI platform, accelerated libraries, tools, and compilers. It also contains an OpenCL implementation.
HIP is not an OpenCL implementation, it's effectively AMD's implementation of the CUDA programming model.
To my knowledge, unfortunately no recent AMD OpenCL implementation is able to run SYCL programs because AMD neither supports SPIR nor SPIR-V. AMD OpenCL has never supported SPIR-V, so DPC++/clang won't work. ComputeCpp can also work with SPIR, but support for that was removed already some time ago from AMD's OpenCL implementation.
As far as SYCL support for AMD is concerned, hipSYCL usually is the way to go. Unfortunately, AMD does not support your specific GPU on ROCm (on which hipSYCL builds) because they focus ROCm support on chips that are also used in data center cards.
See here for more details:
https://github.com/RadeonOpenCompute/ROCm#supported-gpus
oneAPI is Intel's umbrella term for their compute platform, providing libraries, tools and compilers (similarly to ROCm). DPC++/LLVM SYCL/Intel SYCL is part of oneAPI. All those terms refer to the same thing, namely Intel's implementation of the Khronos SYCL 2020 standard. Pretty much all of Intel's extensions have been merged into the SYCL 2020 specification, so don't think about DPC++ as a separate language.
It is possible to add additional backends to oneAPI libraries, for example Codeplay has done so for NVIDIA. It is also in principle possible to port them to another SYCL implementation. We're working on some groundwork to potentially move in that direction with hipSYCL by improving compatibility between hipSYCL and DPC++:
https://www.urz.uni-heidelberg.de/en/2020-09-29-oneapi-coe-urz
It is not possible to run ROCm on top of mesa. It's a fully independent stack for GPU compute. As far as I know there is no interaction between ROCm and mesa.
|
I have an AMD 5700XT gpu and I am trying to learn SYCL but I have a lot of doubts of the current state of AMD gpu driver stacks. According to what I read, there are several driver stacks for AMD gpus: mesa, amdgpu and amdgpu-pro. If I understand correctly, mesa has its own opencl implementation and there is another implementation for the amdgpu drivers.
Also, amd has ROCm, which its another OpenCL implementation, HIP, which something like CUDA and some tooling, right?There is at least 2 implementations, ComputeCpp and hipSYCL, which could possibly run SYCL on AMD gpus. Shouldnt the clang implementation be able to run also on AMD gpus, as according to the image it runs with OpenCL and SPIR-V devices?
In I understand correctly, there is also oneAPI, which is an implementation of SYCL (DPC++) with some extensions (SYCL 2020) and some libraries on top of that SYCL implementation (kind of what cuBLAS or cuSPARSE are to CUDA). Should it be possible to run oneAPI libraries on top of another SYCL implementation?
Fonally, if I use mesa for graphics (OpenGL and Vulkan), is it possible to run ROCm on top of that? How does ROCm and OpenCL mesa implementation interact with mesa graphic drivers?
As you can see I have a big confusion about all the ecosystem. Can someone provide some light on it?
|
SYCL and OpenCL for AMD gpu
|
In Debian, the easiest way to get newer Mesa drivers is to use the backported packages; as root:
echo deb http://httpredir.debian.org/debian jessie-backports main > /etc/apt/sources.list.d/jessie-backports.list
apt-get update
apt-get -t jessie-backports install mesa-vulkan-driversshould do the trick; as of May 2017 that will install version 13.0.6.
If you're a little more adventurous you could try building another version of the Mesa package yourself:
sudo apt-get install devscripts build-essential
dget http://httpredir.debian.org/debian/pool/main/m/mesa/mesa_17.1.0-1.dsc
cd mesa-17.1.0
dpkg-buildpackage -us -ucThe last step will complain about missing build-dependencies, install them and try again.
Finally, the Debian X Strike Force publish instructions for building Mesa from upstream, although they're focused on running a local build just to verify bug fixes, not on replacing the installed Mesa.
|
I found a post about Vulkan for Intel graphic card
(the topic is here)
and decided to try out. It said that it will be available for 5th and higher generation Intel cards. I have an old 3rd gen card which will probably not work, right? I mean Vulkan is a library, so the problem is on Mesa which is basically run Vulkan, and it will work only with new cards, right? Is there any way to run a Vulkan on my old Intel?
I looked more about mesa.
According to Mesa, they released version 13.0.3.
After command glxinfo | grep Open I found out that I have:
OpenGL renderer string: Mesa DRI Intel(R) Ivybridge Mobile
OpenGL core profile version string: 3.3 (Core Profile) Mesa 10.3.2
OpenGL core profile shading language version string: 3.30Time to update, even if Vulkan will not work, installing a new version of Mesa is good. For that, we need to download the new mesa, and according to Mesa :The general approach is the standard:
./configure
make
sudo
make installBut Debian - wiki says that this is not a good idea. How can it be installed correctly; is there any way to do it from apt-get? Is it possible to install it on my system? If it is possible, which dependency must I install/update to do so? On Intel's website, I found out a list/recipe. Do I need install all of that list:2016Q4 Intel Graphics Stack Recipe Released Notes by 20 Dec, 2016in order to update my Mesa?
System : Debian GNU/Linux 8 (jessie) 64-bit
Graphics : Intel® Ivybridge Mobile
glxinfo | grep Open
:
Intel Corporation 3rd Gen Core processor Graphics Controller
...
Kernel driver in use: i915
/-------------------/
I'm asking in order to understand how it work, and how to do it correctly, before I will do anything.
|
Updating Mesa for instaling Vulkan
|
rm -rf ~/.cache/mesa_shader_cacheMore on it here: https://docs.mesa3d.org/envvars.html
|
I would like to delete the Mesa Vulkan shader cache for a particular application I'm using. Where is this cache stored by default on recent (Mesa 19/20) versions?
|
Where does Mesa store its Vulkan shader cache on Linux?
|
focal-updates is missing in your /etc/apt/sources.list, to correct the problem:
echo "deb http://archive.ubuntu.com/ubuntu focal-updates main restricted universe multiverse" |\
sudo tee -a /etc/apt/sources.list
sudo apt update
sudo apt install mesa-common-dev
|
I'm trying to install mesa-common-dev on Ubuntu LTS:sudo apt-get install mesa-common-devhowever, the system returns:
The following packages have unmet dependencies:
mesa-common-dev : Depends: libgl-dev but it is not going to be installed
Depends: libglx-dev but it is not going to be installed
Depends: libglx-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.apt-cache policy mesa-common-devmesa-common-dev:
Installed: (none)
Candidate: 20.0.4-2ubuntu1
Version table:
20.0.4-2ubuntu1 500
500 http://br.archive.ubuntu.com/ubuntu focal/main amd64 Packagesapt-cache policy libgl-devlibgl-dev:
Installed: 1.3.2-1~ubuntu0.20.04.1
Candidate: 1.3.2-1~ubuntu0.20.04.1
Version table:
*** 1.3.2-1~ubuntu0.20.04.1 100
100 /var/lib/dpkg/status
1.3.1-1 500
500 http://br.archive.ubuntu.com/ubuntu focal/main amd64 Packagesapt-cache policy libglx-devlibglx-dev:
Installed: 1.3.2-1~ubuntu0.20.04.1
Candidate: 1.3.2-1~ubuntu0.20.04.1
Version table:
*** 1.3.2-1~ubuntu0.20.04.1 100
100 /var/lib/dpkg/status
1.3.1-1 500
500 http://br.archive.ubuntu.com/ubuntu focal/main amd64 Packagesapt-cache policy libdrm-devlibdrm-dev:
Installed: (nenhum)
Candidate: 2.4.101-2
Version table:
2.4.101-2 500
500 http://br.archive.ubuntu.com/ubuntu focal/main amd64 PackagesThank you so muchgrep -Rn --include=*.list ^[^#] /etc/apt//etc/apt/sources.list:5:deb http://br.archive.ubuntu.com/ubuntu/ focal main restricted
/etc/apt/sources.list:15:deb http://br.archive.ubuntu.com/ubuntu/ focal universe
/etc/apt/sources.list:24:deb http://br.archive.ubuntu.com/ubuntu/ focal multiverse
/etc/apt/sources.list:42:deb http://security.ubuntu.com/ubuntu focal-security main restricted
/etc/apt/sources.list:44:deb http://security.ubuntu.com/ubuntu focal-security universe
/etc/apt/sources.list:46:deb http://security.ubuntu.com/ubuntu focal-security multiverse
/etc/apt/sources.list.d/google-chrome.list:3:deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main
/etc/apt/sources.list.d/opera-stable.list:4:deb https://deb.opera.com/opera-stable/ stable non-free #Opera Browser (final releases)
/etc/apt/sources.list.d/sublime-text.list:1:deb https://download.sublimetext.com/ apt/stable/
/etc/apt/sources.list.d/microsoft-edge-beta.list:3:deb [arch=amd64] http://packages.microsoft.com/repos/edge/ stable mainSUCCESS!!
I add:deb http://archive.ubuntu.com/ubuntu focal-updates main restricted
universe multiversein the source.list file.
thanks for helping me
|
mesa-common-dev: unmet dependencies
|
Solution : The mesa driver is usually installed during the standard installation of Arch Linux. That was probably the problem.
Apparently, the older Intel graphics cards are no longer supported with regard to (OpenGL/Vulkan). In this article it is pointed out that in this case (old graphics card) the "mesa-amber" driver should be installed instead of the "mesa" driver. On the same page, the "vulkan-intel" package is recommended for Vulkan support.
When installing "mesa-amber", "mesa" was uninstalled because otherwise they would conflict. The installation of the "vulkan-intel" package went smoothly.
|
In a fresh Arch Linux Installation with Gnome occurring display errors on specific applications.
I have reinstalled Arch Linux (archlinux-2024.01.01-x86_64.iso) due to display errors after an update using "pacman -Syu" on January 2, 2024.
On Apps like Console, Nautilus:The application window flickers.
In particular, the window-backgroundcolor is missing and the controls ("X" for close) are missing.
There are streaks when moving the window.Unfortunately, the same display errors also occur in the fresh installation. With other applications, such as Gnome-Optimizations or Firefox, these display errors do not occur.
What I have done so far
Alternatively, I installed Arch Linux with Cinnamon and did not get these display errors. However, I would like to get Gnome working again.
System:Notebook: Lenovo B560 (Family: IDEAPAD)
Processor: Pentium P6100, 2 GHz
RAM: 3 GB
Graphic: Intel integrated Graphic Controller, rev. 02
Kernel Driver in use: i915Until this update attempt, this system worked flawlessly.
Does anyone have an idea how I can solve this problem?Until this update attempt, this system worked flawlessly
Best Regards
|
Gnome Shell display error in Arch Linux / Problem with old Intel graphics card
|
TL;DR
Run this in your terminal:
glxinfo | grep -i mesaIf you do see something in the output, then you should be using mesa. If nothing shows up, it's something else.
And if it's something else, glxinfo | grep -i vendor should tell you what it is.Full explanation:
So first of all, it's not really about choosing which OpenGL/Vulkan implementation. The implementation you use depends on which GPU driver you use. So what you really wanna do is to ensure that you are using a GPU driver that Mesa supports.
With that said, there are not many options of GPU drivers anyway. If you are using Intel or AMD, you are most likely already using the open source drivers that work with Mesa. There's simply no other options for Intel, and the proprietary driver of AMD had been deprecated.
If you are using Nvidia, it's a little bit more complicated. As of now, there are three drivers out there - the official and proprietary Nvidia driver, the open-source version of the official Nvidia driver, and nouveau.The first offers the best performance, but, as I said, it's proprietary, and it provides its own proprietary implementation of OpenGL. You can't use mesa with it.The second was a very new thing that was released May this year. It is the open-sourced version of their proprietary driver. It also has it's own implementation of OpenGL, which is not Mesa. But it IS open-source, and offers comparable performance as the proprietary one.The last one, nouveau, is the old open-source driver for Nvidia that was written by the community through reverse-engineering the proprietary Nvidia driver. This used to be the only option if you really want to use open-source driver with Nvidia's GPU, and it does work with Mesa. And since it's based on reverse-engineering, the performance sucks.So, in conclusion, if you happened to be on Nvidia's GPU, and HAVE TO USE MESA, you could go with nouveau, though I do not recommend that due to its poor performance. If you are just looking for being open-source, install the open-source version of the official Nvidia driver. (Remember to uninstall every other driver and only install the driver you want to use.)However, with all that being said, one thing should be clarified.I want to make sure I don't use anything proprietary when I develop stuffAre you actually trying to make sure that "you, yourself, when developing and/or using your computer, are not using anything proprietary", or it's just "nothing in the software that you developed would use proprietary stuff"?
If it's the later case, you don't even need to care about which driver or implementation you are using. They are all OpenGL anyways, and since OpenGL itself is open, you are not using anything proprietary in your own code. If it's the former case, then, as I've said, just install the correct driver and you should be good.
|
As a Linux fan, I want to get into OpenGL development as a hobby of mine.
I know that OpenGL is just an API that the GPU vendors must implement.
Some GPU vendors' OpenGL/Vulkan implementations are proprietary, whilst some are open source (like Intel).
Because I like open source, I want to make sure I don't use anything proprietary when I develop stuff, so how would I go about checking whether or not my GPU is currently using Mesa for rendering?
The reason I am asking is because I've gotten mixed messages online, as I have heard that you can apparently still have Mesa installed but the GPU will be using something else that is proprietary, which is why I wanted to ask this question.
Any help would be appreciated.
|
How to check whether or not your GPU is currently using Mesa for rendering OpenGL/Vulkan?
|
Run sudo pacman -Fy to refresh your package file databases. i965_dri.so is in the mesa-amber package:
↪ pacman -F i965_dri.so
multilib/lib32-mesa-amber 21.3.9-2
usr/lib32/dri/i965_dri.so
extra/mesa-amber 21.3.9-2
usr/lib/dri/i965_dri.so
|
I am trying to get the Intel integrated GPU working with my Parabola (Arch variant) desktop PC. According to lspci, the GPU is:
00:02.0 Display controller: Intel Corporation Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller (rev 09)I have reconfigured my xorg.conf files to point to it; however, when I run startx, I get the following error in the Xorg log file:
[ 1611.090] (II) Initializing extension GLX
[ 1611.101] (EE) AIGLX error: dlopen of /usr/lib/dri/i965_dri.so failed (/usr/lib/dri/i965_dri.so: cannot open shared object file: No such file or directory)
[ 1611.101] (EE) AIGLX error: unable to load driver i965So, it seems to not be able to find the i965 driver for the GPU. Looking in /usr/lib/dri verifies that the driver file is not there:
# ls /usr/lib/dri
crocus_dri.so iris_dri.so nouveau_dri.so r600_dri.so swrast_dri.so vmwgfx_dri.so
d3d12_dri.so kms_swrast_dri.so r300_dri.so radeonsi_dri.so virtio_gpu_dri.so zink_dri.soHowever, if I check the file list for the mesa package I have installed, it says the file should be installed:
# pacman -Fl mesa | grep dri
mesa usr/include/GL/internal/dri_interface.h
mesa usr/lib/dri/
mesa usr/lib/dri/i915_dri.so
mesa usr/lib/dri/i965_dri.so
mesa usr/lib/dri/iris_dri.so
mesa usr/lib/dri/kms_swrast_dri.so
mesa usr/lib/dri/nouveau_dri.so
mesa usr/lib/dri/nouveau_vieux_dri.so
mesa usr/lib/dri/r200_dri.so
mesa usr/lib/dri/r300_dri.so
mesa usr/lib/dri/r600_dri.so
mesa usr/lib/dri/radeon_dri.so
mesa usr/lib/dri/radeonsi_dri.so
mesa usr/lib/dri/swrast_dri.so
mesa usr/lib/dri/virtio_gpu_dri.so
mesa usr/lib/dri/vmwgfx_dri.so
mesa usr/lib/pkgconfig/dri.pc
mesa usr/share/drirc.d/
mesa usr/share/drirc.d/00-mesa-defaults.confHowever, if I check the mesa package tar archive, that driver file is clearly not present:
# tar -tf mesa-22.2.1-1-x86_64.pkg.tar.zst | grep dri
usr/include/GL/internal/dri_interface.h
usr/lib/dri/
usr/lib/dri/crocus_dri.so
usr/lib/dri/d3d12_dri.so
usr/lib/dri/iris_dri.so
usr/lib/dri/kms_swrast_dri.so
usr/lib/dri/nouveau_dri.so
usr/lib/dri/r300_dri.so
usr/lib/dri/r600_dri.so
usr/lib/dri/radeonsi_dri.so
usr/lib/dri/swrast_dri.so
usr/lib/dri/virtio_gpu_dri.so
usr/lib/dri/vmwgfx_dri.so
usr/lib/dri/zink_dri.so
usr/lib/pkgconfig/dri.pc
usr/share/drirc.d/
usr/share/drirc.d/00-mesa-defaults.confSo, what's going on here then? Is 'i965_dri.so' supposed to be provided with mesa, or am I supposed to get it from somewhere else? If it is supposed to be there, I should probably file an issue report?
|
Problem using Intel integrated graphics GPU (Xorg)
|
Summarizing comments: the application probably misbehaves.
OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.2.0This means you have Mesa 11.2 installed, and the maximum supported OpenGL version is 3.3.
Now, why does the application say otherwise? The most common way to query OpenGL version used to be a call to glGetString(GL_VERSION), and that's what the application uses.
Proof it uses that? The MESA_GL_VERSION_OVERRIDE environment variable alters the reported version to whatever you set it to. And setting it to 3.1 makes the application stop to complain.
Now, like all OpenGL functions, glGetString requires an OpenGL context to be active. However, since the release of OpenGL 3.2, to create en OpenGL context, you must state beforehand the version you want. This lets later versions enable compatibility when programs use an older version(*).
The fun thing is here: the version reported by glGetString depends on which version was selected when creating the context. This leads badly implemented and old applications that don't select a profile explicitly to believe the version they asked is the maximum version supported.
And if the application did not select a version, a compatibility context is created automatically with an older version. I think this is the one you see on this line:
OpenGL version string: 3.0 Mesa 11.2.0If this is the actual issue, upgrading will change nothing. But you can keep the MESA_GL_VERSION_OVERRIDE=3.1 trick. It should load a 3.1 profile and make the program happy while waiting for it to be fixed.(*) About profiles. This is something new with OpenGL 3.2, OpenGL feature set can be selected at runtime, by letting the program request an OpenGL version, which the OpenGL implementation will “downgrade” to. That works from version 3.2 forward, leaving the question of what to do with all the older stuff, especially as OpenGL3 is a major revamp of the API (glBegin / glVector and stuff are gone). The choice was made to split the API in two profiles: Core and Compatibility. The compatibility context retains old, obsolete calls while the core context does away with them.
Support of a compatibility context is completely optional though, and while most vendors provide one that roughly matches the time of the split (from 3.0 to 3.2), few bother making newer versions of the compatibility context. That's what @Ruslan was suggesting in his answer: Mesa only supports the compatibility profile for OpengGL 3.0, but nVidia supports higher versions as well. That could make your program happy without having to lie to it.
|
I need to upgrade my OpenGL version from 3.0 to 3.1. Stackexchange is full of postings that tackle specific situations, and it proved difficult for me to see the tree from the wood, not to mention to estimate the ageing of the trees, so to speak.
Therefore, I have collected the following information on my situation, only to ask another case-specific question. The questions are Whether the upgrade is possible
Which steps must/can be taken to that end (please be as specific as possible)The situation is the following:OS: Ubuntu 14.04 LTS
Kernel, from uname -vr: 4.4.0-96-generic #119~14.04.1-Ubuntu SMP Wed Sep 13 08:40:48 UTC 2017
Device, from lshw -c video: VGA compatible controller GT218 [GeForce 210] NVIDIA --- this does support OpenGL 3.1 as from the vendor's specs
Driver from lshw -c video: nouveau
Nouveau info from dpkg -l | grep nouveau
ii libdrm-nouveau2:amd64 2.4.67-1ubuntu0.14.04.2 amd64 [...]
ii libdrm-nouveau2:i386 2.4.67-1ubuntu0.14.04.2 i386 [...]
ii xserver-xorg-video-nouveau-lts-xenial 1:1.0.12-1build2~trusty1 amd64 [...]
OpenGL info from glxinfo | grep OpenGL
OpenGL vendor string: nouveau
OpenGL renderer string: Gallium 0.4 on NVA8
OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.2.0
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 11.2.0
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:Additional info available upon request. For example synaptic lists 28 installed packages responding to the search term 'mesa', but I could not say which one is relevant.
|
Updating OpenGL from 3.0 to 3.1
|
Got it.
Mesa was indeed using my integrated graphic chipset. By launching all the commands with the environment variable DRI_PRIME=1, I was able to directly use my GPU, thus enabling the asked extensions.
Howerver, I am not sure if setting this environment variable each time or globally is a good solution.
|
I am working on OpenGL shaders, and I need uint64_t types, etc...
However, when I do glxinfo, this extension is not in the list.
I am using Mesa 18.0.5, and this page tells that the extension is supported for radeonsi drivers from 17.1.0.
My GPU is a AMD Radeon HD 8730M. I am using the radeon driver, but switching to amdgpu is not helping.
Question: how can I achieve to use uint64 in my shaders? By switching to another driver? By updating Mesa? Or is my GPU too old?
The shader I try to compile:
#version 450
#extension GL_ARB_gpu_shader5 : enable
#extension GL_ARB_gpu_shader_int64 : enablevoid main()
{
uint64_t foo = 0ul;
}I got:
0:3(12): warning: extension `GL_ARB_gpu_shader_int64' unsupported in fragment shader
0:7(11): error: syntax error, unexpected NEW_IDENTIFIER, expecting ',' or ';'glxinfo output:
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_ARB_create_context, GLX_ARB_create_context_profile,
[...]
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Haswell Mobile
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.0.5
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
GL_3DFX_texture_compression_FXT1, GL_AMD_conservative_depth,
[...]
|
Unable to use OpenGL ARB_gpu_shader_int64 extension with Mesa
|
/usr/lib/dri/iris_dri.so is provided by the 32bit version of mesa-dri-drivers so if you really need this one and not the 64bit version (which is in /usr/lib64) install the mesa-dri-drivers.i686 package.
|
I have just installed Fedora 36 on a system, and I am trying to run Mavis Beacon Teaches Typing 15 with wine. The program worked in Fedora 35 after installing mfc42 and corefonts, but is failing in Fedora 36, apparently because /usr/lib/dri/iris_dri.so is missing. I checked, and /usr/lib/dri does not exist. I have reported the problem to WineHQ. What can I do? What is even going on?
|
A wine program needs /usr/lib/dri/iris_dri.so on Fedora 36, what do I do?
|
Play around with ld.so.conf(.d) and LD_LIBRARY_PATH variable. You will find more on this topic in the ld.so(8) manual page.
If a shared object dependency does not contain a slash,
then it is searched for in the following order:(...)Using the environment variable LD_LIBRARY_PATH
(unless the executable is being run in secure-execution
mode; see below). in which case it is ignored.(...)
|
I have installed mesa using apt in my system. This mesa is installed in /usr/lib/arm-linux-gnueabihf directory. Now I compiled and installed the newest version of mesa manually from source, and it's installed in /usr/local/lib/arm-linux-gnueabihf. But my system is still using mesa installed by the package manager.
How can I force system to use newer version of mesa compiled from source?
|
How to prefer software installed in /usr/local
|
_glapi_tls_Dispatch is defined by libglapi.so.0, which is in the libglapi-mesa package. In your case it’s also in /usr/local/lib, and that’s what’s picked up; in the output of ldd /usr/bin/glxgears:
libglapi.so.0 => /usr/local/lib/libglapi.so.0 (0x00007f16637e3000)You need to delete /usr/local/lib/libglapi*.
|
I have had this issue since I installed , and I've been trying to resolve this with my limited experience with linux (which I have been using for ~9 months now).
Internal graphics on debian do not work. I can load X. Almost everything else gives an error like this:
name_of_application: symbol lookup error: /usr/lib/x86_64-linux-gnu/libGL.so.1: undefined symbol: _glapi_tls_DispatchI am sure this is not an issue from the motherboard, because I have checked every setting. Windows 8 works fine, it detects everything without any problems. I've tested a few video games, they all run well.
I managed to circumvent this problem for a few months by installing
libgl1-mesa-swx11
over
libgl1-mesa-glx
That package uses a software decoder and although it manages to crcumvent the issue, the performance is not very good. I've decided to switch back to libgl1-mesa-glx to solve this issue. T
# dmidecode --type baseboard
# dmidecode 3.0
Getting SMBIOS data from sysfs.
SMBIOS 3.0 present.Handle 0x0002, DMI type 2, 15 bytes
Base Board Information
Manufacturer: MSI
Product Name: B150M PRO-VDH (MS-7982)
Version: 1.0
Serial Number: G416029796
Asset Tag: Default string
Features:
Board is a hosting board
Board is replaceable
Location In Chassis: Default string
Chassis Handle: 0x0003
Type: Motherboard
Contained Object Handles: 0Handle 0x0039, DMI type 41, 11 bytes
Onboard Device
Reference Designation: Onboard IGD
Type: Video
Status: Enabled
Type Instance: 1
Bus Address: 0000:00:02.0Handle 0x003A, DMI type 41, 11 bytes
Onboard Device
Reference Designation: Onboard LAN
Type: Ethernet
Status: Enabled
Type Instance: 1
Bus Address: 0000:00:19.0Handle 0x003B, DMI type 41, 11 bytes
Onboard Device
Reference Designation: Onboard 1394
Type: Other
Status: Enabled
Type Instance: 1
Bus Address: 0000:03:1c.2~
# inxi -Gxx
Graphics: Card: Intel HD Graphics 510 bus-ID: 00:02.0 chip-ID: 8086:1902
Display Server: X.org 1.18.3 drivers: intel (unloaded: fbdev,vesa)
tty size: 99x25 Advanced Data: N/A for root~
# aptitude reinstall firmware-misc-nonfree xserver-xorg-core xserver-xorg-video-intel libegl1-mesa libgl1-mesa-glx libgl1-mesa-dri
The following packages will be REINSTALLED:
firmware-misc-nonfree libegl1-mesa libgl1-mesa-dri libgl1-mesa-glx
xserver-xorg-core xserver-xorg-video-intel
The following packages will be REMOVED:
linux-headers-4.8.0-0.bpo.2-amd64{u}
linux-headers-4.8.0-0.bpo.2-common{u} linux-kbuild-4.8{u}
0 packages upgraded, 0 newly installed, 6 reinstalled, 3 to remove and 0 not upgraded.
Need to get 0 B/12.4 MB of archives. After unpacking 30.8 MB will be freed.
Do you want to continue? [Y/n/?] y
(Reading database ... 327171 files and directories currently installed.)
Removing linux-headers-4.8.0-0.bpo.2-amd64 (4.8.15-2~bpo8+2) ...
Removing linux-headers-4.8.0-0.bpo.2-common (4.8.15-2~bpo8+2) ...
Removing linux-kbuild-4.8 (4.8.15-2~bpo8+2) ...
(Reading database ... 314918 files and directories currently installed.)
Preparing to unpack .../libegl1-mesa_13.0.5-1~bpo8+1_amd64.deb ...
Unpacking libegl1-mesa:amd64 (13.0.5-1~bpo8+1) over (13.0.5-1~bpo8+1) ...
Preparing to unpack .../libgl1-mesa-dri_13.0.5-1~bpo8+1_amd64.deb ...
Unpacking libgl1-mesa-dri:amd64 (13.0.5-1~bpo8+1) over (13.0.5-1~bpo8+1) ...
Preparing to unpack .../xserver-xorg-core_2%3a1.16.4-1_amd64.deb ...
Unpacking xserver-xorg-core (2:1.16.4-1) over (2:1.16.4-1) ...
Preparing to unpack .../libgl1-mesa-glx_13.0.5-1~bpo8+1_amd64.deb ...
Unpacking libgl1-mesa-glx:amd64 (13.0.5-1~bpo8+1) over (13.0.5-1~bpo8+1) ...
Preparing to unpack .../firmware-misc-nonfree_20161130-2~bpo8+1_all.deb ...
Unpacking firmware-misc-nonfree (20161130-2~bpo8+1) over (20161130-2~bpo8+1) ...
Preparing to unpack .../xserver-xorg-video-intel_2%3a2.99.917+git20161206-1~bpo8+1_amd64.deb ...
Unpacking xserver-xorg-video-intel (2:2.99.917+git20161206-1~bpo8+1) over (2:2.99.917+git20161206-1~bpo8+1) ...
Processing triggers for glx-alternative-mesa (0.7.3~bpo8+1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for libc-bin (2.24-5) ...
Setting up libegl1-mesa:amd64 (13.0.5-1~bpo8+1) ...
Setting up libgl1-mesa-dri:amd64 (13.0.5-1~bpo8+1) ...
Setting up libgl1-mesa-glx:amd64 (13.0.5-1~bpo8+1) ...
Setting up xserver-xorg-core (2:1.16.4-1) ...
Setting up firmware-misc-nonfree (20161130-2~bpo8+1) ...
update-initramfs: deferring update (trigger activated)
Setting up xserver-xorg-video-intel (2:2.99.917+git20161206-1~bpo8+1) ...
Processing triggers for initramfs-tools (0.120+deb8u2) ...
update-initramfs: Generating /boot/initrd.img-4.9.0-0.bpo.2-amd64
W: Possible missing firmware /lib/firmware/i915/kbl_guc_ver9_14.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_guc_ver8_7.bin for module i915~
# glxinfo
glxinfo: symbol lookup error: /usr/lib/x86_64-linux-gnu/libGL.so.1: undefined symbol: _glapi_tls_Dispatch~
# glxgears
glxgears: symbol lookup error: /usr/lib/x86_64-linux-gnu/libGL.so.1: undefined symbol: _glapi_tls_Dispatch~
# inxi
CPU~Dual core Intel Pentium G4400 (-MCP-) clocked at Min:799.822Mhz Max:800.024Mhz Kernel~4.9.0-0.bpo.2-amd64 x86_64 Up~53 min Mem~1091.2/7801.4MB HDD~1000.2GB(62.4% used) Procs~165 Client~Shell inxi~2.1.28 cat /etc/default/grub (I removed the comments)
GRUB_DEFAULT=0
GRUB_TIMEOUT=3
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX="initrd=/install/initrd.gz"
GRUB_INIT_TUNE="480 440 1"
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i915.preliminary_hw_support=1"
edd=on
video=i915:modeset=0Improperly linked files are probably the issue, but I have no clue how to resolve that. I'll provide any other logs you want.
ldd /usr/bin/glxgears shows
linux-vdso.so.1 (0x00007ffc85b72000)
libGLEW.so.1.10 => /usr/lib/x86_64-linux-gnu/libGLEW.so.1.10 (0x00007f1665f22000)
libGLU.so.1 => /usr/lib/x86_64-linux-gnu/libGLU.so.1 (0x00007f1665cb4000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/libGL.so.1 (0x00007f1665a40000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f166573c000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f16653f9000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f16651e5000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1664e47000)
libXmu.so.6 => /usr/lib/x86_64-linux-gnu/libXmu.so.6 (0x00007f1664c2e000)
libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f1664a1e000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f166469d000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f1664486000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f166425a000)
libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007f1664057000)
libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007f1663e54000)
libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007f1663c4d000)
libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007f1663a4b000)
libglapi.so.0 => /usr/local/lib/libglapi.so.0 (0x00007f16637e3000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f16635de000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f16633d8000)
libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f16631d6000)
libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007f1662fbd000)
libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007f1662db8000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f1662b96000)
libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f166298e000)
libdrm.so.2 => /usr/local/lib/libdrm.so.2 (0x00007f1662780000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1662563000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f166235f000)
/lib64/ld-linux-x86-64.so.2 (0x000055b24657c000)
libXt.so.6 => /usr/lib/x86_64-linux-gnu/libXt.so.6 (0x00007f16620f6000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f1661ef0000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f1661ceb000)
libSM.so.6 => /usr/lib/x86_64-linux-gnu/libSM.so.6 (0x00007f1661ae3000)
libICE.so.6 => /usr/lib/x86_64-linux-gnu/libICE.so.6 (0x00007f16618c6000)
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f16616c1000)
|
Unable to properly configure Intel HD 510 (Skylake) graphics on Debian Jessie
|
Some setting I had not noticed accessible via the nvidia X server settings utility
(X Screen 0 > OpenGL Settings > Enable Graphics API Visual Indicator)
Seems to command to that display irrespective of the __GL_SHOW_GRAPHICS_OSD environment variable value.
A post 340 nvidia-drivers novelty I had not noticed.
|
Since I cannot precisely tell what upgrade (possibly nvidia-drivers from 340 to 470 or mesa 20 to 22 or even xorg-server 1.20 to 21) or following the first time I ran glxgears after upgrading ? :
I (not systematically though) can see, superposed on the upper left corner of the window of applications such as vlc or chromium, some report very similar to the one I would get running glxgears as one can see below on some screen capture of vlc upper-left window corner :Is this a bug ? a misconfiguration problem ?a feature ? Whatever : How can I just get rid of this ?EDIT 1 : Would that be the Graphics API Visual Indicator ?
I'd be surprised since its display is not systematic and I made sure the __GL_SHOW_GRAPHICS_OSD environment variable is not set.BTW : Running a KDE-Plasma desktop, I know it offers the possibility to display informations regarding the frame rate but I do not think this very question related since this option is not set and the display of this information is radically different.
|
Spurious display of frame-time statistics on some applications
|
The problem was that my steam installation came from Flathub repository where the runtime is loaded in an isolated environment (sandbox). Therefore steam cannot see far from its root path (/home/user/var/app.valve...). It seems that the isolation was the cause to display such mismatch between version when running DXVK_HUD but I cannot confirm as you will see in the 3rd paragraph.
Probably the Flathub's steam was reading my host package versions badly, reporting incorrect versions but using them as well since I haven't even LLVM 7 installed, then how come can DXVK_HUD say that I'm using it?
From now, I've solved the issue by removing the Flathub version of steam and installing the package located in multilib (32 bit ARCH repo). Now versions of Mesa, Vulkan-API and LLVM match between my host and the ones displayed by DXVK_HUD. I start to think that this issue may exist between users of the Flathub's steam version, but who knows I haven't found any post online discussing my problem.
|
Proton is working fine with the latest DXVK implementation but when I browse on the log files of the games used by Proton I notice a mismatch between the mesa driver version of my host system and the listed there. What I know so far is that dxvk is a bridge so calls from D3D10/D3D11 can be translated to Vulkan and processed in your host system, thus relying on your graphical driver and the Vulkan mesa driver (Amdgpu RADV in my case).
These are the mesa driver version and the apiversion used by Vulkan listed on the log of the game loaded by Proton (a win64 game):AMD RADV POLARIS10 (LLVM 7.0.1):
Driver: 18.3.6
Vulkan:
1.1.70The output of vulkaninfo reports apiversion "1.1.90" which is different form the version "1.1.70" used on Proton:Vulkan Instance Version: 1.1.107
GPU id : 0
(AMD RADV
POLARIS10 (LLVM 8.0.0))
apiVersion = 0x40105a (1.1.90)
driverInfo = Mesa 19.1.0 (LLVM 8.0.0)The output from glxinfo agrees on the mesa driver version and on the version of LLVM displayed on vulkaninfo:OpenGL renderer string: Radeon RX 570 Series (POLARIS10, DRM 3.30.0,
5.1.14-arch1-1-ARCH, LLVM 8.0.0)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 19.1.0Also, before the vulkan environment initialization happens, the following DLLs are loaded as reported by the log of the game:Loaded L"C:\windows\system32\vulkan-1.dll" at 0x7fa05e6e0000: builtin
Loaded L"C:\windows\system32\winevulkan.dll" at 0x7fa05e6a0000: builtinMaybe these DLLs are the causative of such a mismatch.
EDIT: When opening another game on Lutris with custom DXVK_HUD options I can see that both vulkan API version and mesa version match respective versions on my host. Still don't know why Proton has that behaviour.
SummarizingLLVM version from Proton is different from the version found on my
graphics driver: LLVM 7.0.1 (Proton) - LLVM 8.0.0 (Host)
Mesa driver version from Proton is different from the version of the
mesa driver that provides GL and VK implementation on my host
system: Mesa 18.3.6 (Proton) - Mesa 19.1.0 (Host)
Vulkan API version from Proton is different from the version used by
the implementation of Vulkan as reported by vulkaninfo: 1.1.70
(Proton) - 1.1.90 (Host)I'm missing something here AFAIK Proton doesn't provide it's own mesa implementation. Can anyone shed some light and tell me why such a mismatch exists between these versions?
|
Mismatch between mesa+vulkan driver verison used by Proton and the host mesa driver version
|
The easiest you can do is bypass module filtering.
Edit /etc/yum.repos.d/epel.repo and add module_hotfixes=1 line under the [epel] section.
Done. The installation will succeed.
However the above can be too broad solution. The alternative could be to set module_hotfixes just in the command via --setopt:
dnf --enablerepo=epel --setopt=epel.module_hotfixes=true install libssh2-1.9.0
|
The libssh2 1.9 can't be installed from EPEL repository on RHEL 8.1 and newer (tested on RHEL 8.3):
# dnf --enablerepo=epel install libssh2-1.9.0
...
All matches were filtered out by modular filtering for argument: libssh2-1.9.0
Error: Unable to find a match: libssh2-1.9.0Other EPEL RPMs can be installed without any obstacles.
How can I install the libssh2 without downloading it and installing localy?
|
libssh2 filtered out by modular filtering on RHEL 8
|
This is neither strange nor a bug in bash (it does seem to be a bug in /usr/share/modules/init/bash though). You are using an unquoted command substitution together with eval. The string that is the result of the command substitution will, since it is unquoted, undergo word splitting and filename expansion (globbing). The *) in the code matches the filename a(), so it is replace by this filename in the filename expansion stage.
Running your example under set -x highlights this:
$ eval $(cat foo.sh)
++ cat foo.sh
+ eval 'foo()' '{' 'somevar=1;' case somevar in 'aha)' echo '"something"' ';;' 'a()' echo '"other"' ';;' 'esac;' '};'
bash: syntax error near unexpected token `('The same thing in the yash shell:
$ eval $(cat foo.sh)
+ cat foo.sh
+ eval 'foo()' '{' 'somevar=1;' case somevar in 'aha)' echo '"something"' ';;' 'a()' echo '"other"' ';;' 'esac;' '};'
eval:1: syntax error: `)' is missing
eval:1: syntax error: `esac' is missing
eval:1: syntax error: `}' is missingAnd with ksh93:
$ eval $(cat foo.sh)
+ cat foo.sh
+ eval 'foo()' '{' somevar='1;' case somevar in 'aha)' echo '"something"' ';;' 'a()' echo '"other"' ';;' 'esac;' '};'
ksh93: eval: syntax error: `(' unexpectedAnd dash:
$ eval $(cat foo.sh)
+ cat foo.sh
+ eval foo() { somevar=1; case somevar in aha) echo "something" ;; a() echo "other" ;; esac; };
dash: 1: eval: Syntax error: "(" unexpected (expecting ")")Only the zsh would handle this as it does not perform the globbing:
$ eval $(cat foo.sh)
+zsh:2> cat foo.sh
+zsh:2> eval 'foo()' '{' 'somevar=1;' case somevar in 'aha)' echo '"something"' ';;' '*)' echo '"other"' ';;' 'esac;' '};'The correct way to handle this would be to source the foo.sh script:
. ./foo.shThere is really no reason to use eval "$(cat foo.sh)" as far as I can see.
This is also a code injection vulnerability:
$ touch '*) echo "hello" ;; *)'
$ eval $(cat foo.sh)
$ declare -f foo
foo ()
{
somevar=1;
case somevar in
aha)
echo "something"
;;
*)
echo "hello"
;;
*)
echo "other"
;;
esac
}Another way of breaking this command easily without creating a specially named file, is to set the IFS variable to a set of characters other than the default:
$ IFS=';{} '
+ IFS=';{} '
$ eval $(cat foo.sh)
++ cat foo.sh
+ eval 'foo()' '
' somevar=1 '
' case somevar 'in
' 'aha)' echo '"something"' '' '
' '*)' echo '"other"' '' '
' esac '
' ''
bash: syntax error near unexpected token `somevar=1'This breaks it because of the word-splitting step rather than the file globbing step in the evaluation of the arguments to eval. With IFS=';{} ', each of those characters would be used to split the text in foo.sh up into words (and those characters would then be removed from the string).
Not even zsh would be immune to this:
$ IFS=';{} '
+zsh:2> IFS=';{} '
$ eval $(cat foo.sh)
+zsh:3> cat foo.sh
+zsh:3> eval 'foo()' $'\n' 'somevar=1' $'\n' case somevar $'in\n' 'aha)' echo '"something"' '' $'\n' '*)' echo '"other"' '' $'\n' esac $'\n' '' ''
zsh: parse error near `)'Related:Security implications of forgetting to quote a variable in bash/POSIX shells
When is double-quoting necessary?
Why does my shell script choke on whitespace or other special characters?
|
I encountered a strange bug today, when running a script in a directory containing a directory with parentheses in it, such as a().
Minimal working example
I managed to reduce the bug to the following minimal working example:
Create an empty directory in /tmp and cd into it:
mkdir /tmp/foo
cd /tmp/fooCreate a script named foo.sh in it containing:
foo() {
somevar=1;
case somevar in
aha) echo "something" ;;
*) echo "other" ;;
esac;
};Run the following command:
eval $(/bin/cat foo.sh)There should not be any error.
Create a file with parentheses:
touch "a()"Run the command again:
eval $(/bin/cat foo.sh)I now get the error:
bash: syntax error near unexpected token `(' Why does bash even care about what files are in the directory? Why do parentheses cause an error?
System information:
$ bash --version
GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)
Copyright © 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://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.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionicMore detailed background and original error:
My problem came from using a script sourcing /usr/share/modules/init/bash from the environment-modules package, as summarized here:
$ dpkg -l environment-modules
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=============================================================-===================================-===================================-================================================================================================================================
ii environment-modules 4.1.1-1 amd64 Modular system for handling environment variables
$ source /usr/share/modules/init/bash
$ touch "a()"
$ source /usr/share/modules/init/bash
bash: eval: line 43: syntax error near unexpected token `('
bash: eval: line 43: ` a() _mlshdbg='' ;;'
|
File with parentheses/brackets in working directory causes eval error
|
fuse is not supported in WSL 1
From WSL Issue #2869, a comment by therealkencNo Linux modules on WSL because no Linux kernel in WSL.fuse is compiled into WSL 2
From MSPoweruser article Windows Subsystem for Linux (WSL) 2 support coming to Windows 10 version 1903 and 1909Full Linux kernel built into WSL 2And from WSL Issue #17, a comment by therealkencFUSE is statically compiled into the WSL2 kernel. In general modprobe is not applicable in WSL2 by-designCredit @Steve Bennett.
|
Trying to use veracrypt (console) in WSL.
I make a volume, seems to work OK... but when I try to mount it:
Done: 100.000% Speed: 5.0 MiB/s Left: 0 sThe VeraCrypt volume has been successfully created.
m17awl@M17A:/media/mike$ veracrypt /mnt/e/test.vc /media/mike/rsync_vc_drive_e/
Enter password for /mnt/e/test.vc:
Enter PIM for /mnt/e/test.vc:
Enter keyfile [none]:
Protect hidden volume (if any)? (y=Yes/n=No) [No]:
Error: fuse: device not found, try 'modprobe fuse' firstNB have seen this question, but when I try these commands I get this:
m17awl@M17A:/media/mike$ modprobe fuse
modprobe: FATAL: Module fuse not found in directory /lib/modules/4.4.0-19041-Microsoft
m17awl@M17A:/media/mike$ modprobe loop
modprobe: FATAL: Module loop not found in directory /lib/modules/4.4.0-19041-Microsoft
m17awl@M17A:/media/mike$ lsmod
libkmod: ERROR ../libkmod/libkmod-module.c:1668 kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory
Error: could not get list of modules: No such file or directory... obviously these problems may be WSL-specific. I have no idea, and have never heard of these Linux "modules" (am low-level, sorry!).
As a workaround I installed the W10 version of veracrypt console (the point of wanting to use the console version being that I want to mount and dismount from scripts). This also ran into a problem, as documented here, although I've managed to find a sub-optimal way of mounting, here, which at least works...
|
"modprobe fuse" on WSL?
|
As @matzeri points out, it seems meld is hard-coded to python 3.6 - while Cygwin64, as of September 2021, has Python 3.8 as the default alternative for python3.
Now, I don't want to change the default for all apps, but - we can still oblige meld itself, manually:Copy /usr/bin/meld to /usr/local/bin/meld
In /usr/local/bin/meld, replace:#!/usr/bin/python3with:
#!/usr/bin/python3.6this will at least resolve the missing module problem - although you may encounter other issues.
Remember you have a local version to delete/update when you next update meld itself!Edit: If you encounter this issue on another Linux distribution, the direct problem is that the meld subdirectory is not found in python's package search path. So, supposing meld is being run by python version N.M, you are likely missing
/usr/lib/pythonN.M/site-packages/meld/or a meld subdirectory in wherever python stores its "site-packages". This can sometimes be resolved by hard-coding meld to use another python version - but only if that version has an appropriate meld site-packages folder. Otherwise, you'll need to reinstall or manually install meld, making sure that subdirectory is put in place.
|
I'm using Cygwin 64 on Windows 10; just updated. Some relevant package versions:meld: 3.18.0-1
python3: 3.8.6-1
python2: 2.7.18-4I'm also using MobaXTerm's X server (and it works - I can run xclock for example.)
When I run meld in a Cygwin bash session (within mintty), I get:
Traceback (most recent call last):
File "/usr/bin/meld", line 71, in <module>
import meld.conf
ModuleNotFoundError: No module named 'meld'Why is this happening, and how can I get meld to properly run?
Notes:I think this question is on-topic here, but I wasn't quite sure; if it isn't, please comment and I'll move this to SU or whatever.
A related question, which in fact would be even more on-topic here...: Can not start meld on ubuntu 16.04 as error import meld.conf.
|
meld won't start on Cygwin: No module named 'meld'
|
This is a case where including loops directly in the inlined jinja2 template will be hardly avoidable (and is therefore acceptable):
- name: Dynamicaly construct menu
pause:
prompt: |-
Ansible options:
=====================================
{% for option in menu.ansible.main %}
{{ option.option }}- {{ option.name }}
{% endfor %}
register: resultResult with that fixed task:
$ ansible-playbook test.yml PLAY [PLAY: > TEST] ***************************************************************************************************************TASK [Dynamicaly construct menu] **************************************************************************************************
[Dynamicaly construct menu]
Ansible options:
=====================================
1- Add...
2- Delete...
3- Empty...
:
1^Mok: [localhost]TASK [debug] **********************************************************************************************************************
ok: [localhost] => {
"msg": "Option 1 was selected"
}PLAY RECAP ************************************************************************************************************************
localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 $ ansible-playbook test.yml PLAY [PLAY: > TEST] ***************************************************************************************************************TASK [Dynamicaly construct menu] **************************************************************************************************
[Dynamicaly construct menu]
Ansible options:
=====================================
1- Add...
2- Delete...
3- Empty...
:
2^Mok: [localhost]TASK [debug] **********************************************************************************************************************
skipping: [localhost]PLAY RECAP ************************************************************************************************************************
localhost : ok=1 changed=0 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
|
The goal here is to dynamically construct a menu from an available variable file
In this example I use ansible.builtin.pause module but I'm not sure this is the best way
variable file: vars.yml
---
menu:
ansible:
main:
- option: 1
name: "Add..."
- option: 2
name: "Delete..."
- option: 3
name: "Empty..."
add:
- option: 1
name: "Add something..."
- option: 2
name: "Add something to..."
delete:
empty:
ssh:
main:playbook: test.yml
- name: "PLAY: > TEST"
hosts: localhost
gather_facts: no
vars_files: vars.yml
pre_tasks: - name: Dynamicaly construct menu
pause:
prompt:
"\n
Ansible options:\n
=====================================\n
{{item.option}}- {{item.name}}"
register: result
loop: "{{menu.ansible.main}}" - debug:
msg: "Option 1 was selected"
when: result.user_input == '1'Output:
PLAY [PLAY: > TEST] *******************************************************************************************************************************************************************************************************************************************************TASK [Dynamicaly construct menu] ******************************************************************************************************************************************************************************************************************************************
[Dynamicaly construct menu] Ansible options:
=====================================
1- Add...:As you can see it displays only part of the main, not all.
Question:
How can I display all available options at once and save user selection, so I can run next tasks based on conditions?
I'm pretty sure the menu must be first generated and saved under one variable before sending to ansible.builtin.pause but I'm not sure how to achieve that.
Thanks for help
|
How can I dynamically construct a menu with ansible.builtin.pause module?
|
This might be a mistake. The request looks suspicious (or ambiguous at least): 'use service facts to show the current version of the cron process'. There is no version among the attributes of the service facts, e.g. (running on Ubuntu)
- service_facts:
- debug:
var: ansible_facts.services['cron.service']gives
ansible_facts.services['cron.service']:
name: cron.service
source: systemd
state: running
status: enabledMoreover, 'version of process' looks weird. Perhaps they want 'PID of process'? In this case, use systemd, e.g.
- systemd:
name: "{{ ansible_facts.services['cron.service']['name'] }}"
register: result
- debug:
var: result.status.ExecMainPIDgives
result.status.ExecMainPID: '884'(See also: shell> systemctl status cron.service)
The next option might be that they want 'version of cron binary'. In this case, use package_facts, e.g.
- package_facts:
- debug:
var: ansible_facts.packages.cron.0.versiongives
ansible_facts.packages.cron.0.version: 3.0pl1-136ubuntu1See more sophisticated options in How to get which version of cron daemon is running. They might be automated in Ansible as well.
|
I am learning Ansible from this book and it contains this lab:Write a playbook according to the following specifications:The cron module must be used to restart your managed servers at 2 a.m. each weekday
After rebooting a message must be written to syslog with the text "CRON initiated reboot completed"
The default systemd target must be set to multi-target
The last task should use service facts to show the current version of the cron processThe last point is a bit confusing. The service_facts module only retrieves facts relating to the name,source,state and status of crond but not the version. How can this objective be achieved?
|
Use service_facts module to show the current version of the cron process?
|
Most likely you are being tripped up by initramfs: a copy of the original HID driver module has been stored in there when your current kernel was installed, and if you haven't regenerated initramfs when adding your module, your customized one won't be in there.
At boot time, the USB support modules are among the first to be loaded, when the system is still running on initramfs and the real root filesystem has not been mounted yet. So the system is still finding & loading the original usbhid + logitech-hidpp-device module combination.
You seem to be using Ubuntu, so the Debian-style sudo update-initramfs -u command should be enough to rebuild the initramfs of the current kernel version using the current set of modules and other configuration files.
|
I'm looking for a way to replace my keyboard kernel module to a custom one. I have a Logitech MK710 keyboard + mouse set for this purpose, with a USB receiver with those 2 interfaces. Automatically, this USB receiver is managed by default usb, usbhid or logitech-hidpp-device modules, there is some information (note: 1-2 is the receiver device):
ubuntu@ubuntu-VirtualBox:/sys/bus/usb/devices/1-2$ tree | grep driver
│ ├── driver -> ../../../../../../bus/usb/drivers/usbhid
│ ├── driver -> ../../../../../../bus/usb/drivers/usbhid
│ │ │ ├── driver -> ../../../../../../../../bus/hid/drivers/logitech-hidpp-device
│ │ │ ├── driver -> ../../../../../../../../bus/hid/drivers/logitech-hidpp-device
│ │ ├── driver -> ../../../../../../../bus/hid/drivers/logitech-djreceiver
│ ├── driver -> ../../../../../../bus/usb/drivers/usbhid
├── driver -> ../../../../../bus/usb/drivers/usbWhat I want to achieve is write a proper module which would be chosen by a kernel instead of those default drivers. I think it's a matter of writing a proper module alias, but I'm not sure because nothing worked yet. Things I already tried are:put my module inside /lib/modules/$(uname -r)/kernel/drivers directory (I created my own custom subdir inside and put the .ko file there)use a proper alias in the module C code, I tried all options listed below (note: USB_VENDOR_ID and USB_PRODUCT_ID are macros used by me and their values are set properly for my specific device):
static struct hid_device_id mod_table [] = {
{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY, USB_VENDOR_ID, USB_PRODUCT_ID) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(hid, mod_table);or
static struct hid_device_id mod_table [] = {
{ HID_USB_DEVICE(USB_VENDOR_ID, USB_PRODUCT_ID) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(hid, mod_table);and
static struct usb_device_id mod_table [] = {
{ USB_DEVICE(USB_VENDOR_ID, USB_PRODUCT_ID) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE(usb, mod_table);remove original (default) HID drivers from /lib/modules/$(uname -r)/kernel/drivers directory (those 3 I specified at the top).Yet still kernel chooses to load original modules instead of my own. I even made sure that only my driver's alias specifies the vendor and product IDs (checking it in modules.alias file), but nothing works. The module starts to work only when I decide to detach the kernel drivers manually from user space by libusb library (using libusb_detach_kernel_driver function) and reload my own custom module - only then the kernel associates the device with my driver, but that's only till the next boot. I'd like to make it permanent, or even automatic. I hope the whole concept is understandable and is not too big of a mess. Thanks in advance.
|
Replace HID device driver with custom one
|
Just stop the flow after the script redirected the changed log to another file. Then I take the new file as another input in rsyslog. Best solution I found
|
I'm trying to parse audit.log with rsyslog by using a bash script in order to transform the hex part of proctitle to ascii. However I do not get ressults: the file audit_ascii.log do not have lines with "proctitle" values. I tested the script and it is working fine so I guess the problem comes from my rsyslog.conf.
rsyslog.conf:
$InputFileName /var/log/audit/audit.log
$InputFileTag tag_auditd:
$InputFileStateFile log_audit
$InputFileSeverity info
$InputFileFacility local6
$InputRunFileMonitorif $msg contains "msg=audit" then {
action(type="omprog" binary="/bin/bash /opt/bin/hex2ascii.sh" output="/var/log/audit/audit_ascii.log")hex2ascii
#!/bin/bash
read log
hasHex=$(echo $log | egrep "msg=audit" | egrep "type=PROCTITLE" | egrep -v '"' | wc -c)
if [ ${hasHex} -gt 0 ];
then
part1=$(echo $log | cut -d"=" -f1-3)
part2=$(echo $log | cut -d"=" -f4)
part2=$(echo $part2 | xxd -r -p )
echo $part1 >> /var/log/audit/verif.txt
#echo "${part1}=${part2}\n" >> /var/log/audit/audit_ascii.log
log="${part1}=${part2}\n"
#else
#echo $log >> /var/log/audit/audit_ascii.log
fi
|
Rsyslog - Parsing audit.log / omprog change log value
|
sbsign is for signing .efi binaries and other PE32(+) formatted executables.
sign-file comes along with the kernel source code (in the scripts directory of the source code tarball) and in the linux-kbuild-4.19 .deb package for Debian 10. It signs ELF-formatted binary files, which is what Linux kernel modules are.
You cannot substitute one for the other, as the file formats are different.
In situations where you know the exact name of the tool you need but not the name of the package it's in, you should go to the distribution's package contents search engine (good distributions have one). Here's it for Debian: https://www.debian.org/distrib/packages
Scroll down to Search the contents of packages, type in "sign-file" to the Keyword field, click on Search and if the file exists in any package of that distribution, you will find it.
|
I have a Debian 10 system. It has secure boot enabled. I am trying to sign and load a new kernel module for virtualbox.
I generated a certificate and private key using openssl req -new -x509 -newkey rsa:2048 -keyout MOK.priv -outform DER -out MOK.der -days 36500 -subj "/CN=My Name/" -nodes. Then I imported this key with mokutil --import MOK.der. I then entered some password, rebooted, and enrolled the key. Then, after reading dozens of inaccurate tutorials, including Debian.org's OWN tutorial, they all suggested to use a program called sign-file. However, sign-file was completely missing, and a recursive search of every directory of the system returned nothing. After browsing a few obscure forums, I found a tool called sbsign, which seems to be the only available option for signing anything. Any time I attempt to sign a module with it, using the command sbsign --cert ~/MOK.pem --key ~/MOK.priv /lib/modules/4.19.0-9-amd64/misc/vboxdrv.ko. However, this command returns Invalid DOS Header Magic. There are almost no references to this error anywhere on the internet, and none that relate to my specific problem in any meaningful way.
What does this error mean? What can I do to sign these modules?
|
Cryptic Error When Attempted to Sign Kernel Modules
|
Use the $0 positional parameter and dirname:
#!/bin/bashecho running "$(dirname "$0")/$(basename "$0")"
source "$(dirname "$0")/modules/script-1"
|
I have a bash script that uses source to make the script more modular. Here's how it would look copied into a user's bin directory:
/bin
modules/
script-1
script-2
script-3
script-4
script-5
main-appHowever, this doesn't work if you want to execute main-app from a directory other than your bin directory. Is there a way to use source ./modules/script-x in main-app so that I can source these files properly? Or should I be converting main-app into one file? If I do need to, should I do this manually or is there some kinda "compiler" I should use?
|
How to add a modular bash script to `bin`?
|
Depends on what the program does. In addition to standard output (fd 1) and error (fd 2), standard input (fd 0) is often also opened read-write when a program is started from the terminal without redirections, and it could be used for writing output. Another option is to explicitly open /dev/tty, which gives a new fd connected to the controlling terminal of the process.
modulecmd uses stdin, for some reason. Running strace on it, we see it writes the header line to the original fd 2, then (after some unrelated fd juggling that doesn't touch fd 0) duplicates fd 0 (stdin) to fd 2, and prints the description there....
write(2, "\n----------- Module Specific Hel"..., 70) = 70
...
[unrelated shuffling of other fds]
...
dup(0) = 2
write(2, "\tThis module does absolutely not"..., 37) = 37
write(2, "\r\n", 2) = 2
write(2, "\tIt's meant simply as a place ho"..., 44) = 44
...So you could redirect that part of the message by redirecting stdin (fd 0) to some file, e.g. 0>somefile (or to /dev/null to suppress it), in addition to any redirections of stdout and stderr.
A redirection like < /dev/tty could also prevent the output by giving the process an explicitly read-only fd. (The program would get an error for the write() call, though.) On Linux, you could even do < /dev/stdin with the same result, if the original stdin is connected to a terminal.
If some program used /dev/tty, capturing the output is harder. If available, something like setsid could be used to start the program without a controlling terminal, which would mean that opening /dev/tty would fail. (Well, that's what it does on Linux anyway.)
|
As far as I can tell, some of the output generated by the command /usr/bin/modulecmd goes neither to stdout nor stderr, as illustrated by the following example:
% /usr/bin/modulecmd bash help null >/dev/null 2>&1
This module does absolutely nothing.
It's meant simply as a place holder in your
dot file initialization. Version 3.2.9Is there any way invoke a command (such as /usr/bin/modulecmd) so that all its output goes to either stdout or stderr? Alternatively, is there some way for code that invokes /usr/bin/modulecmd to capture all the output that it would normally send to the termnal?
|
How to capture output that is going neither to stdout nor to stderr?
|
I think you are missing apparmor package which will provide that python module:
sudo apt install python3-apparmorIf you can’t install that, you need to fix your repository configuration; you will then also be able to install the Debian AppArmor packages.
|
Context : I installed (manually) the apparmor-utils and apparmor-profiles and apparmor-utils, since when trying
apt-get install apparmor-utils apparmor-profilescan't find the packages.
aa-statusworks as usual.
I also did
sed -i -e 's/GRUB_CMDLINE_LINUX_DEFAULT="/&security=apparmor /' /etc/default/grubto enable it.
However when I try
aa-genprofit says:
import apparmor.aa as apparmor ... No module named apparmorWhat is the problem if I already installed it?
|
No module named apparmor. Why?
|
The webpage you linked says:Module files are written in the Tcl language.This line seems to be trying to read a .sh shell script:
source /home/apps/spack/share/spack/setup-env.shIn the Tcl language, the source command expects the specified file to be another Tcl script, not a shell script.
If the setup-env.sh contains text like _sp_initializing:- (or something that becomes that when (mis)interpreted according to rules of Tcl), that would confirm the issue.
|
I am trying to create custom private environment modules on an HPC cluster as shown here: https://researchcomputing.princeton.edu/support/knowledge-base/custom-modules
My private modules appear in the output of the module avail command. However, when I try to load one of these, I get the following error:
Lmod has detected the following error: /home/a_thomas.iitr/modulefiles/qe_7.0: (qe_7.0): can't read "_sp_initializing:-": no such variable
While processing the following module(s):
Module fullname Module Filename
--------------- ---------------
qe_7.0 /home/a_thomas.iitr/modulefiles/qe_7.0The contents of qe_7.0 module are given below:
#%Module1.0source /home/apps/spack/share/spack/setup-env.sh
spack load [emailprotected]%[emailprotected]
spack load [emailprotected]%[emailprotected]set QE_PATH /scratch/a_thomas.iitr/files_temp/SWs/7.0_install
prepend-path PATH $QE_PATH/binI scoured the internet for any information regarding this but to no avail.
Any suggestions on how to solve this problem would be appreciated.
|
Unable to run custom modules
|
You should not be installing PHP into /home for a variety of reasons, one of which is that SELinux absolutely will not like it at all. Use /opt or /usr/local instead. /home is for home directories.
Since you are trying to use PHP 7.3 on CentOS 7, why not use the SCL repository and install the rh-php73 packages instead, which are actually supported and get software updates.
|
I'll start by stating I'm not a server admin by trade, so I've been struggling with this task.
PHP 7.3.5 was already installed on RHEL7 running Apache. I have installed MySQL successfully and now I am tasked with connecting to the MySQL DB from PHP. I have done this before on hosted services like Bluehost, but they make it easy.
I am trying to install/enable the mysqlnd/mysqli modules to absolutely no avail. phpinfo() still does not show that it's enabled. I have tried to install packages and this is what I see when I locate:How do I enable this module so it becomes active in PHP?
|
RHEL PHP 7.3.5 with mysqlnd and apache
|
I have found a way to load rnnoise as a pipewire plugin for all users.
Step 1:
On this page you can download the rnnoise drivers compiled for X86 linux. This is not the last version of rnnoise. If you want the latest version, i think you have to perform compilation by yourself from the official github repo.
Step 2:
In the downloaded archive, you will find the needed linux libs.
Always take mono libs. You probably have only one microphone!
I propose to store them in /usr/lib/audio/ So you will have to create the folder audio.
As i renamed the files, i have now in this folder:ladspa.so
lv2.so
vst3.so
vst.soStep 3
Create the 2 pipewire folders to get this path:
/etc/pipewire/pipewire.conf.d/Step 4
In this folder create the file 99-mic-denoising.conf.
In this file paste this content:
context.modules = [
{name = libpipewire-module-filter-chain
args = {
node.description = "Noise Canceling source"
media.name = "Noise Canceling source"
filter.graph = {
nodes = [
{
type = ladspa
name = rnnoise
plugin = /usr/lib/audio/ladspa.so
label = noise_suppressor_mono
control = {
"VAD Threshold (%)" = 90.0
"VAD Grace Period (ms)" = 200
"Retroactive VAD Grace (ms)" = 0
}
}
]
}
capture.props = {
node.name = "capture.rnnoise_source"
node.passive = true
audio.rate = 48000
}
playback.props = {
node.name = "rnnoise_source"
media.class = Audio/Source
audio.rate = 48000
}
}
}
]Step 5
Restart pipewire deamon:
systemctl restart --user pipewire.serviceNow in gnome settings you can choose the microphone with noise cancelled.
CommentsWe so use the pipewire filter-chain module. Check the documentation, it's very useful.
Each application (which use audio) has been designed to use a standard (called audio plugin API):ladspa: open standard...but it's not the newest one
lv2: open standard...the newest one
vst3: proprietary standard (you should not see it with open source programs)
vst: proprietary standard (you should not ....)So the solution I provided, doesn't cover applications using lv2 audio plugin (i don't care about proprietary standards). Any help for lv2 is welcome.
|
With pulseaudio, it was easy to load a module for microphone noise reduction.
This link explains it clearly:
https://askubuntu.com/questions/18958/realtime-noise-removal-with-pulseaudio
I want to add rnnoise as a plugin of pipewire to cancel the noise of the microphone for all users.
I'm looking for a minimalist solution and would like to avoid applications. Like this one:
https://github.com/noisetorch/NoiseTorch?tab=readme-ov-file
|
Reducing microphone noise using pipewire modules
|
The problem has been solved because the network card driver is incorrect. First, enter the live environment, execute lspci | grep -i ethernet to see what model of your network card is, and then compile it into the kernel.
Device Drivers->Network device support->Ethernet driver support->(the model of your network card)
|
I am customizing a Linux system with a Linux kernel version of 6.4.0. I executed mdev -s in rcS and checked the startup print, which was also successful. When I entered the live environment, I saw that the name of the network card was enp2s0. However, after startup, I found that enp2s0 could not be found. I don't know what's going on? I have checked the kernel configuration and found that the network driver is compiled.
rcS:
echo PATH=/sbin:/bin:/usr/bin:/usr/sbinecho LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib:/lib:/lib64mount -asource /etc/profilemkdir /dev/pts -pmount -t devpts devpts /dev/ptsmdev -s
if [ $? -eq 0 ]; then
echo "mdev -s executed successfully."
else
echo "mdev -s execution failed."
fi
ip addr add 192.168.5.2/24 dev enp2s0Screenshot of error reporting:
|
Unable to find network card after executing mdev - s?
|
Phar zlib support isn't the same as zlib support within PHP. That's all there is too it - phar is a code archive format, and it not having enabled zlib compression support is not an indication of zlib in other parts of PHP not working.
PHP error hints and documentation being misleading is not a new thing! In this case you've been led astray by the "install ext/zlib"; that is probably a separate extension and not the zlib support of PHP itself.
Friendly remark on your efforts: I'd refrain from building PHP from scratch. If recommend that you eitherstart a podman container with a distro inside that has a well-maintained and security-updated PHP 8.2 itself
or backport the PHP 8.2 rpm from such a distro to your CentOS.Since PHP 8.2 is still very young (do you really need it? The newest bleeding edge software is not necessarily optimal for server applications! Joomla's website says any PHP 8.x is good enough, so you could just use the well-packaged 8.0.27 for your distro and have zero of the trouble and well-tested software), that choice of distro is probably going to be fedora 38 (it's currently not packaged for CentOS stream 9/rhel9/alma9).
The container setup would be boringly simple, a Dockerfile containing naught but
FROM fedora:38RUN dnf install --refresh -y php-fpm && dnf clean all ENTRYPOINT php-fpm
EXPOSE 9000Build it from the same directory using podman build Dockerfile. Run it using podman run, and use the -v argument to share the necessary directories with the PHP running inside. Configure your nginx or Apache to connect to port 9000 for PHP support via fastcgi.
|
In order to use Joomla! 4.3.1, I've compiled PHP 8.2 in an Oracle Linux 8.6 Server, with support for zlib compression:
# php --ri zlibzlibZLib Support => enabled
Stream Wrapper => compress.zlib://
Stream Filter => zlib.inflate, zlib.deflate
Compiled Version => 1.2.11
Linked Version => 1.2.11Directive => Local Value => Master Value
zlib.output_compression => On => On
zlib.output_compression_level => -1 => -1
zlib.output_handler => no value => no value# php -m
[PHP Modules]
bcmath
bz2
(...)
zip
zlibAnd I've enabled zlib.output_compression = On on /etc/php.ini, which is the configuration file being used by PHP:
# php --ini
Configuration File (php.ini) Path: /etc
Loaded Configuration File: /etc/php.ini
Scan for additional .ini files in: /etc/php.d
Additional .ini files parsed: (none)Nonetheway, phpinfo(); still shows that gzip compression is disabled:Does someone have any hint on why PHP is having such behavior?
Note: I've compile with the following parameters:
./configure --prefix=/usr --disable-rpath --disable-debug --enable-calendar --enable-sysvshm --enable-bcmath --with-bz2 --enable-ctype --enable-exif --enable-ftp --with-gettext --enable-mbstring --enable-shmop --enable-sockets --with-zlib=/usr --without-pgsql --disable-static --with-layout=GNU --with-curl=/usr --with-mhash=/usr --with-unixODBC=/usr --with-snmp=shared --enable-soap --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex --with-zip --with-pdo-mysql --with-mysqli --with-openssl --enable-fpm --with-kerberos --with-xsl --enable-opcache --enable-intl --with-pear --with-oci8=instantclient,/usr/lib/oracle/21/client64/lib --with-config-file-scan-dir=/etc/php.dThank you in advance.
|
PHP was compiled with zlib module, but phpinfo() show it's disabled
|
I finally came up with this solution.
Namely:Assumption:
Some internet connection, either wired or wireless using a dongle (sys-usb)
Steps:Create a new qube based on the fedora-36 templateOpen Qube Manager → New qube[Basic] Name and label: sys-wl
[Basic] Type: StandaloneVM (fully persistent)
[Basic] Template: fedora-36 (default)
[Basic] Networking: sys-net (you need somebody to connect you)
[Basic] Enable “Launch settings after creation”
[Advanced] Enable "Provides network access to other qubes"
[Advanced] Leave everything else as it is preconfiguredAfter Creation the [Dom0] Settings window for sys-wl pops up[Basic] Leave everything else as it is preconfigured
[Advanced] Disable “Include in memory balancing”
[Advanced] Kernel->Kernel: (provided by qube) → alternatively: (dom0): qvm-prefs sys-wl kernel ‘’
[Advanced] Virtualization->Mode: HVMInstall broadcom-wlOpen a terminal
sys-wl: Terminal
Based on the information by balko here
[user@sys-wl ~]$ sudo dnf config-manager --set-enabled rpmfusion-free
[user@sys-wl ~]$ sudo dnf config-manager --set-enabled rpmfusion-free-updates
[user@sys-wl ~]$ sudo dnf config-manager --set-enabled rpmfusion-nonfree
[user@sys-wl ~]$ sudo dnf config-manager --set-enabled rpmfusion-nonfree-updates
[user@sys-wl ~]$ sudo dnf upgrade --refresh
[user@sys-wl ~]$ sudo dnf install broadcom-wlBlacklist unwanted modules[user@sys-wl ~]$ sudo vi /etc/modprobe.d/blacklist.conf
blacklist b43
blacklist bcmaPrepare settings for sys-wl prior to restartOpen Qube Manager
sys-wl->Settings
[Basic] Net qube: (none)(current)
[Basic] Leave everything else as it is already configuredDetach BCM4350 in case that it is attached to any VM (in my case it was attached per default to sys-net)Shutdown the VM (my case: sys-net) to which the bcm4360 card has been assigned.
Open Qube Manager → sys-net → Settings → Devices → click in the right window frame on “Broadcom Inc. and subsidiaries BCM4360 802.11ac Wireless Network Adapter”, and move ( < ) it to the left one → OKAttach BCM4360 to the newly created sys-wl with the “magic” optionsShutdown the newly created sys-wlFind out the BDF of your device(dom0) qvm-pci
BACKEND:DEVID DESCRIPTION USED BY
…
dom0:02_00.0 Network controller: Broadcom Inc. and subsidiaries BCM4360 802.11ac Wireless Network Adapter
…Now: The magic one step. BEING WELL AWARE OF side channel attacks based on this description (How to use PCI devices | Qubes OS) attach the device to sys-wl:(dom0) sudo qvm-pci a sys-bcm4360 dom0:02_00.0 --persistent -o no-strict-reset=true -o permissive=trueShow the changes:
(dom0) qvm-pci
BACKEND:DEVID DESCRIPTION USED BY
…
dom0:02_00.0 Network controller: Broadcom Inc. and subsidiaries BCM4360 802.11ac Wireless Network Adapter sys-bcm4360 (no-strict-reset=true, permissive=true)
…Reboot the whole systemAfter you got your system up and running again, the Network Manager icon will be shown on the right part of the taskbar, and available networks will be shown, and you will be able to establish a wireless connection.
|
Help!
I have installed on a Qubes Standalone Debian-11 VM which is running on a MacbookPro the Broadcom-sta-dkms package.
The installation does NOT indicate any errors.
lsmod shows the wl module:
user@sys-wifi:~$ sudo lsmod|grep wl
wl 6471680 0
cfg80211 983040 1 wl
The wl.ko module is present:
user@sys-wifi:~$ sudo find / -name wl.ko -print
/var/lib/dkms/broadcom-sta/6.30.223.271/5.10.0-21-amd64/x86_64/module/wl.ko
find: ‘/run/user/1000/doc’: Permission denied
/usr/lib/modules/5.10.0-21-amd64/updates/dkms/wl.ko
I have added the module to /etc/modules
user@sys-wifi:~$ cat /etc/modules
# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
wl
rfkill shows NOTHING!
user@sys-wifi:~$ sudo rfkill list all
inxi -n shows NO driver:
user@sys-wifi:~$ sudo inxi -n
Network: Device-1: Intel 82371AB/EB/MB PIIX4 ACPI type: network bridge driver: N/A
Device-2: Broadcom BCM4360 802.11ac Wireless Network Adapter driver: N/A
IF-ID-1: eth0 state: up speed: N/A duplex: N/A mac: 00:16:3e:5e:6c:00
nmcli does NOT show any wireless interface:
user@sys-wifi:~$ sudo nmcli
eth0: connected to VM uplink eth0
"eth0"
ethernet (vif), 00:16:3E:5E:6C:00, hw, mtu 1500
ip4 default
inet4 10.137.0.21/32
route4 10.138.8.117/32
route4 0.0.0.0/0
inet6 fe80::216:3eff:fe5e:6c00/64
route6 fe80::/64
lo: unmanaged
"lo"
loopback (unknown), 00:00:00:00:00:00, sw, mtu 65536
DNS configuration:
servers: 10.139.1.1 10.139.1.2
interface: eth0
Use "nmcli device show" to get complete information about known devices and
"nmcli connection show" to get an overview on active connection profiles.
Consult nmcli(1) and nmcli-examples(7) manual pages for complete usage details.
dmesg shows no errors:
user@sys-wifi:~$ sudo dmesg|grep wl
The output of lshw
user@sys-wifi:~$ sudo lshw -C network
*-network UNCLAIMED
description: Network controller
product: BCM4360 802.11ac Wireless Network Adapter
vendor: Broadcom Inc. and subsidiaries
physical id: 6
bus info: pci@0000:00:06.0
version: 03
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list
configuration: latency=0
resources: memory:f2210000-f2217fff memory:f2000000-f21fffff
*-network
description: Ethernet interface
physical id: 1
logical name: eth0
serial: 00:16:3e:5e:6c:00
capabilities: ethernet physical
configuration: broadcast=yes driver=vif driverversion=5.10.0-21-amd64 ip=10.137.0.21 link=yes multicast=yes
lspci shown the wifi adapter and the assigned module wl but NO kernel module is in use
user@sys-wifi:~$ sudo lspci -k
00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02)
Subsystem: Red Hat, Inc. Qemu virtual machine
00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II]
Subsystem: Red Hat, Inc. Qemu virtual machine
00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II]
Subsystem: Red Hat, Inc. Qemu virtual machine
Kernel driver in use: ata_piix
Kernel modules: ata_piix, ata_generic
00:01.3 Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03)
Subsystem: Red Hat, Inc. Qemu virtual machine
Kernel modules: i2c_piix4
00:02.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)
Subsystem: XenSource, Inc. Xen Platform Device
Kernel driver in use: xen-platform-pci
00:03.0 VGA compatible controller: Device 1234:1111 (rev 02)
Subsystem: Red Hat, Inc. Device 1100
Kernel driver in use: bochs-drm
Kernel modules: bochs_drm
00:04.0 USB controller: Intel Corporation 82801DB/DBM (ICH4/ICH4-M) USB2 EHCI Controller (rev 10)
Subsystem: Red Hat, Inc. QEMU Virtual Machine
Kernel driver in use: ehci-pci
Kernel modules: ehci_pci
00:06.0 Network controller: Broadcom Inc. and subsidiaries BCM4360 802.11ac Wireless Network Adapter (rev 03)
Subsystem: Apple Inc. BCM4360 802.11ac Wireless Network Adapter
Kernel modules: bcma, wl
user@sys-wifi:~$
Can anyone say anything about this puzzle?
Please help!
Thanks!
|
BCM4360 on MacbookPro running QubesOS - Kernel does not bind modul
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.