Monday, June 6, 2022

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Significance of `[...] & wait $!`

Posted: 06 Jun 2022 08:14 PM PDT

What is the significance of the bash pattern [...] & wait $!? For example:

curl -LsS $AZP_AGENT_PACKAGE_LATEST_URL | tar -xz & wait $!  

I understand this as:

  1. The & instructs bash to run the prior pipeline in a background subshell.
  2. The wait $! then waits for the pipeline to finish before returning.

But if that's the case, how is it any different from just running the pipeline itself? What's the point?

The script containing this example (and a few other instances) can be found at:

https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/docker?view=azure-devops

kvm:virtio better?

Posted: 06 Jun 2022 08:10 PM PDT

I found many articles about changing to virtio,but I don't know the reason.

Does virtio have higner performance?

virtio

NFSv4 mount that works fine for Ubuntu 20.04, fails on RHEL 8.6

Posted: 06 Jun 2022 07:49 PM PDT

I have an NFSv4 server that is an RHEL 7.9 box. Our Ubuntu 20.04 boxes can mount shares from this server with no problem. Now I'm setting up a RHEL 8.6 box, but it fails to mount the share with the error "No such file or directory".

The /etc/exports file on the server is:

/opt/exports 127.0.0.1(rw,sync,fsid=0,crossmnt,no_subtree_check) 10.10.3.83(rw,sync,fsid=0,crossmnt,no_subtree_check) 10.10.3.70(rw,sync,fsid=0,crossmnt,no_subtree_check) 10.10.3.52(rw,sync,no_root_squash,no_subtree_check)  /opt/exports/syst 127.0.0.1(rw,sync,no_root_squash,no_subtree_check) 10.10.3.83(rw,sync,no_root_squash,no_subtree_check) 10.10.3.70(rw,sync,no_root_squash,no_subtree_check) 10.10.3.52(rw,sync,no_root_squash,no_subtree_check)  /syst 127.0.0.1(rw,sync,no_root_squash,no_subtree_check) 10.10.3.83(rw,sync,no_root_squash,no_subtree_check) 10.10.3.70(rw,sync,no_root_squash,no_subtree_check) 10.10.3.52(rw,sync,no_root_squash,no_subtree_check)  

This mount command works fine on our Ubuntu machines:

# mount -vvv -t nfs4 -o proto=tcp,port=2049 syst-1:/syst /syst  mount.nfs4: timeout set for Mon Jun  6 19:13:21 2022  mount.nfs4: trying text-based options 'proto=tcp,port=2049,vers=4.2,addr=10.10.3.22,clientaddr=10.10.3.52'  mount.nfs4: mount(2): No such file or directory  mount.nfs4: mounting syst-1:/syst failed, reason given by server: No such file or directory  

The showmount command correctly shows the exports, so I know that part works:

# showmount --exports syst-1  Export list for syst-1:  /syst             10.10.3.52,10.10.3.70,10.10.3.83,127.0.0.1  /opt/exports/syst 10.10.3.52,10.10.3.70,10.10.3.83,127.0.0.1  /opt/exports      10.10.3.52,10.10.3.70,10.10.3.83,127.0.0.1  

Just for kicks and giggles, I've tried:

# mount -vvv -t nfs4 -o proto=tcp,port=2049 syst-1:/opt/export/syst /syst  # mount -vvv -t nfs4 -o proto=tcp,port=2049 syst-1:/ /syst  

with the same results. The target directory of /syst does exist and I've deleted it and re-created it, just in case I accidentally created it with hidden characters or something. Out of desperation, I've also tried rebooting the client and the server. I've added the necessary ports to the firewalls and even tried disabling the firewalls temporarily. Forward and reverse DNS for the server resolve correctly. There are no errors in the logs, but I haven't researched if I can setup more detailed logging.

I also tried deleting the redundant /syst (3rd line in the exports file), no change.

I've Googled this quite a bit, but the results I've found are either a different problem or are for things that I already have setup (such as fsid=0 in the first line of the exports file).

Thanks, Brad

Terminal not stay open when using custom url protocol x-scheme-handler?

Posted: 06 Jun 2022 06:41 PM PDT

I am trying to pass the url to be printed in shell and that the terminal remains open for 10 seconds, using this scheme echo://helloworld, sadly not works, the terminal closes before completing the commands.

Here's echo.desktop file code:

[Desktop Entry]  Name=echo  Exec=roxterm -e echo %u && sleep 10  Type=Application  Terminal=false  MimeType=x-scheme-handler/echo  

when I try to enable terminal mode Terminal=true, the same thing happens, the terminal closes before all commands are completed.

It only works if didn't use the -e option of roxterm, like Exec=roxterm

How to enable a non default OpenSSL Cipher Suite

Posted: 06 Jun 2022 08:08 PM PDT

I have an install of OpenSSL 1.1.1f as per Ubuntu 20.04 and I specifically want the TLS v1.2 suite TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 (ECDHE-ECDSA-AES128-CCM8) enabled.

TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 is available

How do I configured OpenSSL to allow the use of that cipher suite for other apps that use the OpenSSL install for TLS? Is it via cipher strings https://www.openssl.org/docs/man1.1.1/man1/ciphers.html?

When a user group is created, are there any group names that should be avoided?

Posted: 06 Jun 2022 06:16 PM PDT

There are many group names in /etc/group on a freshly installed Linux distribution. When creating a new group, are there any group names that should be avoided, outside of ones that already exist in /etc/group? Perhaps there are standards that I am unaware of. This question came to me the other day when making a a share group which seemed like a simple name and worked well. I would like to avoid name collisions with common services.

View dmesg timestamps in timezone

Posted: 06 Jun 2022 04:41 PM PDT

I have a server set to UTC, which from my understanding is generally considered a best practice.

I can view the output of dmesg with timestamps easily with dmesg -T, but this is not helpful for debugging.

How do I view these timestamps in my local timezone, for example, EDT?

Kali Linux | Social Engineering Toolkit | Email password incorrect

Posted: 06 Jun 2022 04:17 PM PDT

I recently started doing pen testing on Kali Linux and I've been having some issues with the software "Social Engineering Toolkit". I can boot it up just fine and use it just fine, however when I choose "mass mailer attack" (for legal reasons I am doing this between two emails I own), I am able to start doing the prompts. When I get to "email password" for the email I want to send the emails from, I input my password VERY CAREFULLY as kali won't show the actual password being typed. As it gets to the point of which I assume is where it logs into my account, it says my password is incorrect, even though it's correct. Does anyone know what I'm doing wrong? Any help would be appreciated.

what it's saying

True color support in TTY

Posted: 06 Jun 2022 06:16 PM PDT

I'd like to know if there's any way to get true color support in the tty. To be clear, I don't mean a terminal emulator, I mean the actual tty you get when no display server is running.

Restart a USB that gone down in debian9

Posted: 06 Jun 2022 03:48 PM PDT

I have a small linux test box that has one fancy usb lan gigabit adapter on it. This adapter is connected first with a 4 port usb3 hub then to the machine.

machine -> usb3 4port hub -> lan adapter

I've tried also powering the hub externally but the result doesn't change. After some random time this usb lan interface just dies.

Here's the journalctl log, the interface is called eth1

myhost kernel: usb 2-1: USB disconnect, device number 3  myhost kernel: usb 2-1.1: USB disconnect, device number 5  myhost kernel: ax88179_178a 2-1.1:1.0 eth1: unregister 'ax88179_178a' usb-0000:00:14.0-1.1, ASIX AX88179   myhost kernel: ax88179_178a 2-1.1:1.0 eth1: Failed to read reg index 0x0002: -19  myhost kernel: ax88179_178a 2-1.1:1.0 eth1: Failed to write reg index 0x0002: -19  myhost systemd[1]: Stopping ifup for eth1...  myhost kernel: ax88179_178a 2-1.1:1.0 eth1 (unregistered): Failed to write reg index 0x0002: -19  myhost kernel: ax88179_178a 2-1.1:1.0 eth1 (unregistered): Failed to write reg index 0x0001: -19  myhost kernel: ax88179_178a 2-1.1:1.0 eth1 (unregistered): Failed to write reg index 0x0002: -19  

this is instead what happens to the lsusb log, before the device not responding:

Bus 002 Device 007: ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet  Bus 002 Device 006: ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet  Bus 002 Device 003: ID 05e3:0626 Genesys Logic, Inc.   Bus 002 Device 004: ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet  Bus 002 Device 002: ID 05e3:0626 Genesys Logic, Inc.   Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub  Bus 001 Device 004: ID 8087:07dc Intel Corp.   Bus 001 Device 003: ID 05e3:0610 Genesys Logic, Inc. 4-port hub  Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  

after the device not responding:

Bus 002 Device 007: ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet  Bus 002 Device 006: ID 0b95:1790 ASIX Electronics Corp. AX88179 Gigabit Ethernet  Bus 002 Device 004: ID 05e3:0626 Genesys Logic, Inc.   Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub  Bus 001 Device 004: ID 8087:07dc Intel Corp.   Bus 001 Device 003: ID 05e3:0610 Genesys Logic, Inc. 4-port hub  Bus 001 Device 002: ID 05e3:0610 Genesys Logic, Inc. 4-port hub  Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  

It appears that the usb3 hub has 2 device address the usb2 and the usb3 part... the usb3 part Bus 002 Device 002 dies while the Bus 001 Device 002 still is up.

Rebooting the system fix the problem for another 30 minutes.

However rebooting the system is very annoying.

There's a code that I could call in order to physically disable and re enable the usb hub or the entire usb root without having to reboot the system every 30 min?

I would like to write a cron script to workaround this stuff before changing the piece of hardware that is so unstable.

I've tried also some other solution proposed in other questions but I would like to restart the whole USB root of devices, this could work instead the restart of single device that is not accessible anymore.

Thanks

Echoing to $(tty) in a backgrounded process

Posted: 06 Jun 2022 04:11 PM PDT

Why does this not print anything?

bash -c '(while echo "not printing" ; do sleep 1; done) > "$(tty)" & sleep 10'  

Even though this, for example, does:

bash -c '(while echo "is printing" ; do sleep 1; done) > "$(tty)" && true'  

.sh file does not execute all commands

Posted: 06 Jun 2022 04:16 PM PDT

I wrote a .sh file that only has a series of linux commands to automatically download all of my required files, packages and software should I need to do an OS wipe. This is what it looks like:

sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y  sudo apt-get remove --auto-remove cheese -y  sudo ubuntu-drivers autoinstall -y    sudo add-apt-repository -y ppa:kdenlive/kdenlive-stable  sudo add-apt-repository -y ppa:deadsnakes/ppa  sudo add-apt-repository -y ppa:cappelikan/ppa  sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y    sudo apt-get install build-essential git curl wget ca-certificates gnupg lsb-release unrar libglvnd-dev pkg-config libssl-dev libffi-dev python3-dev python3-pip synaptic ubuntu-restricted-extras kdenlive nvidia-cuda-toolkit ffmpeg v4l2loopback-dkms obs-studio p7zip-full bazel-bootstrap libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-dev protobuf-compiler libboost-all-dev libopenblas-dev libleveldb-dev libsnappy-dev libhdf5-dev libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler clang zlib1g  torbrowser-launcher octave liboctave-dev mainline deluge tree dconf-editor nemo spyder octave htop cmake qsharp mthree cirq-core cirq-pascal  pyquil -y    wget https://zoom.us/client/latest/zoom_amd64.deb  wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb  wget https://github.com/TorchStudio/torchstudio/releases/download/0.9.7/TorchStudio_0.9.7-Linux_Installer.deb  wget https://repo.nordvpn.com/deb/nordvpn/debian/pool/main/nordvpn-release_1.0.0_all.deb?_ga=2.120179208.140754703.1654140064-1729555164.1654140064    git clone https://github.com/qulacs/qulacs.git    sh <(curl -sSf https://downloads.nordcdn.com/apps/linux/install.sh)    #! Install Display driver  #! chmod +x displaylink-driver-*  #! sudo ./displaylink-driver-*    pip3 install –upgrade pip    #! Install python packages  pip3 install numpy pandas Pillow lxml opencv-python matplotlib spotify_dl instaloader scikit-learn scikit-image scipy numba tensorflow tensorflow-addons torch torchvision torchaudio fastai keras jupyterlab notebook qiskit tensorflow-quantum cirq argon2-cffi ipykernel ipython-genutils nbconvert nbformat prometheus-client Send2Trash terminado ipython jupyter-server jupyterlab-server nbclassic vosk pyquil imutils dlib mxnet qulacs torchviz    pip3 install pennylane --upgrade    pip3 install pennylane-sf pennylane-qiskit pennylane-cirq pennylane-forest pennylane-qsharp --force --no-dependencies      #! Install apps  sudo snap install clion --classic  sudo snap install pycharm-professional --classic  sudo snap install webstorm --classic  sudo snap install thunderbird  sudo snap install walc  sudo snap install gimp  sudo snap install telegram-desktop  sudo snap install slack --classic  sudo snap install caprine  sudo snap install skype  sudo snap install teams  sudo snap install android-messages-desktop --edge  sudo snap install discord  sudo snap install code --classic  sudo snap install simplescreenrecorder  sudo snap install vlc  sudo snap install meshlab  sudo snap install amass  sudo snap install obs-studio  sudo snap install inkscape  sudo snap install remmina  sudo snap install netron  sudo snap install feroxbuster  sudo snap install joplin  sudo snap install poweshell –classic  sudo snap install zaproxy –classic  sudo snap install bitcoin-core  sudo snap install flutter –classic  sudo snap alias flutter.dart dart  sudo snap install android-studio –classic    #! Install chrome, zoom and torchstudio  sudo dpkg -i google-chrome-stable_current_amd64.deb  sudo dpkg -i zoom_amd64.deb  sudo dpkg -i TorchStudio*  sudo dpkg -i nordvpn*  sudo chmod 777 ./quacs/script/build_gcc.sh nordvpn*  ./qulacs/script/build_gcc.sh  sudo apt-get install ./nordvpn*  sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y  sudo apt-get install nordvpn      sudo apt-get update -y && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt autoremove -y  

However, a lot of the commands don't get executed. Particularly, the sudo apt-get install commands and pip3 commands. How can I fix this situation? Where am I going wrong?

patch without reject

Posted: 06 Jun 2022 08:37 PM PDT

This might be answered already but it is hard to search for -- basically,

When patch find a block/hunk unable to apply, it will reject the changed hunk into reject file.

How not to put the conflicts in reject file but include in the final output, just as when git find the conflicts and include both versions in the final output:

$ cat merge.txt  <<<<<<< HEAD  this is some content to mess with  content to append  =======  totally different content to merge later  >>>>>>> new_branch_to_merge_later  

Shredding one partition messes up whole external drive

Posted: 06 Jun 2022 05:17 PM PDT

I used the "shred" command on Linux to wipe a specific partition on my HDD (just a once-over with zeroes; no extra passes of random data).

The command I used:

shred -uvz -n 0 /dev/sda  

But once it completed the shredding, the disk appeared to have transformed into one homogeneous raw partition that can't be mounted. The Ubuntu disk utility reads "Contents Unknown" when the device is selected.

I also gave the HDD a look using dskmgmt on Windows to get some additional perspective. It gives the following message:

"You must initialize a disk before Logical Disk Manager can access it."

Any idea about what happened?

This was a big shred, by the way. I shredded 2.6 TB of a 3.6 TB HDD.

Is my HDD toast, or the data on my HDD toast?

I do have a backup of just about everything on the HDD on a SSD, so the situation is not dire. But if I could save the disk contents somehow, that would be really nice. I understand that there is recovery software but I wanted to reach out to the community for some advice: perhaps there is a simpler fix, or perhaps I could get a recommendation of recovery softawre to use?

Thanks for the help.

PS There were multiple partitions on the HDD (e.g. sda1, sda 4). So I did not inadvertently shred the whole thing. Also, as it was shredding, I could see in the terminal that the total size to be shredded was the expected size -- only 2.6 of the 3.6 TB.

How replace all dots AFTER other chars got captured

Posted: 06 Jun 2022 06:34 PM PDT

I'm trying to rename some shows with the perl-rename command. The format currently looks something like this:

series.S01E**.title.of.the.episode.mkv  

The asterisks are place holders for the episode number.

I want to rename it like so:

[Series] - S01E** - title of the episode.mkv  

I've managed to capture the name of the series as well as the episode, but i don't know how to replace the dots after i already matched something.

perl-rename 's/(\w+)\.(S\d{2}E\d{2})\./[\u$1] - $2 - /' -n *.mkv                                       ^ No idea what to insert here  

One call of rename is my goal. The title may be any variable number of words long, so i cannot do something like (\w+)\.(\w+).../$1 $2... # match a word and a dot for a fixed amount of times.

What I'm looking for is basically a loop to match a pattern of word..

Unexpected appended output from sed

Posted: 06 Jun 2022 05:25 PM PDT

I am trying to edit a couple of text files in Newick format. For the purpose of this, there is a species name (which I want to keep) connected by an underscore to a gene name (which I want to remove).

So from something like:

(Species_A_Some_Gene_Code:0.1,Species_B_GeneCode:0.2,(Species_C_Code:0.3,Species_D_Some_code:0.4):0.5);  

I'd like to get something like:

(Species_A:0.1,Species_B:0.2,(Species_C:0.3,Species_D:0.4):0.5);  

My current approach of using sed in bash. I'm trying to match something including the species name, up to the first colon (:), but discard stuff between the species name and the colon.

for i in Species_A Species_B Species_C Species_D; do   sed -i 's;\('"$i"'\)[^:]*\(:.*\);\1\2;p' "/directory/*.txt"  done  

What I get is... odd? Hard to tell because the actual result is bigger, but it looks a bit like:

(Species_A:0.1,Species_B_GeneCode:0.2,(Species_C_Code:0.3,Species_D_Some_code:0.4):0.5);  (Species_A:0.1,Species_B:0.2,(Species_C_Code:0.3,Species_D_Some_code:0.4):0.5);  (Species_A:0.1,Species_B:0.2,(Species_C:0.3,Species_D_Some_code:0.4):0.5);  (Species_A:0.1,Species_B:0.2,(Species_C_Code:0.3,Species_D:0.4):0.5);  

As if the result gets appended rather than replacing the old one. I am guessing it might have something to do with the second group that sed is trying to match, but I'm not sure. I would appreciate your help!

How to copy/paste between a console and an X session?

Posted: 06 Jun 2022 06:27 PM PDT

What's the fastest way to copy/paste between a non-graphical console (<Ctrl><Alt><F...>) and an X session ?

Right now :

  • I select the text with the mouse on the console (I've installed gpm)
  • Then I paste the text inside a temporary file
  • And finally I switch over to the x session, open the temporary file, and copy/paste its content

Is there an easier way to do this ? Can the primary selections of the non-X console and the X session be merged ? Ideally I'd want to select the text in the console, then switch over to the X session and paste it (middle-click). Can this be done ?

stow: No packages to stow or unstow

Posted: 06 Jun 2022 05:25 PM PDT

The following command works:

% pwd  /home/ismail/.dotfiles/.common-dotfiles  % stow --target=/home/ismail/.dotfiles/test .  

But the following command does not work:

stow --target=/home/ismail/.dotfiles/test --dir=/home/ismail/.dotfiles/.common-dotfiles  

It gives error:

stow: No packages to stow or unstow  

How can I give the link of source in stow (instead of using .)?

Remove line feed if pattern

Posted: 06 Jun 2022 04:20 PM PDT

There is a CSV file like this:

1st,2nd,3rd,4th,5th,6th,7th  "first-line  ",2,3,4,5,6,7  "second-line  ",2,3,4,5,6,7  "third-line  ",2,3,4,5,6,7  "normal-line",2,3,4,5,6,7  "forth-line  ",2,3,4,5,6,7  "fifth-line  ",2,3,4,5,6,7  

It looks like the lines were broken by inserting a line feed just before the ending quote of the first column. I want to remove that line feed.

I used the solution from this answer, but it messes up if there is a correct line in the text like the header and the "normal-line".

Is there a way to do this even with lines that are not broken?

Ubuntu 20.04 clevis-luks setup auto unlocking not working

Posted: 06 Jun 2022 04:10 PM PDT

I have an Ubuntu 20.04 machine setup that I am trying to configure for disk encryption. I am trying to setup auto unlock, but my configuration has not worked so far, and I am always prompted for a password.

To do this I followed the following steps:

  1. sudo apt-get update and sudo apt-get install cryptsetup
  2. Check /dev/nvme0n1p3 -> sudo cryptsetup luksDump /dev/nvme0n1p3 -> No Tokens or Keyslots
  3. Install clevis, clevis-luks, clevis-dracut, clevis-udisks2, clevis-systemd, clevis-tpm2
  4. sudo clevis luks list -d /dev/nvme0n1p3 -> Empty
  5. echo <my password> | sudo clevis luks bind -d /dev/nvme0n1p3 tpm2 '{ "pcr_bank":"sha256", "pcr_ids": "7,11" }'
  6. sudo dracut -fv --regenerate-all
  7. Check sudo clevis luks list -d /dev/nvme0n1p3 -> 1: tpm2 '{"hash":"sha256","key":"ecc","pcr_bank":"sha256","pcr_ids":"7,11"}'
  8. lsblk -o NAME,UUID,MOUNTPOINT ->
├─nvme0n1p1                 <uuid1>                              /boot/efi  ├─nvme0n1p2                 <uuid2>   /boot  └─nvme0n1p3                 <uuid3>       └─dm_crypt-0              <uuid4>       └─ubuntu--vg-ubuntu--lv <uuidd5>   /  
  1. cat /etc/crypttab -> dm_crypt-0 UUID=<uuid3> none luks

When booting I do not notice any errors for cryptsetup, luks, tpm2. Googling around and checking others questions, I have also verified tried:

  1. sudo systemctl enable clevis-luks-askpass.path
  2. update-initramfs -c -k all -> Runs successfully

My fstab file doesn't actually list the encrypted partition: cat /etc/fstab ->

# /etc/fstab: static file system information.  #  # Use 'blkid' to print the universally unique identifier for a  # device; this may be used with UUID= as a more robust way to name devices  # that works even if disks are added and removed. See fstab(5).  #  # <file system> <mount point>   <type>  <options>       <dump>  <pass>  # / was on /dev/ubuntu-vg/ubuntu-lv during curtin installation  /dev/disk/by-id/<Some id which I don't know the origin of> / ext4 defaults 0 1  # /boot was on /dev/nvme0n1p2 during curtin installation  /dev/disk/by-uuid/<uuid2> /boot ext4 defaults 0 1  # /boot/efi was on /dev/nvme0n1p1 during curtin installation  /dev/disk/by-uuid/<uuid1> /boot/efi vfat defaults 0 1  /swap.img   none    swap    sw  0   0  

I've also tried manually adding in the partition to fstab but did not work.

No matter what I try, it always asks for password on boot.

What could I do to fix this?

How do I correctly transfer xrandr settings to xorg.conf?

Posted: 06 Jun 2022 03:51 PM PDT

I have run multiple xrandr commands to set all my monitors settings as I want them. Then I used autorandr to save the state to a config file printed here:

hanke@debian ~ » cat .config/autorandr/3-displays/config   output DP-1  off  output DP-2  off  output DP-3  off  output DP-4  off  output DP-5  off  output DVI-D-0  crtc 1  mode 1600x900  pos 3840x0  rate 59.98  rotate left  output DP-0  crtc 0  mode 1920x1080  pos 1920x191  primary  rate 144.00  output HDMI-0  crtc 2  mode 1920x1080  pos 0x260  rate 60.00  

I have been using autorandr --change 3-displays in my window managers startup script to configure the displays, but I run into problems with this approach if I enable lightdm to get the greeter/login screen, which is run before my window manager, and in extension before my monitors are configured correctly. Because of this, the login screen is displayed on the wrong monitors in the wrong resolutions and orientations.

Because of this I now wish to transfer these settings to the /etc/X11/xorg.conf config file.

Here is my attempt so far:

Section "Monitor"          Identifier      "DP-0"          Option          "Position"      "1920 191"          Option          "Primary"       "true"          Option          "PreferredMode" "1920x1080_144.00"          Option          "Enable"        "true"  EndSection    Section "Monitor"          Identifier      "HDMI-0"          Option          "Position"      "0 260"          Option          "PreferredMode" "1920x1080_60.00"          Option          "Enable"        "true"  EndSection    Section "Monitor"          Identifier      "DVI D-0"          Option          "Rotate"        "left"          Option          "Position"      "3840 900"          Option          "PreferredMode" "1600x900_59.98"          Option          "Enable"        "true"  EndSection    Section "Monitor"          Identifier      "DP-1"          Option          "Enable"        "false"  EndSection    Section "Monitor"          Identifier      "DP-2"          Option          "Enable"        "false"  EndSection    Section "Monitor"          Identifier      "DP-3"          Option          "Enable"        "false"  EndSection    Section "Monitor"          Identifier      "DP-4"          Option          "Enable"        "false"  EndSection    Section "Monitor"          Identifier      "DP-5"          Option          "Enable"        "false"  EndSection  

Sadly, this does not seem to work. My gaming display is not getting set to 144 Hz refresh rate, the orientation on my DVI screen is all wrong and the positions seem to be ignored as well.

I have previously had startx fail because of bad xorg.conf values, but using this config it starts without crashing.

Am I missing something here? I just want my screens to be correctly configured in a nice and declarative way.

Running a bunch of xrandr commands in scripts feels hacky. The xorg.conf file seems like the correct way to do it, but I am failing to get it to work correctly.

Any help is appreciated.

What is the point of creating a user without a home directory?

Posted: 06 Jun 2022 05:56 PM PDT

While reading useradd manual pages, see that useradd -M user creates a user without home directory and I can not figure out what is the purpose on it.

I am new on sysadmin topics and do not know much about it.

Linux life sticks can't boot anymore on Lenovo T490 (and screen flickers)

Posted: 06 Jun 2022 04:05 PM PDT

It seems that my Lenovo laptop is not totally compatible with Linux. Let me explain:

Five months ago I bought a Lenovo ThinkPad T490 (i7-8565U, NVIDIA GeForce MX250 (and, of course, the Intel UHD 620), 24 GB RAM, 1TB SSD) without OS as I had planned to install Linux on it. Because I like Mint with KDE I decided to install the latest version of that, I believe it was Mint 18.3, as KDE is not supported any more on later versions. I had been using that OS and desktop environment on my previous laptop (also a ThinkPad but model T440s) for quite some time with no problems at all. Therefore I was surprised to see that I could not install it. The live stick worked, but the installation process was interrupted somewhere at the end, where the installer said that GRUB was missing or corrupted (or something similar). After trying to install other KDE OSes, i.e. Kubuntu and Neon, without success, I managed to install the newest Mint 19.2 Mate.

This worked, but barely. The screen flickers a lot and only stops when I switch the graphics driver from Intel to nvidia or the opposite. Also the fan is ON almost permanently, without heavy graphical work, not even a film. Some icons and bars are also not integrated very well or shifted.

Now, when I wanted to install a new OS, not even that would work any more. It was not even possible to properly boot into the live OS from the USB stick (I tried Kubuntu, Ubuntu, Mint KDE, Neon, Debian and Fedora with and without KDE). The boot process always froze, sometimes just when the home screen was showing. The only working live OS was the one, that I had used to install my current system (Mint Mate). I also created live sticks with LiLi on Windows, however, nothing changed.

I have heard of processor problems on this model with Linux, however, I cannot say that I have experienced that. I have been thinking about installing Windows on it an resell it, but I am also not sure that this is going to work.

Google could not help me until now. It seems that I am the only one with this problem... which is not very reassuring. My preferred solution would be to setup a fresh and well working installation with my favourite Linux. But I am open to alternatives.

Has anyone an idea how to solve this problem?

I'd be glad for any help.

EDIT: Lenovo support assumes it's a hardware problem. So, it's not really solved but it's Lenovo's turn now to try and fix the problem.

tell tar to ignore sockets - I don't want to see warnings

Posted: 06 Jun 2022 07:04 PM PDT

I have this warning message about sockets with tar:

ERRO[0000] Can't add file /home/ubuntu/backup-db/.bunion.sock to tar: archive/tar: sockets not supported

how can I tell tar that I don't care?

How to fix ".service: Start request repeated too quickly." on custom service?

Posted: 06 Jun 2022 07:08 PM PDT

I'm learning how to create services with systemd. I get this error:

.service: Start request repeated too quickly.  

I can't start the service any more; it was working yesterday. What am I doing wrong?

(root@Kundrum)-(11:03:19)-(~)  $nano /lib/systemd/system/swatchWATCH.service   1 [Unit]   2 Description=Monitor Logfiles and send Mail reports   3 After=syslog.target network.target   4   5 [Service]   6 Type=simple   7 ExecStart=/usr/bin/swatch --config-file=/home/kristjan/.swatchrc --input-record-separator="\n \n " --tail-file=/var/log/snort/alert --daemon   8 Restart=on-failure   9 StartLimitInterval=3  10 StartLimitBurst=100  11  12 [Install]  13 WantedBy=multi-user.target  

StartLimitInterval and StartLimitBurst I added after trying to fix it.

My system is Debian 9.8 Stretch all updates.

how to configure /etc/udev/rules.d/ syntax?

Posted: 06 Jun 2022 06:02 PM PDT

I am confused about how to configure udev rules for /dev/xxx.

Q1: I can't find where defined /dev/random?

#ll /dev/  total 0  lrwxrwxrwx 1 root root      11 Aug  4 17:57 core -> /proc/kcore  lrwxrwxrwx 1 root root      13 Aug  4 17:57 fd -> /proc/self/fd  crw-rw-rw- 1 root root  1,   7 Aug  4 17:57 full  crw-rw-rw- 1 root root 10, 229 Aug  4 17:57 fuse  drwxr-xr-x 2 root root       0 Aug  4 17:57 hugepages  lrwxrwxrwx 1 root root      25 Aug  4 17:57 initctl -> /run/systemd/initctl/fifo  srw-rw-rw- 1 root root       0 Aug  4 17:57 log  drwxrwxrwt 2 root root      40 Aug  4 17:57 mqueue  crw-rw-rw- 1 root root  1,   3 Aug  4 17:57 null  lrwxrwxrwx 1 root root       8 Aug  4 17:57 ptmx -> pts/ptmx  drwxr-xr-x 2 root root       0 Aug  4 17:57 pts  crw-rw-rw- 1 root root  1,   8 Aug  4 17:57 random  drwxrwxrwt 2 root root      40 Aug  4 17:57 shm  lrwxrwxrwx 1 root root      15 Aug  4 17:57 stderr -> /proc/self/fd/2  lrwxrwxrwx 1 root root      15 Aug  4 17:57 stdin -> /proc/self/fd/0  lrwxrwxrwx 1 root root      15 Aug  4 17:57 stdout -> /proc/self/fd/1  crw-rw-rw- 1 root root  5,   0 Aug  4 17:57 tty  crw-rw-rw- 1 root root  1,   9 Aug  4 17:57 urandom  crw-rw-rw- 1 root root  1,   5 Aug  4 17:57 zero][1]      [root@xxxxx /]  #cat /lib/udev/rules.d/*  |  grep mqueue    [root@xxxxx /]  #cat /lib/udev/rules.d/*  |  grep random  # Rule for prandom character device node permissions  KERNEL=="prandom", MODE="0644"    [root@xxxxxx /]  #cat /etc/udev/rules.d/* | grep random  

also can not find defualt rule

#cat /lib/udev/rules.d/* | grep "KERNEL==\"*\""  KERNEL=="device-mapper", NAME="mapper/control"  ACTION=="add", SUBSYSTEM=="module", KERNEL=="bridge", RUN+="/usr/lib/systemd/systemd-sysctl --prefix=/proc/sys/net/bridge"  KERNEL=="prandom", MODE="0644"  SUBSYSTEM=="virtio-ports", KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}"  SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100"  SUBSYSTEM=="tty", KERNEL=="ptmx", GROUP="tty", MODE="0666"  SUBSYSTEM=="tty", KERNEL=="tty", GROUP="tty", MODE="0666"  SUBSYSTEM=="tty", KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620"  SUBSYSTEM=="tty", KERNEL=="sclp_line[0-9]*", GROUP="tty", MODE="0620"  SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*", GROUP="tty", MODE="0620"  SUBSYSTEM=="tty", KERNEL=="3270/tty[0-9]*", GROUP="tty", MODE="0620"  SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty"  KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout"  SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640"  SUBSYSTEM=="input", KERNEL=="js[0-9]*", MODE="0664"  SUBSYSTEM=="misc", KERNEL=="agpgart", GROUP="video"  KERNEL=="parport[0-9]*", GROUP="lp"  SUBSYSTEM=="printer", KERNEL=="lp*", GROUP="lp"  KERNEL=="lp[0-9]*", GROUP="lp"  KERNEL=="irlpt[0-9]*", GROUP="lp"  SUBSYSTEM=="block", KERNEL=="sr[0-9]*", GROUP="cdrom"  KERNEL=="sch[0-9]*", GROUP="cdrom"  KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"  KERNEL=="pktcdvd", GROUP="cdrom"  KERNEL=="qft[0-9]*|nqft[0-9]*|zqft[0-9]*|nzqft[0-9]*|rawqft[0-9]*|nrawqft[0-9]*", GROUP="disk"  KERNEL=="loop-control", GROUP="disk", OPTIONS+="static_node=loop-control"  KERNEL=="btrfs-control", GROUP="disk"  KERNEL=="rawctl", GROUP="disk"  SUBSYSTEM=="raw", KERNEL=="raw[0-9]*", GROUP="disk"  SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440"  KERNEL=="rfkill", MODE="0664"  KERNEL=="tun", MODE="0666", OPTIONS+="static_node=net/tun"  KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse"  KERNEL=="loop*|ram*", GOTO="log_end"  KERNEL=="sr[0-9]*", ENV{ID_CDROM}="1"  KERNEL=="sr0", SYMLINK+="cdrom", OPTIONS+="link_priority=-100"  KERNEL=="mouse*|js*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="|00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-$env{.INPUT_CLASS}"  KERNEL=="mouse*|js*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="?*", ATTRS{bInterfaceNumber}!="00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$attr{bInterfaceNumber}-$env{.INPUT_CLASS}"  KERNEL=="event*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="|00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-$env{.INPUT_CLASS}"  KERNEL=="event*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="?*", ATTRS{bInterfaceNumber}!="00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$attr{bInterfaceNumber}-event-$env{.INPUT_CLASS}"  SUBSYSTEMS=="usb", ENV{ID_BUS}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="", ATTRS{bInterfaceNumber}=="?*", \  ENV{ID_PATH}=="?*", KERNEL=="mouse*|js*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-$env{.INPUT_CLASS}"  ENV{ID_PATH}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-event-$env{.INPUT_CLASS}"  SUBSYSTEMS=="usb|platform", ENV{ID_PATH}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="", \  ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_poll_msecs}=="0", ATTR{parameters/events_dfl_poll_msecs}="2000"  KERNEL=="fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md*|zram*|mmcblk[0-9]*rpmb", GOTO="persistent_storage_end"  KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}"  KERNEL=="vd*[0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}-part%n"  KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", IMPORT{program}="ata_id --export $devnode"  KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{type}=="5", ATTRS{scsi_level}=="[6-9]*", IMPORT{program}="ata_id --export $devnode"  KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", ATTR{removable}=="0", SUBSYSTEMS=="usb", IMPORT{program}="ata_id --export $devnode"  KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"  KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $devnode", ENV{ID_BUS}="scsi"  KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $devnode", ENV{ID_BUS}="cciss"  KERNEL=="sd*|sr*|cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"  KERNEL=="sd*|cciss*", ENV{DEVTYPE}=="partition", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"  KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}"  KERNEL=="sd*[0-9]", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}-part%n"  KERNEL=="mmcblk[0-9]", SUBSYSTEMS=="mmc", ATTRS{name}=="?*", ATTRS{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}"  KERNEL=="mmcblk[0-9]p[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}-part%n"  KERNEL=="mspblk[0-9]", SUBSYSTEMS=="memstick", ATTRS{name}=="?*", ATTRS{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/memstick-$env{ID_NAME}_$env{ID_SERIAL}"  KERNEL=="mspblk[0-9]p[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/memstick-$env{ID_NAME}_$env{ID_SERIAL}-part%n"  KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", \  KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", \  KERNEL=="st*[0-9]|nst*[0-9]", ATTRS{ieee1394_id}=="?*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394"  KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"  KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", KERNELS=="[0-9]*:*[0-9]", ENV{.BSG_DEV}="$root/bsg/$id"  KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --whitelisted --export --device=$env{.BSG_DEV}", ENV{ID_BUS}="scsi"  KERNEL=="st*[0-9]",  ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"  KERNEL=="nst*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst"  KERNEL=="st*[0-9]|nst*[0-9]", IMPORT{builtin}="path_id"  KERNEL=="st*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}"  KERNEL=="nst*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}-nst"  KERNEL=="video*", ENV{ID_SERIAL}=="?*", SYMLINK+="v4l/by-id/$env{ID_BUS}-$env{ID_SERIAL}-video-index$attr{index}"  ENV{ID_PATH}=="?*", KERNEL=="video*|vbi*", SYMLINK+="v4l/by-path/$env{ID_PATH}-video-index$attr{index}"  ENV{ID_PATH}=="?*", KERNEL=="audio*", SYMLINK+="v4l/by-path/$env{ID_PATH}-audio-index$attr{index}"  #   ACTION=="add", KERNEL=="sda", RUN+="/usr/bin/raw /dev/raw/raw1 %N"  KERNEL=="dm-*", SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="linux_raid_member", \  KERNEL=="md*", SUBSYSTEM=="block", ENV{ID_FS_TYPE}=="linux_raid_member", \  ACTION=="add", KERNEL=="md[0-9]*p[0-9]*", GOTO="lvm_scan"  SUBSYSTEM=="input", KERNEL=="event*", SUBSYSTEMS=="acpi", TAG+="power-switch"  SUBSYSTEM=="input", KERNEL=="event*", KERNELS=="thinkpad_acpi", TAG+="power-switch"  SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="twl4030_pwrbutton", TAG+="power-switch"  SUBSYSTEM=="input", KERNEL=="event*", ATTRS{name}=="tps65217_pwr_but", TAG+="power-switch"  SUBSYSTEM=="drm", KERNEL=="card*|renderD*", TAG+="uaccess"  SUBSYSTEM=="misc", KERNEL=="kvm", TAG+="uaccess"  SUBSYSTEM=="sound", KERNEL=="card*", TAG+="seat"  SUBSYSTEM=="input", KERNEL=="input*", TAG+="seat"  SUBSYSTEM=="graphics", KERNEL=="fb[0-9]*", TAG+="seat", TAG+="master-of-seat"  KERNEL=="mtd*ro", IMPORT{program}="mtd_probe $devnode"  ACTION=="add|change", KERNEL=="controlC*", ATTR{../uevent}="change"  SUBSYSTEM=="module", KERNEL=="parport_pc", RUN{builtin}+="kmod load ppdev"  KERNEL=="mtd*ro", ENV{MTD_FTL}=="smartmedia", RUN{builtin}+="kmod load sm_ftl"  KERNEL=="regulatory*", ACTION=="change", SUBSYSTEM=="platform", RUN+="/sbin/crda"  ACTION=="add", SUBSYSTEM=="vtconsole", KERNEL=="vtcon*", RUN+="/usr/lib/systemd/systemd-vconsole-setup"  KERNEL=="controlD[0-9]*", SUBSYSTEM=="drm", MODE="0600"  SUBSYSTEM=="module", KERNEL=="cxgb*", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"  SUBSYSTEM=="module", KERNEL=="ib_*", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"  SUBSYSTEM=="module", KERNEL=="mlx*", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"  SUBSYSTEM=="module", KERNEL=="iw_*", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"  SUBSYSTEM=="module", KERNEL=="be2net", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"  SUBSYSTEM=="module", KERNEL=="enic", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}="rdma.service"  SUBSYSTEM=="infiniband", KERNEL=="*", ACTION=="add", TEST!="/usr/sbin/rdma-ndd", RUN+="/bin/bash -c 'sleep 1; echo -n `hostname -s` %k > /sys/class/infiniband/%k/node_desc'"  SUBSYSTEM=="tty", KERNEL=="tty[a-zA-Z]*|hvc*|xvc*|hvsi*|ttysclp*|sclp_line*|3270/tty[0-9]*", TAG+="systemd"  KERNEL=="vport*", TAG+="systemd"  SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", TEST!="md/array_state", ENV{SYSTEMD_READY}="0"  SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0"  SUBSYSTEM=="block", KERNEL=="loop[0-9]*", ENV{DEVTYPE}=="disk", TEST!="loop/backing_file", ENV{SYSTEMD_READY}="0"  ACTION=="add", SUBSYSTEM=="block", KERNEL=="nbd*", ENV{SYSTEMD_READY}="0"  SUBSYSTEM=="sound", KERNEL=="card*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sound.target"  SUBSYSTEM=="usb", KERNEL=="lp*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="printer.target"  SUBSYSTEM=="leds", KERNEL=="*kbd_backlight", TAG+="systemd", IMPORT{builtin}="path_id", ENV{SYSTEMD_WANTS}+="systemd-backlight@leds:$name.service"  SUBSYSTEM=="module", KERNEL=="fuse", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-fs-fuse-connections.mount"  SUBSYSTEM=="module", KERNEL=="configfs", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sys-kernel-config.mount"  

Q2: If I add this rule , I hope /dev/random access become 0777 , but badly,after reboot, I find this configure is invalid. /dev/random access is still 0666, Is this configure wrong ?

this is just a example I want to verify syntax, This example may not be appropriate, I am not really want to modify /dev/random access from 0666 to 0777

[root@xxxxxx /]  #cat  /etc/udev/rules.d/70-muahao.rules  KERNEL=="random",  GROUP="root", MODE="0777", OPTIONS="last_rule"  

Kerberos/Samba can't join Active Directory [DEBIAN 8]

Posted: 06 Jun 2022 05:01 PM PDT

I have an issue when I try to join my domain.

I am able to create the kerberos ticket successfully.

root@debian:~# kinit Administrateur@ASP.DOMAIN  Password for Administrateur@ASP.DOMAIN:  root@debian:~# klist  Ticket cache: FILE:/tmp/krb5cc_0  Default principal: Administrateur@ASP.DOMAIN    Valid starting       Expires              Service principal  26/04/2016 18:20:18  27/04/2016 04:20:18  krbtgt/ASP.DOMAIN@ASP.DOMAIN          renew until 27/04/2016 18:20:11  

and when I try to join the domain :

    root@debian:~# net ads join -k   Failed to join domain: failed to lookup      DC info for domain 'ASP.DOMAIN' over rpc: {Device Timeout} The      specified I/O operation on %hs was not completed before the time-out period expired.  

my krb5.conf is:

[libdefaults]          default_realm = ASP.DOMAIN    # The following krb5.conf variables are only for MIT Kerberos.          krb4_config = /etc/krb.conf          krb4_realms = /etc/krb.realms          kdc_timesync = 1          ccache_type = 4          forwardable = true          proxiable = true    [realms]          ASP.DOMAIN = {                  kdc = asp.domain                  admin_server = server.domain                  default_domain = DOMAIN          }    [domain_realm]          .asp.domain = ASP.DOMAIN          asp.domain = ASP.DOMAIN  

My smb.conf :

[global]          security = ADS          realm = ASP.DOMAIN          password server = server.domain          workgroup = asp.domain          winbind separator = /          idmap uid = 10000-20000          idmap gid = 10000-20000          winbind enum users = yes          winbind enum groups = yes          template homedir = /home/%D/%U          template shell = /bin/bash          client use spnego = yes          winbind use default domain = yes          domain master = no          local master = no          preferred master = no          os level = 0  

I have no idea: there is no drop on my firewall. The ticket is ok. I've tried with 3 Domain Controlers.

PS : Domain is a variable

EDIT : I've tried to do it with samba-tool too

root@debian:~# samba-tool domain join ASP.DOMAIN MEMBER -UAdministrateur --real=ASP.DOMAIN  ERROR(runtime): uncaught exception - Connection to SAMR pipe of PDC for ASP.DOMAIN failed: Connection to DC failed: NT_STATUS_IO_TIMEOUT    File "/usr/lib/python2.7/dist-packages/samba/netcmd/__init__.py", line 175, in _run      return self.run(*args, **kwargs)    File "/usr/lib/python2.7/dist-packages/samba/netcmd/domain.py", line 606, in run      machinepass=machinepass)  

EDIT 2 : Join is ok ? But wbinfo -u is not ok

root@debian:~# net ads join -U Administrateur  Enter Administrateur's password:  Using short domain name -- DOMAIN  Joined 'ASP.DOMAIN' to dns domain 'asp.domain'  DNS Update for asp.kapia failed: ERROR_DNS_GSS_ERROR  DNS update failed: NT_STATUS_UNSUCCESSFUL  root@debian:~# net ads testjoin  Join is OK    root@debian:~# wbinfo -u  could not obtain winbind interface details: WBC_ERR_WINBIND_NOT_AVAILABLE  could not obtain winbind domain name!  Error looking up domain users  

EDIT 3 :

enter image description here EDIT 4 :

root@debian:~# service winbind status  ● winbind.service - LSB: start Winbind daemon     Loaded: loaded (/etc/init.d/winbind)     Active: active (exited) since mer. 2016-04-27 16:16:00 CEST; 55s ago    Process: 2222 ExecStart=/etc/init.d/winbind start (code=exited, status=0/SUCCESS)    avril 27 16:16:00 debian winbindd[2233]: #5 /usr/lib/x86_64-linux-gnu/libtevent.so.0(tevent_common_loop_timer_delay+0xcd) [0x7fbc2b11e1cd]  avril 27 16:16:00 debian winbindd[2233]: #6 /usr/lib/x86_64-linux-gnu/libtevent.so.0(+0x91ca) [0x7fbc2b11f1ca]  avril 27 16:16:00 debian winbindd[2233]: #7 /usr/lib/x86_64-linux-gnu/libtevent.so.0(+0x78e7) [0x7fbc2b11d8e7]  avril 27 16:16:00 debian winbindd[2233]: #8 /usr/lib/x86_64-linux-gnu/libtevent.so.0(_tevent_loop_once+0x8d) [0x7fbc2b11a12d]  avril 27 16:16:00 debian winbindd[2233]: #9 /usr/sbin/winbindd(main+0xb7c) [0x7fbc325cbc8c]  avril 27 16:16:00 debian winbindd[2233]: #10 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fbc2a92db45]  avril 27 16:16:00 debian winbindd[2233]: #11 /usr/sbin/winbindd(+0x25318) [0x7fbc325cc318]  avril 27 16:16:00 debian winbindd[2233]: [2016/04/27 16:16:00.971185,  0] ../source3/lib/dumpcore.c:318(dump_core)  avril 27 16:16:00 debian winbindd[2233]: dumping core in /var/log/samba/cores/winbindd  avril 27 16:16:00 debian winbindd[2233]:  

How to avoid duplicate connection names? (32) Connection 'Auto Ethernet' is already active on enpXXX

Posted: 06 Jun 2022 08:06 PM PDT

Is there any way that I can make networkmanager to assign some unique names or device derrived name instead of Auto Ethernet so that we can avoid the names conflict?

After I've upgraded to Ubuntu Vivid which uses systemd(though I'm not sure if it's directly related or it's just a bug / regression of network-manager) both of my mobile broadband devices get the "Auth Ethernet" name and are unable to get connected simultaneously.

I can temporarry fix it using nmcli con add type ethernet con-name my-office ifname ens3 but I would rather like to have network-manager handle this automatically (i.e. assign a random / unique conn name).

Use case:

I have two broadband USB devices and I need to connect to both of them. The issue is that NetworkManager displays them both as Auto Ethernet (duplicate in the network manager applet) and when I try to connect to the second network it errors out (32) Connection 'Auto Ethernet' is already active on enp0s20u. When I try to "edit" the connections it displays only one Auto Ethernet connection.

/etc/NetworkManager/system-connections also lists only one Auto Ethernet

How should I check to see if the remote smb serv is mounted?

Posted: 06 Jun 2022 05:15 PM PDT

I'm pretty new to mount. Basically, I have a remote SMB serv on the local network that I want copy images from a directory on, then repeat every 5 min.

I think what I need to do is make a script that checks to see if the server is mounted, if it isn't mount it, if it is, do nothing, then run rsync.

I was able to setup crontab (for the first time) to remove all the existing files in the directory and then runrsync, but I'm not sure how I should approach the SMB stuff. Should I mount it, copy the files and unmount, or should I leave the connection be?

Btw, I'm using OSX.

How can I execute `date` inside of a cron tab job?

Posted: 06 Jun 2022 05:56 PM PDT

I want to create a log file for a cron script that has the current hour in the log file name. This is the command I tried to use:

0 * * * * echo hello >> ~/cron-logs/hourly/test`date "+%d"`.log  

Unfortunately I get this message when that runs:

/bin/sh: -c: line 0: unexpected EOF while looking for matching ``'  /bin/sh: -c: line 1: syntax error: unexpected end of file  

I have tried escaping the date part in various ways, but without much luck. Is it possible to make this happen in-line in a crontab file or do I need to create a shell script to do this?

No comments:

Post a Comment