Wednesday, May 12, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


KVM Error on Chromebook Error: The host does not support any virtualization options

Posted: 12 May 2021 09:27 AM PDT

I need help, I continue to get "Error: The host does not support any virtualization options". Either its my processor or qemu (which idk what that is and I am sure I dont have it.) I also have no clue as to how to install it. I've watched other videos of setting up the VM program with the linux beta within chrome and they never get the error when they set up, but for whatever reason I continue to get it. I really need to get a linux vm running on this chromebook. I am more used to windows so I am fairly new to chromebooks. Thanks if any of you are able to help me out with this problem.

Error: The host does not support any virtualization options

How do I limit CUDA speed to keep fan noise low?

Posted: 12 May 2021 08:24 AM PDT

For CPU-based loads, cpufreq-set or cgroup's cpu.cfs_quota_us can arbitrarily and controllably slow down the load, allowing the system to run silently.

How do I impose similar limitation to GPU CUDA-based load on Linux?

For example, if I know that some GPU-based calculation would take 3 hours at full speed, how do I make it instead take 6 hours at half speed (thus supposedly quieter).

Is there something like GPU cgroup to manage NVIDIA card resource allocation on Linux?

How to install VirtualBox guest addition on ArchLinux

Posted: 12 May 2021 08:23 AM PDT

I'm completely new at Archlinux and I'm trying to install Virtual Box guest additions on a macos machine.

After running sudo pacman -S virtualbox-guest-utils I get this error:

Errors

I've tried following archwiki instructions, but I keep getting errors.

Thanks for the help.

Old laptop "goes to sleep" all the time after Linux installation

Posted: 12 May 2021 08:40 AM PDT

I've installed antiX 19.3 recently on a 16-yro (or older), laptop. One issue I've been having is that the thing keeps going to sleep! Every 30-45 seconds or so, it goes into sleep mode; and comes back up on a keypress. This includes even the boot sequence: While running the init scripts for runlevel 5, this already happens once. It continues after my desktop environment (IceWM) has loaded.

I've read this highly related question, and found a workaround: Completely disable ACPI and APM on the grub2 boot line for the kernel: acpi=off apm=off. But that's not a good solution, because it is important for the laptop to go to sleep when unused; and you want fan speed control etc.

Another suggestion there involve systemd facilities - but my distribution doesn't use systemd.

What else can I do? Also, what could be the cause of this?

Here's the repeating segment of my dmesg:

[Wed May 12 17:11:00 2021] VFS: busy inodes on changed media or resized disk sr0  [Wed May 12 17:11:26 2021] PM: suspend entry (deep)  [Wed May 12 17:11:26 2021] PM: Syncing filesystems ... done.  [Wed May 12 17:11:26 2021] Freezing user space processes ... (elapsed 0.001 seconds) done.  [Wed May 12 17:11:26 2021] OOM killer disabled.  [Wed May 12 17:11:26 2021] Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.  [Wed May 12 17:11:26 2021] Suspending console(s) (use no_console_suspend to debug)  [Wed May 12 17:11:26 2021] sd 0:0:0:0: [sda] Synchronizing SCSI cache  [Wed May 12 17:11:26 2021] sd 0:0:0:0: [sda] Stopping disk  [Wed May 12 17:11:28 2021] ACPI: EC: interrupt blocked  [Wed May 12 17:11:28 2021] ACPI: Preparing to enter system sleep state S3  [Wed May 12 17:11:28 2021] ACPI: EC: event blocked  [Wed May 12 17:11:28 2021] ACPI: EC: EC stopped  [Wed May 12 17:11:28 2021] PM: Saving platform NVS memory  [Wed May 12 17:11:28 2021] Disabling non-boot CPUs ...  [Wed May 12 17:11:28 2021] ACPI: Low-level resume complete  [Wed May 12 17:11:28 2021] ACPI: EC: EC started  [Wed May 12 17:11:28 2021] PM: Restoring platform NVS memory  [Wed May 12 17:11:28 2021] ACPI: Waking up from system sleep state S3  [Wed May 12 17:11:28 2021] ACPI: EC: interrupt unblocked  [Wed May 12 17:11:28 2021] usb usb2: root hub lost power or was reset  [Wed May 12 17:11:28 2021] usb usb3: root hub lost power or was reset  [Wed May 12 17:11:28 2021] usb usb4: root hub lost power or was reset  [Wed May 12 17:11:28 2021] 8139too 0000:01:00.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1  [Wed May 12 17:11:28 2021] sd 0:0:0:0: [sda] Starting disk  [Wed May 12 17:11:28 2021] ACPI: EC: event unblocked  [Wed May 12 17:11:28 2021] ata1.00: ACPI cmd ef/03:0c:00:00:00:a0 (SET FEATURES) filtered out  [Wed May 12 17:11:28 2021] ata1.00: ACPI cmd ef/03:45:00:00:00:a0 (SET FEATURES) filtered out  [Wed May 12 17:11:28 2021] ata2.00: ACPI cmd ef/03:0c:00:00:00:a0 (SET FEATURES) filtered out  [Wed May 12 17:11:28 2021] ata2.00: ACPI cmd ef/03:42:00:00:00:a0 (SET FEATURES) filtered out  [Wed May 12 17:11:29 2021] usb 3-2: reset full-speed USB device number 2 using uhci_hcd  [Wed May 12 17:11:29 2021] firewire_core 0000:01:02.0: rediscovered device fw0  [Wed May 12 17:11:30 2021] OOM killer enabled.  [Wed May 12 17:11:30 2021] Restarting tasks ... done.  [Wed May 12 17:11:30 2021] PM: suspend exit  [Wed May 12 17:11:35 2021] VFS: busy inodes on changed media or resized disk sr0  [Wed May 12 17:12:01 2021] PM: suspend entry (deep)  

Notes:

  • I should mention that this did not happen with the Windows XP installation which the laptop used to have.
  • The laptop's battery is almost dead, so I only run it with mains power plugged in.
  • I tried switching the kernel version from 4.9.something to 4.19.something (antix-packaged images); no effect.
  • Laptop info: Clevo M3CW, Pentium M 1.6GHz, 1 GB memory, 40GB HDD. Has a built-in CD which is giving me another kind of trouble that's probably unrelated.

Sending attachment in a mail without using uuencode

Posted: 12 May 2021 09:40 AM PDT

I am sending an email with content, subject and attachment on a Solaris system. The problem is, that when I send email to some domain is working and to some not., they do not receive the attachment but they receive it as a content in base64 style like hieroglyphs.

echo ${BODY}; uuencode /data/${FILE} ${FILE}) | mailx -r "mail@mail.com" -s "Export Securities Turnover" "mail2@mail2.hr"   

So my question is how to implement in a different way this part of code. It is a bash script and probably I have to change uuencode. I can not use mutt or mail.

Email notification for failed SSH login

Posted: 12 May 2021 07:31 AM PDT

Can someone tell is there a way to receive an email for failed SSH login? I already have Fail2Ban but as understood I can receive only email's for banned IP's ... Using CentOS 7

Thank you in advance.

RHEL8 - fault injection

Posted: 12 May 2021 08:52 AM PDT

I've been trying to do Disk IO error simulation. I came across documentations referring to https://www.kernel.org/doc/Documentation/fault-injection/fault-injection.txt but the path referred (/sys/block/<device>/make_it_fail) in fail_make_request is not available. Is this issue specific to RHEL8? if so, how can i do fault injection. Some other links refer to building a custom kernel with fault injection enabled. Since here it is a client provided machine, we wont be able to change anything.

LVM lvdisplay - what's with the less-than sign?

Posted: 12 May 2021 07:31 AM PDT

If I display the size of my root filesystem (a logical volume) with df I see that it's just over 6GB:

df -h /  Filesystem             Size  Used Avail Use% Mounted on  /dev/mapper/vg01-root  137G  6.2G  124G   5% /  

But if I ask LVM to tell me about it it can't work out the size and gives me an utterly useless estimate:

lvdisplay vg01/root    --- Logical volume ---    LV Path                /dev/vg01/root    LV Name                root    VG Name                vg01    ... snip    LV Size                <139.70 GiB    ... etc  

Why does this happen? Is there any way that I can circumvent it within a shell script which needs to know the size of the LV? df won't work if the LV isn't mounted.

This is Debian 10 unstable, if it matters.

The super key is not bringing the start menu /activities menu on Feren OS

Posted: 12 May 2021 06:44 AM PDT

Hey I have recently installed Feren OS and everything is working fine except super key shortcut which should open the start menu or activities' menu is not working. The other shortcut keys of super key like Super + Up arrow key to maximize the windows and other similar shortcut are working fine. Only super key start menu shortcut is not working. I have searched over the internet and found that I can change the shortcut key to something else, but it is not ideal. Does anyone know the solution of this problem?

Linux freezes after hooking e.g. openat(2) system call using LKM

Posted: 12 May 2021 06:41 AM PDT

I have written the following LKM for learning purposes, where the goal is to hook a system call (e.g. openat(2)).

The problem is that after successfully disabling CR0.WP, and setting sys_call_table[__NR_openat] to the hook, the system freezes.

Can anyone with deep knowledge of the Linux kernel comment on why this happens?

Note:

In order to run the LKM, you either have to replace CAP_SET_EMPTY_OFFSET and SYS_CALL_TABLE_OFFSET with the respective offsets for your kernel, or just hardcode the address of the sys_call_table obtained by sudo cat /proc/kallsyms | grep sys_call_table.

Code:

#include <linux/module.h>   /* Needed by all modules */  #include <linux/syscalls.h>  #include <linux/capability.h>  #include <linux/set_memory.h> /* Needed by set_memory_rw */    /*   * Avoid tainting the kernel, however the kernel will still be tainted if the   * module is not signed   */  MODULE_LICENSE("GPL");    static unsigned long* _sys_call_table;    #define CAP_SET_EMPTY_OFFSET 0x45fe0  #define SYS_CALL_TABLE_OFFSET 0x2e0    unsigned long *find_sys_call_table(void)  {     unsigned long rodata_start;     rodata_start = (unsigned long)&__cap_empty_set - CAP_SET_EMPTY_OFFSET;     return (unsigned long*)(rodata_start + SYS_CALL_TABLE_OFFSET);  }    static inline void _write_cr0(unsigned long val)  {     asm volatile ("mov %0, %%cr0": : "r" (val));  }    static inline void disable_write_protection(void)  {     preempt_disable();     barrier();     _write_cr0(read_cr0() & (~ 0x00010000));  }    static inline void enable_write_protection(void)  {     _write_cr0(read_cr0() | 0x00010000);     barrier();     preempt_enable();  }    typedef asmlinkage long (*orig_openat_t)(int, const char*, int, umode_t);  orig_openat_t orig_openat;    asmlinkage long  hooked_openat(int dirfd, const char __user* pathname, int flags, umode_t mode)  {     printk(KERN_INFO "%s: hooked openat\n", __func__);     return orig_openat(dirfd, pathname, flags, mode);  }      static int __init syscall_init(void)  {     printk(KERN_DEBUG "%s: started\n", __func__);       printk(KERN_INFO "%s: cr0: %lx\n", __func__, read_cr0());       _sys_call_table = find_sys_call_table();     printk(KERN_INFO "%s: _sys_call_table: %px\n", __func__, _sys_call_table);       printk(KERN_INFO "%s: orig: sys_call_table[__NR_openat]=%px\n",           __func__, (void*)_sys_call_table[__NR_openat]);       disable_write_protection();     printk(KERN_INFO "%s: cr0: %lx\n", __func__, read_cr0());       _sys_call_table[__NR_openat] = (unsigned long)hooked_openat;       enable_write_protection();     printk(KERN_INFO "%s: cr0: %lx\n", __func__, read_cr0());       printk(KERN_INFO "%s: new: sys_call_table[__NR_openat]=%px\n",           __func__, (void*)_sys_call_table[__NR_openat]);       return 0;  }    static void __exit syscall_release(void)  {     disable_write_protection();     _sys_call_table[__NR_openat] = (unsigned long)orig_openat;     enable_write_protection();       printk(KERN_DEBUG "%s: exited\n", __func__);  }    /* set the entry point of the module */  module_init(syscall_init);  /* set the exit point of the module */  module_exit(syscall_release);  

Mapping between two files

Posted: 12 May 2021 09:52 AM PDT

I am new to scripting and have an requirement like below.

There is a file called jobname.txt with below contents

job1  job2  

There is a file called value.txt with below contents

10  20  

I need to print output like

update_job: job1  max_run_alarm: 10    update_job: job2  max_run_alarm: 20  

How can I do this using shell script or awk?

Fail the script after all the errors in loop

Posted: 12 May 2021 09:11 AM PDT

I have used conditional if-else where my script fails in case $? -ne 0 but I am running loop in it. What I want is my script o fail after all the check is completed. It is failing just after one check. Below is my script

for i in `cat xyz.txt`  do  grep $i abc.txt      if [[ $? -ne 0 ]]; then      echo $i "is missing in the file abc.txt"      exit -1      fi  done  

How to configure a DNS server by YAST2

Posted: 12 May 2021 08:23 AM PDT

I run these commands to install DNS server dependencies on openSUSE Tumbleweed:

sudo zypper in -t pattern dhcp_dns_server  sudo systemctl enable named.service  sudo systemctl start named.service  

To configure the DNS server, I'm trying YAST2 following this documentation:

sudo yast2 dns-server  

I intend to configure example.com domain zone with IP address 1.2.3.4.

What I did

I have a DNS zone of master type:

Zone: master

My NS Records tab is:

NS Records tab

My Records tab is:

Records tab

Problem

However, saving the configuration runs into a problem:

Problem

I couldn't figure it out. Can anyone help?

stuck at busy box, attempt to boot old linux at another partition

Posted: 12 May 2021 07:38 AM PDT

I have, and able to boot with arch Linux with kernel 5.10.34 normally. I have older Linux (linuxmint 20.1) on my sda6 with kernel 5.4.0-72 and 5.8.0-50. I am using grub-customizer. Kindly not answer with having live cd.

The strange thing is:

  • when I tried to boot to my sda6 is, the /etc/fstab empty.
  • it stuck at busybox(initramfs) with, /init exist.
  • the exiting from the initramfs resulting kernel panic not sync.
run init: can't execute '': no such directory  kernel panic - not syncing: Attempted to kill init!  CPU 0 PID 1 Comm run-init Not Tainted 5.8.0-50 generic # 56~20.04.1-Ubuntu  call trace omitted: assuming just the panic that significant  
  • last time I use the Linux mint, I open a terminal with sudo on /var/www/somedir/, strangely the kernel was misplaced there.

what i have tried:

  • using ridinit=/bin/sh (i missing the unix.stack q)
  • manually copy /etc/fstab from arch to /etc/fstab busybox
  • disable the selinux

the old fstab before installing arch Linux (Manjaro).

detail about the busybox BusyBox v1.30.1 Ubuntu 1:1.30.1-4ubuntu6.3

/sda1/boot/grub/grub.cfg

having said that, my question is how to create a permanent grub config so I am able to boot to my linuxmint properly?

Amend

blkid

lsblik

executing ash init from initramfs resulting:

enter image description here cat init: result of cat /init: /init Thank you

Apache 2.4, basic file authentication ignored

Posted: 12 May 2021 08:44 AM PDT

I have the following in my (Debian-style, split-file) config

<VirtualHost *>  ServerName www.example.org  DocumentRoot /var/www/example  CustomLog /var/log/apache2/example/access.log combined    <Directory /var/www/example/subdir/admin/>     AllowOverride All     AuthType Basic     AuthName "admins only"     AuthUserFile /etc/apache2/pass.txt     Require valid-user  </Directory>    </VirtualHost>  

And it's ignored, i.e. I can browse files in that directory, no login prompt. I've set LogLevel debug and I see

AH01628: authorization result: granted (no directives)  

The log line is created by [authz_core:debug] so it seems to recognize the auth lines are there, just not that it needs to actually do some authorisation.

Even replacing valid-user with all denied has no effect.

I seem to have all the modules I need.

I tried adding a .htaccess in another directory and that logged "AuthType not allowed here".

I have AllowOverride All just about everywhere it's allowed.

Similar questions have not come up with a solution that works for me. Please tell me how to troubleshoot this and I'll be happy to try it and report back.

Bluetooth headphones work for audio, but built-in headphone mic doesn't

Posted: 12 May 2021 09:05 AM PDT

I'm using Pop_OS! 20.04. I have a pair of Sony Bluetooth headphones (wh-1000xm3). I'm using a USB dongle for a Bluetooth receiver.

The audio works in the headphones, the on-headphone controls work, but the built-in mic doesn't. The mic and audio work with my Android phone, Windows, and Mac.

I went into settings and everything looks right, but the OS isn't detecting it. In Slack and Google Hangouts, there's a message saying that it can't be found as well as this online test https://www.onlinemictest.com/.

Are there any tools I can use to debug this? How can I figure out if it's the Bluetooth receiver, or something in my OS or the headphones?

I've tried blueman, but I didn't see anything out-of-the-ordinary.

I've tried this https://askubuntu.com/a/1233446/566235 but I don't know which one to add to my alsa-base.conf. My codec is Realtek ALC888

Screenshot of my audio settings, I can't unmute the input for my headphones. screenshot of my audio setting.

The input for pavucontrol. The last one are my headphones. screenshot of pavucontrol input

All the requested output:

$ bluetoothctl devices  Device 70:26:05:8C:CE:40 LE_WH-1000XM3  Device DC:2C:26:D0:90:6A RK-Bluetooth keyboard  Device CA:1C:83:E2:08:59 BT4.0+2.4G Mouse  Device E0:9F:2A:08:10:43 Intuos BT S  Device E0:EA:E1:C3:44:22 Inspire 2    $ bluetooth show  Controller 00:1A:7D:DA:71:11 (public)      Name: pop-os      Alias: pop-os      Class: 0x001c0104      Powered: yes      Discoverable: yes      DiscoverableTimeout: 0x00000000      Pairable: no      UUID: Message Notification Se.. (00001133-0000-1000-8000-00805f9b34fb)      UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)      UUID: OBEX Object Push          (00001105-0000-1000-8000-00805f9b34fb)      UUID: Message Access Server     (00001132-0000-1000-8000-00805f9b34fb)      UUID: IrMC Sync                 (00001104-0000-1000-8000-00805f9b34fb)      UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)      UUID: Vendor specific           (00005005-0000-1000-8000-0002ee000001)      UUID: Headset AG                (00001112-0000-1000-8000-00805f9b34fb)      UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)      UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)      UUID: Phonebook Access Server   (0000112f-0000-1000-8000-00805f9b34fb)      UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)      UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)      UUID: Generic Access Profile    (00001800-0000-1000-8000-00805f9b34fb)      UUID: Audio Source              (0000110a-0000-1000-8000-00805f9b34fb)      UUID: OBEX File Transfer        (00001106-0000-1000-8000-00805f9b34fb)      Modalias: usb:v1D6Bp0246d0535      Discovering: no  Advertising Features:      ActiveInstances: 0x00      SupportedInstances: 0x05      SupportedIncludes: tx-power      SupportedIncludes: appearance      SupportedIncludes: local-name    $ bluetoothctl info 70:26:05:8C:CE:40                                               Device 70:26:05:8C:CE:40 (public)      Name: LE_WH-1000XM3      Alias: LE_WH-1000XM3      Class: 0x00240404      Icon: audio-card      Paired: yes      Trusted: yes      Blocked: no      Connected: yes      LegacyPairing: no      UUID: Vendor specific           (00000000-deca-fade-deca-deafdecacaff)      UUID: Headset                   (00001108-0000-1000-8000-00805f9b34fb)      UUID: Audio Sink                (0000110b-0000-1000-8000-00805f9b34fb)      UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)      UUID: A/V Remote Control        (0000110e-0000-1000-8000-00805f9b34fb)      UUID: Handsfree                 (0000111e-0000-1000-8000-00805f9b34fb)      UUID: PnP Information           (00001200-0000-1000-8000-00805f9b34fb)      UUID: Vendor specific           (7b265b0e-2232-4d45-bef4-bb8ae62f813d)      UUID: Vendor specific           (81c2e72a-0591-443e-a1ff-05f988593351)      UUID: Vendor specific           (931c7e8a-540f-4686-b798-e8df0a2ad9f7)      UUID: Vendor specific           (96cc203e-5068-46ad-b32d-e316f5e069ba)      UUID: Vendor specific           (b9b213ce-eeab-49e4-8fd9-aa478ed1b26b)      UUID: Vendor specific           (f8d1fbe4-7966-4334-8024-ff96c9330e15)      Modalias: usb:v054Cp0CD3d0452      ManufacturerData Key: 0x012d      ManufacturerData Value:    04 00 01 31 00 01 ba 5c 10 b9 00 60 d0 00 00 00  ...1...\...`....    00 00 00                                         ...                   ServiceData Key: 0000fe26-0000-1000-8000-00805f9b34fb      ServiceData Value:    0a c9 5c                                         ..\                   ServiceData Key: 0000fe2c-0000-1000-8000-00805f9b34fb      ServiceData Value:    0a c9 5c                                         ..\                 $ lsusb -v | grep -E '\<(Bus|iProduct|bDeviceClass|bDeviceProtocol)' 2>/dev/null  Couldn't open device, some information will be missing  Couldn't open device, some information will be missing  Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub    bDeviceClass            9 Hub    bDeviceProtocol         0 Full speed (or root) hub    iProduct                2   Bus 002 Device 013: ID 1224:2a25      bDeviceClass          239 Miscellaneous Device    bDeviceProtocol         1 Interface Association    iProduct                2         (Bus Powered)  Couldn't open device, some information will be missing  Bus 002 Device 012: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)    bDeviceClass          224 Wireless    bDeviceProtocol         1 Bluetooth    iProduct                2   Couldn't open device, some information will be missing  Couldn't open device, some information will be missing  Bus 002 Device 011: ID 05e3:0608 Genesys Logic, Inc. Hub    bDeviceClass            9 Hub  Couldn't open device, some information will be missing    bDeviceProtocol         1 Single TT    iProduct                1   Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub    bDeviceClass            9 Hub    bDeviceProtocol         0 Full speed (or root) hub    iProduct                2   Bus 006 Device 003: ID 045e:0291 Microsoft Corp. Xbox 360 Wireless Receiver for Windows    bDeviceClass          255 Vendor Specific Class    bDeviceProtocol       255 Vendor Specific Protocol    iProduct                0         (Bus Powered)  Couldn't open device, some information will be missing  Bus 006 Device 002: ID 25a7:fa11 Nordic 2.4G Wireless Receiver    bDeviceClass            0     bDeviceProtocol         0     iProduct                2         (Bus Powered)  Couldn't open device, some information will be missing  Couldn't open device, some information will be missing  Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub  Couldn't open device, some information will be missing    bDeviceClass            9 Hub    bDeviceProtocol         0 Full speed (or root) hub    iProduct                2   Bus 005 Device 002: ID 04b3:3025 IBM Corp. NetVista Full Width Keyboard    bDeviceClass            0     bDeviceProtocol         0     iProduct                2         (Bus Powered)  Couldn't open device, some information will be missing  Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub  Couldn't open device, some information will be missing    bDeviceClass            9 Hub    bDeviceProtocol         0 Full speed (or root) hub    iProduct                2   Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub    bDeviceClass            9 Hub    bDeviceProtocol         0 Full speed (or root) hub    iProduct                2   Couldn't open device, some information will be missing  Couldn't open device, some information will be missing  Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub    bDeviceClass            9 Hub  Couldn't open device, some information will be missing    bDeviceProtocol         0 Full speed (or root) hub    iProduct                2   Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub    bDeviceClass            9 Hub    bDeviceProtocol         0 Full speed (or root) hub    iProduct                2   Bus 009 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub    bDeviceClass            9 Hub    bDeviceProtocol         3     iProduct                2   Bus 008 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub    bDeviceClass            9 Hub    bDeviceProtocol         1 Single TT    iProduct                2   

Docker reporting that my Linux kernel doesn't support cgroup cpu real-time period

Posted: 12 May 2021 07:06 AM PDT

I've configured Docker on my Ubuntu 18.04 Server to expose its API so I can create and deploy Docker containers via REST requests, which I need to add certain features to my project. This worked fine for first few endpoints I tried. However, when I attempt to create a new Docker container (the main point of the exercise), I get the message:

{"message": "Your kernel does not support cgroup cpu real-time period"}  

Is this true? Alternatively is it instead that I need to set something up to enable this functionality, or is Docker reporting incorrectly?

curl -X POST -H "Content-Type: application/json" -d "@./test-data/docker-create-api-test.json" http://localhost:1112/containers/create  {"message":"Your kernel does not support cgroup cpu real-time period"}  

Very grateful for any assistance given as this functionality is critical to my project.

Logrotate "permission denied" error

Posted: 12 May 2021 08:42 AM PDT

I am trying to get logrotate to work and keep getting the follow error message.

/etc/cron.daily/logrotate:  error: error accessing /ftp/logs: Permission denied  error: error opening /ftp/logs/sftp_system.log: Permission denied  

Below are the folder rights:

drwxrwx---. 2 psoft psoft          4096 Jun 19 09:05 logs  

Below are the file rights:

-rw-rw-r--. 1 psoft psoft  43449642 Jun 19 09:15 sftp_system.log  

Here is the config:

/ftp/logs/sftp_system.log  {          su psoft psoft          size=25M          rotate 5          copytruncate          create 0664 psoft psoft          notifempty  }  

I assume logrotate runs as root. I have tried changing file and folder rights and ownership and always get the same message. My OS is Oracle Linux 7 which is basically Redhat 7.

    root@DB-PRD1 etc]# ausearch -ts today -m avc -i      ----      type=PROCTITLE msg=audit(06/19/2019 03:09:01.964:15543) : proctitle=/usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf      type=SYSCALL msg=audit(06/19/2019 03:09:01.964:15543) : arch=x86_64 syscall=openat success=no exit=EACCES(Permission denied) a0=0xffffffffffffff9c a1=0x7fff6328bd90 a2=O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC a3=0x0 items=0 ppid=25062 pid=25065 auid=root uid=root gid=root euid=psoft suid=root fsuid=psoft egid=psoft sgid=root fsgid=psoft tty=(none) ses=1688 comm=logrotate exe=/usr/sbin/logrotate subj=system_u:system_r:logrotate_t:s0-s0:c0.c1023 key=(null)      type=AVC msg=audit(06/19/2019 03:09:01.964:15543) : avc:  denied  { read } for  pid=25065 comm=logrotate name=logs dev="dm-3" ino=2097153 scontext=system_u:system_r:logrotate_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=dir permissive=0      ----      type=PROCTITLE msg=audit(06/19/2019 03:09:01.965:15544) : proctitle=/usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf      type=SYSCALL msg=audit(06/19/2019 03:09:01.965:15544) : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x2574570 a1=O_RDWR|O_NOFOLLOW a2=0x2574570 a3=0x3630393130322d67 items=0 ppid=25062 pid=25065 auid=root uid=root gid=root euid=psoft suid=root fsuid=psoft egid=psoft sgid=root fsgid=psoft tty=(none) ses=1688 comm=logrotate exe=/usr/sbin/logrotate subj=system_u:system_r:logrotate_t:s0-s0:c0.c1023 key=(null)      type=AVC msg=audit(06/19/2019 03:09:01.965:15544) : avc:  denied  { read write } for  pid=25065 comm=logrotate name=sftp_system.log dev="dm-3" ino=2097163 scontext=system_u:system_r:logrotate_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=file permissive=0  
    [root@DB-PRD1 etc]# sestatus      SELinux status:                 enabled      SELinuxfs mount:                /sys/fs/selinux      SELinux root directory:         /etc/selinux      Loaded policy name:             targeted      Current mode:                   enforcing      Mode from config file:          enforcing      Policy MLS status:              enabled      Policy deny_unknown status:     allowed      Max kernel policy version:      29  

I received this email this morning:

/etc/cron.daily/logrotate:    error: error accessing /ftp/logs: Permission denied  error: error creating output file /ftp/logs/sftp_system.log-20190724: Permission denied  
[root@DB-PRD1 ftp]# ausearch -ts today -m avc -i  ----  type=PROCTITLE msg=audit(07/24/2019 03:06:01.809:69341) : proctitle=/usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf  type=SYSCALL msg=audit(07/24/2019 03:06:01.809:69341) : arch=x86_64 syscall=openat success=no exit=EACCES(Permission denied) a0=0xffffffffffffff9c a1=0x7ffe0b8767d0 a2=O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC a3=0x0 items=0 ppid=21723 pid=21725 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=7731 comm=logrotate exe=/usr/sbin/logrotate subj=system_u:system_r:logrotate_t:s0-s0:c0.c1023 key=(null)  type=AVC msg=audit(07/24/2019 03:06:01.809:69341) : avc:  denied  { read } for  pid=21725 comm=logrotate name=logs dev="dm-3" ino=2097153 scontext=system_u:system_r:logrotate_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=dir permissive=0  ----  type=PROCTITLE msg=audit(07/24/2019 03:06:01.809:69342) : proctitle=/usr/sbin/logrotate -s /var/lib/logrotate/logrotate.status /etc/logrotate.conf  type=SYSCALL msg=audit(07/24/2019 03:06:01.809:69342) : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x1ccb3a0 a1=O_WRONLY|O_CREAT|O_EXCL|O_NOFOLLOW a2=0600 a3=0xe items=0 ppid=21723 pid=21725 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=7731 comm=logrotate exe=/usr/sbin/logrotate subj=system_u:system_r:logrotate_t:s0-s0:c0.c1023 key=(null)  type=AVC msg=audit(07/24/2019 03:06:01.809:69342) : avc:  denied  { write } for  pid=21725 comm=logrotate name=logs dev="dm-3" ino=2097153 scontext=system_u:system_r:logrotate_t:s0-s0:c0.c1023 tcontext=system_u:object_r:unlabeled_t:s0 tclass=dir permissive=0  

Does the directory containing the file need to have var_log_t access as well for this to work? I am going to try that and see if that makes a difference.

[root@DB-PRD1 ftp]# ls -dZ logs  drwxrwx---. psoft psoft system_u:object_r:unlabeled_t:s0 logs    [root@DB-PRD1 logs]# ls -Z  -rw-rw-r--. psoft psoft system_u:object_r:var_log_t:s0   sftp_system.log  

Dark theme in Dolphin file manager

Posted: 12 May 2021 06:57 AM PDT

I'm using a dark theme in Debian, but the Dolphin file manager just ignores it.

I have seen some examples of a dark theme in Dolphin, but I can't find a way to do it. I've seen some ways to set a background image, but of course that doesn't help me, because I would have black text on black background.

From what I've seen I might need a KDE theme. I have found this, but it gives me a .qtcurve file.
I looked up how to use it and this page told me to use KDE system settings. Sounds weird, but ok, I installed the systemsettings package.
But in the KDE system settings I only had the categories "shortcuts", "network settings" and "network connectivity". So I installed kde-config-gtk-style and it did indeed add the "application style" category to the KDE settings.
There I first tried setting "BlackMATE" as the GTK2 and GTK3 theme, which did nothing. Then I tried importing the downloaded theme file, which didn't work, because it expected a .tar file.
So I packed the theme file into a .tar archive (which seems weird, why would I need to do that?) and imported that, which made the settings window become unresponsive and then close itself. I guess it's not the sort of tar file it expects?
When I click "download GTK2 themes" or "download GTK3 themes", it stays at "initialising" and does nothing.

So how do I set a dark theme in Dolphin? Do I even need the KDE settings?

Debian 9.5
Cinnamon 3.2.7
Dolphin 16.08.3

Automatically install unmet build dependencies as detected by dpkg-checkbuilddeps

Posted: 12 May 2021 08:34 AM PDT

Is there a command that installs all the unmet build dependencies that dpkg-checkbuilddeps would list?

I tried to sed the output and give it to apt-get install, but it seems very hacky and for some reason didn't work in some environments.

sudo apt-get install --yes $(dpkg-checkbuilddeps | sed 's/([^)]*)//g' | sed 's/dpkg-checkbuilddeps:\serror:\sUnmet build dependencies://g')  

Is there a better way?

CPU overheating on Linux, but not on Windows, while doing the same things

Posted: 12 May 2021 09:18 AM PDT

I can clearly hear the fans (there are 2 of them) inside my laptop spin more on Linux Mint 18.2 Cinnamon 64-bit with kernel 4.10.0-37-generic, but any kernel I've tried for that matter, than on Windows 10 Pro. What is more important, my laptop's cooling does not keep up for the temperatures, as shows this dmesg snippet:

[10498.701800] CPU1: Package temperature above threshold, cpu clock throttled (total events = 2582)  [10498.701802] CPU4: Package temperature above threshold, cpu clock throttled (total events = 2582)  [10498.701804] CPU7: Package temperature above threshold, cpu clock throttled (total events = 2582)  [10498.701805] CPU0: Package temperature above threshold, cpu clock throttled (total events = 2582)  [10498.701806] CPU3: Package temperature above threshold, cpu clock throttled (total events = 2582)  [10498.701807] CPU5: Package temperature above threshold, cpu clock throttled (total events = 2582)  [10498.701809] CPU2: Package temperature above threshold, cpu clock throttled (total events = 2582)  [10498.701816] CPU6: Package temperature above threshold, cpu clock throttled (total events = 2582)  

with 2582 of these events in uptime -p of 3 hours, I don't know what does this Linux otherwise than the Windows.

I must stress that I am using this Linux for a long time, and it always had this issue. And I start worrying about my CPU in the long-run.

I tried installing intel-microcode in Driver Manager. Did not change a thing.

For example, I am playing a browser game based on Flash Player in Chrome.

The CPU in question is Intel Core i7 4700HQ.


EDIT1:

ps -aux  

output (expired on pastebin).

XSane - Error during read: Error during device I/O - Canon Pixma mg3550 scanner/printer

Posted: 12 May 2021 08:29 AM PDT

I'm trying to get my scanner/printer Canon PIXMA MG3550 to work over the network with XSane. The driver is installed and almost everything works (printing over USB & network, scanning over USB).

The scanner is recognized, XSane's info panel shows correct information about the device, so does scanimage -L which returns

device `pixma:MG3500_192.168.xx.yy' is a CANON Canon PIXMA MG3500 Series multi-function peripheral  

But when I hit the scan button in XSane I get the following error :

Error during read: Error during device I/O

Yet the scanner seems to respond when I click on scan or preview since I can hear the hardware briefly move before I get the error.

I'm running Debian Jessie. (I don't know where to look for XSane error log...)

Any suggestions ?


Edit 1 : I installed scangearmp which is the soft provided by Canon and it works flawlessly.
I don't know why but previewing with XSane worked 2 or 3 times in an unpredictable way although I'm totally unable to reproduce this on purpose. At first I thought that deleting ~/.sane was the trick but after checking again several times I can confirm it is not.

Postfix does not check "From:" address with sender_login_maps

Posted: 12 May 2021 06:34 AM PDT

I am trying to set up a postfix configuration where (virtual) users are allowed to only send with "From:"-addresses they own. So I put reject_authenticated_sender_login_mismatch into smtpd_sender_restrictions.

Using

query = SELECT goto FROM alias WHERE address='%s' and active=1;  

in my sender_login_maps.cf I can send mails with any sender address I want, even something like madeup@not_my_domain.com.

However,

postmap -q "madeup@not_my_domain.com" mysql:/etc/postfix/sql/sender_login_maps.cf   

returns nothing as expected.

Now if I change the query to

SELECT goto FROM alias WHERE address='notinthedatabaseforsure' and active=1;   

I am not able to send any mails at all. So far so good. But the log says

postfix/smtps/smtpd[11683]: NOQUEUE: reject: RCPT from...: 553 5.7.1 <user@domain.com>:     Sender address rejected: not owned by user user@domain.com; from=<user@domain.com> to=<user2@domain.com> proto=ESMTP helo=<[192.168.2.103]>  

even if I try to send from madeup@not_my_domain.com. user@domain.com is the login name, user2@domain.com the recipient.

In a proper setup i would expect something like

postfix/smtps/smtpd[11683]: NOQUEUE: reject: RCPT from ...: 553 5.7.1 <madeup@not_my_domain.com>:     Sender address rejected: not owned by user user@domain.com; from=<madeup@not_my_domain.com> to=<user2@domain.com> proto=ESMTP helo=<[192.168.2.103]>  

So it looks like postfix uses the login name to search for the login name regardless of the sender address, which explains why I can send with any sender address using the query I mentioned first.

Update: I checked my sql logs and indeed, the MySQL server never sees madeup@not_my_domain.com. It only gets queries for the login address and the recipient address user2@domain.com.

Here are the smtps part from master.cf and my main.cf:

  smtps inet n - - - - smtpd    -o syslog_name=postfix/smtps    -o smtpd_tls_wrappermode=yes    -o tls_preempt_cipherlist=yes    -o smtpd_tls_security_level=encrypt    -o smtpd_sasl_auth_enable=yes    -o smtpd_client_restrictions=permit_sasl_authenticated,reject    -o milter_macro_daemon_name=ORIGINATING    -o smtpd_sasl_type=dovecot    -o smtpd_sasl_security_options=noanonymous    -o smtpd_relay_restrictions=reject_non_fqdn_recipient,reject_unknown_recipient_domain,permit_mynetworks,permit_sasl_authenticated,reject    -o milter_macro_daemon_name=ORIGINATING    -o cleanup_service_name=submission-header-cleanup  
  mynetworks = 127.0.0.0/8  inet_interfaces = all  mydomain = domain.com  myhostname = mail.domain.com  myorigin = $mydomain  mydestination =  relayhost =      smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_non_fqdn_recipient    smtpd_recipient_restrictions =   permit_mynetworks,   permit_sasl_authenticated,   reject_non_fqdn_hostname,   reject_non_fqdn_sender,   reject_non_fqdn_recipient,   reject_unauth_destination,   reject_unauth_pipelining,   reject_invalid_hostname    smtpd_sender_restrictions =   reject_non_fqdn_sender,   reject_unknown_sender_domain,   reject_unauth_pipelining,   reject_authenticated_sender_login_mismatch,   permit_sasl_authenticated    smtpd_helo_required = yes  smtpd_helo_restrictions =   permit_mynetworks                              reject_invalid_helo_hostname                              reject_non_fqdn_helo_hostname                              reject_unknown_helo_hostname    smtpd_data_restrictions = reject_unauth_pipelining    smtpd_sasl_auth_enable = yes  smtpd_sasl_security_options = noanonymous, noplaintext  smtpd_sasl_type = dovecot  smtpd_sasl_path = private/auth    postscreen_access_list =        permit_mynetworks                                  cidr:/etc/postfix/postscreen_access  postscreen_blacklist_action = drop  postscreen_greet_action = drop    postscreen_dnsbl_threshold = 2  postscreen_dnsbl_sites = dnsbl.sorbs.net*1, bl.spamcop.net*1, ix.dnsbl.manitu.net*2, zen.spamhaus.org*2  postscreen_dnsbl_action = drop    virtual_alias_maps = mysql:/etc/postfix/sql/aliases.cf  virtual_mailbox_maps = mysql:/etc/postfix/sql/accounts.cf  virtual_mailbox_domains = mysql:/etc/postfix/sql/domains.cf  relay_domains = mysql:/etc/postfix/sql/relay_domains.cf  smtpd_sender_login_maps = mysql:/etc/postfix/sql/sender_login_maps.cf      virtual_uid_maps = static:3000  virtual_gid_maps = static:3000  virtual_mailbox_base = /home/vmail    # Disable NIS lookup warning  alias_maps=hash:/etc/aliases    append_dot_mydomain = no  recipient_delimiter = +  

How to send Ossec alerts to Syslog server

Posted: 12 May 2021 08:00 AM PDT

I want ossec server to send alerts to Syslog server. Now in this case Ossec Server and RSyslog Server are on same server.

I want Ossec Server to send all the alerts from client to location /var/log/Clients_Logs/127.0.0.1/ossec.log . I updated ossec.conf file like this.

<syslog_output>      <server>127.0.0.1</server>      <location>/var/log/Clients_Logs/127.0.0.1/ossec.log</location>      <port>514</port>      <level>3</level>  </syslog_output>  

And when i tried to restart ossec server . It slapped me with this error

ossec-monitord not running ..  ossec-logcollector not running ..  ossec-remoted not running ..  ossec-syscheckd not running ..  ossec-analysisd not running ..  ossec-maild not running ..  ossec-execd not running ..  ossec-csyslogd not running ..  OSSEC HIDS v2.8 Stopped  Starting OSSEC HIDS v2.8 (by Trend Micro Inc.)...  2015/11/30 17:13:02 ossec-csyslogd: DEBUG: Starting ...  2015/11/30 17:13:02 ossec-config(1230): ERROR: Invalid element in the configuration: 'location'.  2015/11/30 17:13:02 ossec-config(1202): ERROR: Configuration error at '/var/ossec/etc/ossec.conf'. Exiting.  2015/11/30 17:13:02 ossec-csyslogd(1202): ERROR: Configuration error at '/var/ossec/etc/ossec.conf'. Exiting.  ossec-csyslogd did not start correctly.  

I read man pages on ossec site but it didn't help . Any suggestions .......

exit trap in dash vs ksh and bash

Posted: 12 May 2021 08:42 AM PDT

Here's a simple script that sets up a temp dir in the current dir and a trap to delete it on exit.

#filename: script     set -x    trap 'rm -rf "$d"' exit  d=`TMPDIR=$PWD mktemp -d`  "$@"  

If I do ksh script sleep 100 or bash script sleep 100 and interrupt it with, C-C, the trap gets executed and the directory is deleted. It doesn't work with dash. Why? Is this a bug or intended behavior?

My Ubuntu 14.04 LTS doesn't have sound

Posted: 12 May 2021 09:04 AM PDT

I installed Ubuntu 14.04 on VMware workstation version 10.0.0 on my Windows 7 machine. After installing I figured out that it doesn't have any sound so I checked the sound settings. All items seem to be at their default states and correct. Any suggestion to find the problem?

'ps' arguments to display PID, PPID, PGID, and SID collectively

Posted: 12 May 2021 08:21 AM PDT

I tried ps with different kinds of switches e.g. -A, aux, ef, and so forth but I cannot seem to find the right combination of switches that will tell me the Process ID (PID), Parent Process ID (PPID), Process Group ID (PGID), and the Session ID (SID) of a process in the same output.

comm: file is not in sorted order

Posted: 12 May 2021 08:52 AM PDT

I used comm to compare two sorted files. Each line in these files are positive integer numbers. But the results show

comm: file 1 is not in sorted order  comm: file 2 is not in sorted order  

How come the error even if these two files are sorted?

No comments:

Post a Comment