Saturday, May 14, 2022

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


"xmodmaped" key are not recognized by gsettings key bindings

Posted: 14 May 2022 12:11 PM PDT

I'm on Zorin OS 16.1 based on Ubuntu 20.04.

Current setup:

I disabled caps lock key when pressed alone then map caps lock + hjkl to corresponding arrow key via xmodmap and this works perfectly, recognizing many combination like word jump ctrl + caps lock + h (equals to ctrl + left).

keycode 66 = Mode_switch  keysym h = h H Left  keysym l = l L Right  keysym k = k K Up  keysym j = j J Down  

But when I was trying to use gsettings to map some gnome workspace movement, the arrow key map doesn't seem to work.

e.g., When I configure this to move between workspace horizontally,

gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-left  "['<Alt>Left']"  

My imagination is when I press Alt + CapsLock + h, it got interpreted to Alt + Left and does what it is told to. But the fact is this works only when I press the real left arrow key.

How can I fix this?

os-prober can't find Windows 10

Posted: 14 May 2022 12:05 PM PDT

I have two hard drives, one with Ubuntu 22 (Jammy) and a separate drive with Windows 10. System boots to Ubuntu by default, as set in BIOS. I'm trying to get my grub boot menu to list the Windows 10 drive, as I previously had on Ubuntu 18.

  1. The Windows drive is mounted (visible and accessible in /media)
  2. ntfs-3g is installed

sudo os-prober still doesn't detect. Naturally, grub also fails (yes, I have GRUB_DISABLE_OS_PROBER=false)

Any ideas?

Help installing rtl88x2bu drivers

Posted: 14 May 2022 12:02 PM PDT

I've just setup a new install of Linux mint and cannot connect to WiFi.

I'm living in university accommodation and the ethernet only seems to connect to devices / services on the university network, so I'm stuck using WiFi.

I have a pair of WiFi dongles (with realtek 8812bu and 8811 chipsets respectively) neither of which are recognised by my Linux mint install so I'm trying to install drivers for them.

I've cloned this repository - which should contain drivers for the 8812BU chipset - onto a usb stick and I'm following this tutorial which outlines using dkms to install these drivers.

dkms add ... works, but dkms build ... fails with the message:

make -j16 KERNELRELEASE=5.4.0-91-generic KVER=5.4.0-91-generic src=/usr/src/rtl88x2bu-5.6.1...  Error! Bad return status for module build on kernel: 5.4.0-91-generic (x86_64)  Consult /var/lib/dkms/rtl88x2bu/5.6.1/build/make.log for more informatio.  

I consult that log and find:

DKMS make.log ...  Sat 14 May ...  Makefile:2204 /usr/src/rtl88x2bu-5.6.1/hal/phydm.mk: No such file or directory  make: *** No rule to make target '/usr/src/rtl88x2bu-5.6.1/hal/phydm.mk'. Stop.  

Bare in mind, I have absoloutely no internet connection on the Linux Mint install.

How to download file from a server to local directory in kali linux?

Posted: 14 May 2022 11:55 AM PDT

Regarding to this link How to copy a file from a remote server to a local machine?

I have access to VPN and to user alice with IP. I use command

scp alice@10.0.118.230:myfiletodownload.iso /home/mylocaldirectory  

I get response

/home/mylocaldirectory: Permision denied  

Do you know why and how I can download file from server? I use kali linux.

I also tried

scp -r alice@10.0.118.230:~/myfile.iso root@kali:~/home  

Ubuntu18.04 - scaling_cur_freq is lower than scaling_min_freq

Posted: 14 May 2022 11:38 AM PDT

While using the server, we have confirmed that the clock speed is very low only for a specific CPU group. Could you please tell me the cause and solution for this?

All cpu's cpuinfo_min_freq and cpuinfo_max_freq are (1500, 2000). Also, the scaling driver is acpi-cpufreq, and the policy is ondemand.

0-63,128-191 CPUs clock speed shows 1500MHz, but others show 400MHz even if we use them 100% usage.

admin@ubuntu ~ % cpufreq-info | grep CPU | less  analyzing CPU 0:    CPUs which run at the same hardware frequency: 0    CPUs which need to have their frequency coordinated by software: 0    current CPU frequency is 1.50 GHz.  ...  analyzing CPU 64:    CPUs which run at the same hardware frequency: 64    CPUs which need to have their frequency coordinated by software: 64    current CPU frequency is 399 MHz.  

But when I print cpufreq from hardware, they all show 1500MHz.

sudo cpufreq-info | grep CPU | less  analyzing CPU 0:    CPUs which run at the same hardware frequency: 0    CPUs which need to have their frequency coordinated by software: 0    current CPU frequency is 1.50 GHz (asserted by call to hardware).  analyzing CPU 64:    CPUs which run at the same hardware frequency: 64    CPUs which need to have their frequency coordinated by software: 64    current CPU frequency is 1.50 GHz (asserted by call to hardware).  

lscpu command shows that low-frequency CPUs are in NUMA node 1. Could this be related?

admin@ubuntu ~ % lscpu  Architecture:        x86_64  CPU op-mode(s):      32-bit, 64-bit  Byte Order:          Little Endian  CPU(s):              256  On-line CPU(s) list: 0-255  Thread(s) per core:  2  Core(s) per socket:  64  Socket(s):           2  NUMA node(s):        2  Vendor ID:           AuthenticAMD  CPU family:          25  Model:               1  Model name:          AMD EPYC 7713 64-Core Processor  Stepping:            1  CPU MHz:             1499.971  CPU max MHz:         2000.0000  CPU min MHz:         1500.0000  BogoMIPS:            4000.23  Virtualization:      AMD-V  L1d cache:           32K  L1i cache:           32K  L2 cache:            512K  L3 cache:            32768K  NUMA node0 CPU(s):   0-63,128-191  NUMA node1 CPU(s):   64-127,192-255  Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 invpcid_single hw_pstate ssbd mba ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a rdseed adx smap clflushopt clwb sha_ni xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local clzero irperf xsaveerptr wbnoinvd arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold v_vmsave_vmload vgif umip pku ospke vaes vpclmulqdq rdpid overflow_recov succor smca  

Temperature

admin@ubuntu ~ % sensors  i350bb-pci-e500  Adapter: PCI adapter  loc1:         +48.0°C  (high = +120.0°C, crit = +110.0°C)  

+) When I change policy as a performance, It just affects cpuinfo_cur_freq, not scaling_cur_freq.

Fedora missing in grub after installation

Posted: 14 May 2022 12:02 PM PDT

I have installed fedora 36 for the first time (UEFI), and grub only shows the option to boot windows boot manager and fedora doesn't appear, I haven't tried out anything for now, because i don't know what's wrong, i have probably set all my partitions right, and did everything else right, also i can't boot in any other linux distribution because i only have windows and fedora, that i installed recently

how to kill all processes that run more than 1 minute?

Posted: 14 May 2022 10:58 AM PDT

We need to write a script. Which will terminate all processes running for more than 1 minute.

Trying to write a script to find ORF

Posted: 14 May 2022 12:15 PM PDT

I'm new to bash, and I found this script to identify ORF, the problem I have is that it gives me three results (ATGATGGATCCTTGCGTGCAGTAA, ATGGGATAA and ATGATGGATCCTTGCGTGCAGTAA) and not two as it should be (ATGATGGATCCTTGCGTGCAGTAA and ATGGATCCTTGCGTGCAGTAA).

## example sequence : TTAATGATGGATCCTTGCGTGCAGTAACCCATGGGA  #!/bin/bash  ## Read the sequence into the variable $seq  seq=$1  ## Check all three frames  for ((frame=0; frame<=3; frame++)); do  ## Read the sequence in groups of 3  for ((i=$frame;i<=${#seq};i+=3)); do  ## The codon: three nucleotides starting from the current position.  codon=${seq:i:3}  ## set isORF to 1 if this is an ATG  if [[ ${seq:i:3} = "ATG" ]]; then     isORF=1  fi  ## If we're in an ORF  if [[ $isORF = 1 ]]; then    ## Add this codon to the ORF's sequence    ORF="${ORF}${codon}"    ## Is this a STOP?    if [[ ${seq:i:3} = "TGA" ||          ${seq:i:3} = "TAA" ||          ${seq:i:3} = "TAG" ]];    then      ## Print the ORF      echo "ORF: $ORF"      ## Set isORF to 0 and empty the ORF variable to repeat the process      isORF=0      ORF=""    fi   fi   done  done  

`

/home/ibioic/atg.sh TTAATGATGGATCCTTGCGTGCAGTAACCCATGGGA  ##ORF: ATGATGGATCCTTGCGTGCAGTAA  ##ORF: ATGGGATAA  ##ORF: ATGATGGATCCTTGCGTGCAGTAA  

`

Arrange menu horizontally/detect arrow keys

Posted: 14 May 2022 10:05 AM PDT

I want to make a small game using bash script, The game, at the beginning provides 4 options for users to choose by using the four arrow keys such left, right, down, up.

ex)

1) Join   2) Sign in  3) Sign out  4) Exit  

How can I arrange 4 options above like

1) Join                 2) Sign in    3) Sign out             4) Exit    

and detects the user's arrow keys when in one of them?

replacement for tr with utf-8 capabilities

Posted: 14 May 2022 11:32 AM PDT

in order to isolate the last word in any line of a poem (to have a list of all rhymes), I put together several snippets of code obtaining this

awk '{print $NF}' input.txt | tr 'A-Z' 'a-z'  | tr -sc 'a-z' '\n' | rev |  sort | uniq | sort -d | rev  

applying it to poems like this:

Se a ciascun l'interno affanno  Si leggesse in fronte scritto  Quanti mai, che invidia fanno  Ci farebbero pietà!   

I get

fanno  affanno  scritto  piet  

As you can see, the word "pietà" lacks of accented character. I guess this depends from having not tr UTF-8 capabilities. Is there any replacement for tr able to perfprm the same task in this one liner, but retaining UTF-8 accented characters?

rsync include only subdirectory

Posted: 14 May 2022 12:28 PM PDT

at the moment I am struggling to find a solution to include only files in a subdirectory but exclude all other stuff. File structure looks like this

$ tree ../  ../  ├── from  │   ├── a  │   │   ├── aa  │   │   │   └── x.txt  │   │   ├── a.txt  │   │   └── b.txt  │   └── b  │       ├── b.txt  │       └── c.txt  └── to  

and only the stuff in a/aa/ shall be transferred into to/.

$ rsync -avh --include=a/aa/*** --exclude=* ../from/ ../to/  

does not work and to/ stays empty but doing this with a/

$ rsync -avh --include=a/*** --exclude=* ../from/ ../to/  

it works

$ tree ../  ..  ├── from  │   ├── a  │   │   ├── aa  │   │   │   └── x.txt  │   │   ├── a.txt  │   │   └── b.txt  │   └── b  │       ├── b.txt  │       └── c.txt  └── to      └── a          ├── aa          │   └── x.txt          ├── a.txt          └── b.txt  

but there a.txt and b.txt should not be there. What did I miss?

Thanks for your help.

unable to mount network share from fstab or in terminal

Posted: 14 May 2022 09:19 AM PDT

My laptop boots normally. But earlier this week, after some updates, it is unable to mount (fstab) network shares from my QNAP.

Other computers with the same fstab connect successfully. I checked the settings on the server, but nothing seems abnormal, and, as said, other computers do connect succesfully. I fiddled with some of the settings without succes

fstab has the following starightforward code:

192.168.2.73:/reviews /mnt/reviews nfs defaults 0 0

Here is some info about my system: Linux 5.13.0-41-generic #46~20.04.1-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux

I hope somebody can help out

Thanks in advance

shared library not found even if "export LD_LIBRARY_PATH" is set

Posted: 14 May 2022 09:16 AM PDT

Here comes a strange question. I have a QT App and it requires some libraries. Normally, the following bash script works:

#!/bin/bash   export LD_LIBRARY_PATH="./libs"  export QT_DEBUG_PLUGINS=1  ./dataUI "$@" #This is the name of the APP  

It works for my computer (Ubuntu 18), and in the WSL of my another device (Not equipped with QT IDE). However, as someone runs the script, the library files in the folder "./libs" cannot be found! (He uses Ubuntu 20 on WSL) The LD_LIBRARY_PATH does not seem to work. Any Hint on this problem?

Bad font antialiasing for Qt6 applications

Posted: 14 May 2022 10:53 AM PDT

Environment:

OS: Fedora 36
DE: XFCE
Font: Windows Tahoma
Font config
$XDG_CURRENT_DESKTOP=XFCE
Qt6-6.2.3-2.fc36

Problem: Qt6 applications seemingly do not use my fontconfig settings (which are used for everything else, including XFCE, GTK2/3/4 and Qt3/4/5 applications, and web browsers).

I've used strace -e file and $HOME/.config/fontconfig/fonts.conf is indeed being read but it's not seemingly used correctly.

I do not see any error messages in console from Qt6 applications.

I have a suspicion something in terms of fonts support in Qt6 has changed drastically but I haven't been able to find anything.

Here's how Qt5 applications look like.

Here's how Qt6 applications look like.

I've filed a bug report because I haven't been able to find anything relevant.

Grub Install With encrypted Boot partion

Posted: 14 May 2022 10:53 AM PDT

i am trying to do arch(or any distro)-install with encrypted boot partition(lvm - uefi) during installation i am trying really hard to get it to working but i get this error i searched a lot but i didn't get anywhere i believe it is possible because of this option (GRUB_ENABLE_CRYPTODISK=1) in grub config

Inside arch-chroot /mnt

How to pass a parameter in a command without run the parameter content?

Posted: 14 May 2022 10:15 AM PDT

Good days.

I have a little problem. I have this function in bash script

function denyCheck(){      file=$(readlink -f $(which $(printf "%s\n" "$1")))      if [[ -x $file ]];then             return false      else             return true      fi  }  denyCheck "firefox"  

This function I pass her a string, what is a comman, and this resolv the orginal path where is the command (by example: /usr/lib/firefox/firefox.sh) and if the file is executable return true else false.

But the problem is...The parameter (in the example "firefox") run it as command and open the browser firefox.

How can I do for that the parameter not run it?

Thank you very much.

XDMCP locally using Unix sockets

Posted: 14 May 2022 10:05 AM PDT

Is there any way to start a XDMCP session, say with Xephyr in LightDM, locally through Unix Sockets instead of IP?

For performance I was wondering if, somehow, I can avoid any network stack working with Xephyr and the XDMCP server in the same machine.

How to add column based in the second line match using SED or another command?

Posted: 14 May 2022 10:54 AM PDT

I have the following lines result from zcat command

1 - URL Template: https://www.test.com    2 - Response: <200 OK,{Server=[nginx], Date=[Wed, 11 May 2022 01:05:06 GMT], Content-Type=[text/html; charset=UTF-8], Transfer-Encoding=[chunked], Connection=[keep-alive], Vary=[Accept-Encoding]}>  

I want to add the line 2 result from call to first line 1 like this

URL Template: https://www.test.com <200 OK,{Server=[nginx], Date=[Wed, 11 May 2022 01:05:06 GMT], Content-Type=[text/html; charset=UTF-8], Transfer-Encoding=[chunked], Connection=[keep-alive], Vary=[Accept-Encoding]}>  

Can I do that?

How to merge arrays from multiple arrays in two JSON with JQ

Posted: 14 May 2022 09:19 AM PDT

I have two JSON files (file1.json and file2.json) with the following same structure as defined below with two array lists as shown below.

The first file is (file1.json):

{    "Lists1": [     {        "point": "a",        "coordinates": [          2289.48096,          2093.48096        ]     }    ],    "Lists2": [     {        "point": "b",        "coordinates": [          2289.48096,          2093.48096        ]     }   ]  }  

The second file is (file2.json):

{    "Lists1": [     {        "point": "c",        "coordinates": [          2289.48096,          2093.48096        ]     }    ],    "Lists2": [     {        "point": "d",        "coordinates": [          2289.48096,          2093.48096        ]     }   ]  }  

so my expected output will be:

{    "Lists1": [     {        "point": "a",        "coordinates": [          2289.48096,          2093.48096        ]     },     {        "point": "c",        "coordinates": [          2289.48096,          2093.48096        ]     }    ]    "Lists2": [     {        "point": "b",        "coordinates": [          2289.48096,          2093.48096        ]     },     {        "point": "d",        "coordinates": [          2289.48096,          2093.48096        ]     }   ]  }  

I am trying to merge (combine) these two files using jq. I found using the command below, but this only work with one list.

jq -n '{ list1: [ inputs.list1 ] | add }' file1.json file2.json  

Is there a way to modify this function to combine both list1 and list2?

How to let already copied files share fragments (reflink)?

Posted: 14 May 2022 10:24 AM PDT

I copy a file to a different XFS volume on daily basis as follows:

# on monday  cp --sparse=always /mnt/disk1/huge.file /mnt/disk2/monday/huge.file  # on tuesday  cp --sparse=always /mnt/disk1/huge.file /mnt/disk2/tuesday/huge.file  

Now it occupies the full size of both files on disk2.

On the same partition I would usually use --reflink=auto, so the copied file shares fragments and occupies only the changed blocks. But as this does not work if the destination is on a different volume, I need a solution to reflink two already existing copies.

Sadly cp does not copy only changed blocks like rsync (no reflink support) does, else I would do:

# on monday  cp --sparse=always /mnt/disk1/huge.file /mnt/disk2/huge.file  cp --reflink=always /mnt/disk2/huge.file /mnt/disk2/monday/huge.file  # on tuesday  cp --sparse=always /mnt/disk1/huge.file /mnt/disk2/huge.file  cp --reflink=always /mnt/disk2/huge.file /mnt/disk2/tuesday/huge.file  

How do I reduze the size of a video to a target size?

Posted: 14 May 2022 09:18 AM PDT

I want to reduce the size of a video to be able to send it via email and such. I looked at this question: How can I reduce a video's size with ffmpeg? where I got good advice on how to reduce it. Problem is that I need to manually calculate the bitrate. And also when doing this I had to finish of with manual trial and error.

Is there any good way to use ffmpeg (or another tool) to reduce the size of a video to a target size?

Note due to a comment from frostschutz:

Worrying too much about size and going for a fixed filesize regardless of video length / resolution / framerate / content will not give satisfactory results most of the time... Upload it somewhere, email the link. If you must encode it, set a quality level, leave the bitrate dynamic. If it's obvious that size will not be met, cancel the encode and adapt quality level accordingly. Rinse and repeat.

Good advice in general, but it does not suit my usecase. Uploading to an external link is not an option due to technical limitations, one of them being that the receiver does not have http access.

I could also clarify that I'm NOT looking for exactly the size I'm specifying. It's enough if it is reasonably close to what I want (maybe up to 5 or 10% lower or so) but it should be guaranteed that it will not exceed my target limit.

Echo with obfuscation

Posted: 14 May 2022 11:44 AM PDT

I need to print some variables to the screen but I need to preferebly obfuscate the first few characters and I was wondering if there was an echo command in bash that can obfuscate the first characters of a secret value while printing it to the terminal:

echo 'secretvalue'  ********lue  

find and replace with sed with slash in find and replace string

Posted: 14 May 2022 10:54 AM PDT

I want to change in file /var/www with /home/lokesh/www with sed command

sed -i 's///var//www///home//lokesh//www/g' lks.php  

but this give error

sed: couldn't open file ww///home//lokesh//www/g: No such file or directory  

Wrong inode: corrupted f2fs, fsck.f2fs cannot repair

Posted: 14 May 2022 10:00 AM PDT

A f2fs partition on my Android phone has recently become corrupted. It will still mount fine; however, I completely lost access to one directory (/data/media/0), which now shows as empty. Yet the disk space hasn't changed at all.

When running fsck.f2fs from the terminal, it refuses to check on a mounted filesystem. I cannot unmount the data partition or remount it as read-only. Fine. After rebooting under recovery mode, where the partition is not mounted, I get this when running fsck.f2fs:

~ # fsck.f2fs /dev/block/mmcblk0p39  Info: sector size = 512  Info: total sectors = 21425920 (in 512bytes)    Assertion failed!  [fsck_chk_dentry_blk: 563] le32_to_cpu(de_blk->dentry[i].hash_code) == hash_code  

So it still refuses to help me and it now fails with an obscure error… stating the directory gives me:

root@victara:/ # stat /data/media/0                                                File: `/data/media/0'    Size: 4096     Blocks: 24  IO Blocks: 4096    directory  Device: 10307h/66311d    Inode: 4    Links: 35  Access: (770/drwxrwx---)    Uid: (1023/media_rw)    Gid: (1023/media_rw)  Access: 2016-04-04 16:55:56.800148001  Modify: 2016-04-05 02:47:44.314999998  Change: 2016-04-05 02:47:44.314999998  

The inode (number?) seemed to be quite low… So I checked other directories:

root@victara:/ # stat /data/media/    File: '/data/media/'    Size: 4096        Blocks: 16         IO Block: 4096   directory  Device: 10307h/66311d   Inode: 4078        Links: 4      Access: (0770/drwxrwx---)  Uid: ( 1023/media_rw)   Gid: ( 1023/media_rw)  __bionic_open_tzdata: couldn't find any tzdata when looking for localtime!  __bionic_open_tzdata: couldn't find any tzdata when looking for GMT!  __bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!  Access: 2016-04-04 14:48:25.000000000  Modify: 1970-01-01 02:27:21.000000000  Change: 1970-02-07 02:30:36.000000000    root@victara:/ # stat /data/media/obb                                              File: `/data/media/obb'    Size: 4096     Blocks: 16  IO Blocks: 4096    directory  Device: 10307h/66311d    Inode: 4080     Links: 3  Access: (775/drwxrwxr-x)    Uid: (1023/media_rw)    Gid: (1023/media_rw)  Access: 1970-01-01 03:27:21.519999999  Modify: 2016-03-17 22:38:30.505748550  Change: 2016-04-04 17:42:31.569999988  

It looks like the parent dir (/data/media) has inode 4078, another child of the parent (/data/media/obb) has inode 4080. So, logically, /data/media/0 should have inode 4079, but stat tells me it has inode 4.

So it looks like the filesystem metadata got corrupted. Without help from fsck.f2fs and debugfs (which sadly doesn't exist for f2fs), and in a pretty minimal Linux environment (Android recovery), is there a way I can correct the inode number or something else I can do to recover access to my data?


Interestingly, the directory still seems to be taking up disk space, and it is considered as "not empty" so I cannot remove it.

root@victara:/data/media # rm -rf 0  rm: 0: Directory not empty  1|root@victara:/data/media # ls  0 obb   root@victara:/data/media # ls -al 0                                                                               total 0  

IMPORTANT: I cannot test solutions anymore since I need the phone and the storage space and reformatted the partition.

How to verify a file copy is reflink/CoW?

Posted: 14 May 2022 09:57 AM PDT

I'm playing with btrfs, which allows cp --reflink to copy-on-write. Other programs, such as lxc-clone, may use this feature as well. My question is, how to tell if a file is a CoW of another? Like for hardlink, I can tell from the inode number.

Directing old symbolic link to a different location

Posted: 14 May 2022 10:58 AM PDT

Example:

I created a symbolic link into my /usr/local/bin folder using

sudo ln -s ~/Desktop/package/Application/tool1  sudo ln -s ~/Desktop/package/Application/tool2  …  

I would like to move my Application folder (and all its tools) to /package/Application (basically outside the Users parent directory). Is it possible to have the original symbolic links point to its corresponding tool in its new location?

Sendmail issues "530 Authentication required" error message when authinfo is supplied

Posted: 14 May 2022 11:01 AM PDT

sender_email - email address that does not exist, but must be used as FROM address, because receiver host rejects emails from other emails.

receiver_email - email that is supposed to receive the sent message

local_smtp - SMTP server that is installed on another computer in the local network and forwards all received messages to external_smtp

external_smtp - SMTP server that is installed on a computer in another network and rejects all emails that do not come from sender_email

I have configured sendmail to send emails from sender_email and authenticate with user/password to local_smtp that is supposed to send the email message further to external_smtp that only accepts emails sent from a specific email, which is sender_email in this case. However, judging from the log files sendmail authenticates with external_smtp instead of local_smtp. I do not want to authenticate with external_smtp, because that is up to local_smtp.

logfile:

10745 <<< Subject: Terminal Email Send  10745 <<<  10745 <<< Email Content line 1  10745 <<< Email Content line 2  10745 <<< [EOF]  10759 === CONNECT local_smtp.  10759 <<< 220 **********************************************************************^M  10759 >>> EHLO mgmt-snmp  10759 <<< 250-local_smtp says hello^M  10759 <<< 250-AUTH LOGIN PLAIN^M  10759 <<< 250-VRFY^M  10759 <<< 250 8BITMIME^M  10759 >>> MAIL From:<sender_email> AUTH=sender_email  10759 <<< 530 authentication required^M  10759 >>> This is a MIME-encapsulated message  10759 >>>  10759 >>> --t8IEdmbX010759.1442587188/mgmt-snmp  10759 >>>  10759 >>> The original message was received at Fri, 18 Sep 2015 16:39:48 +0200  10759 >>> from root@localhost  10759 >>>  10759 >>>    ----- The following addresses had permanent fatal errors -----  10759 >>> receiver_email  10759 >>>     (reason: 530 authentication required)  10759 >>>  

I guess it has something to do with AUTH=sender_email, but I do not know how to change it.

sendmail.mc:

divert(-1)dnl  #-----------------------------------------------------------------------------  # $Sendmail: debproto.mc,v 8.14.4 2014-02-11 13:02:08 cowboy Exp $  #  # Copyright (c) 1998-2010 Richard Nelson.  All Rights Reserved.  #  # cf/debian/sendmail.mc.  Generated from sendmail.mc.in by configure.  #  # sendmail.mc prototype config file for building Sendmail 8.14.4  #  # Note: the .in file supports 8.7.6 - 9.0.0, but the generated  #   file is customized to the version noted above.  #  # This file is used to configure Sendmail for use with Debian systems.  #  # If you modify this file, you will have to regenerate /etc/mail/sendmail.cf  # by running this file through the m4 preprocessor via one of the following:  #   * make   (or make -C /etc/mail)  #   * sendmailconfig   #   * m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf  # The first two options are preferred as they will also update other files  # that depend upon the contents of this file.  #  # The best documentation for this .mc file is:  # /usr/share/doc/sendmail-doc/cf.README.gz  #  #-----------------------------------------------------------------------------  divert(0)dnl  #  #   Copyright (c) 1998-2005 Richard Nelson.  All Rights Reserved.  #  #  This file is used to configure Sendmail for use with Debian systems.  #  define(`_USE_ETC_MAIL_')dnl  include(`/usr/share/sendmail/cf/m4/cf.m4')dnl  VERSIONID(`$Id: sendmail.mc, v 8.14.4-4.1ubuntu1 2014-02-11 13:02:08 cowboy Exp $')  OSTYPE(`debian')dnl  DOMAIN(`debian-mta')dnl  dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE  undefine(`confHOST_STATUS_DIRECTORY')dnl        #DAEMON_HOSTSTATS=  dnl # Items controlled by /etc/mail/sendmail.conf - DO NOT TOUCH HERE  dnl #  dnl # General defines  dnl #  dnl # SAFE_FILE_ENV: [undefined] If set, sendmail will do a chroot()  dnl #   into this directory before writing files.  dnl #   If *all* your user accounts are under /home then use that  dnl #   instead - it will prevent any writes outside of /home !  dnl #   define(`confSAFE_FILE_ENV',             `')dnl  dnl #  dnl # Daemon options - restrict to servicing LOCALHOST ONLY !!!  dnl # Remove `, Addr=' clauses to receive from any interface  dnl # If you want to support IPv6, switch the commented/uncommentd lines  dnl #  FEATURE(`no_default_msa')dnl  dnl DAEMON_OPTIONS(`Family=inet6, Name=MTA-v6, Port=smtp, Addr=::1')dnl  DAEMON_OPTIONS(`Family=inet,  Name=MTA-v4, Port=smtp')dnl  dnl DAEMON_OPTIONS(`Family=inet6, Name=MSP-v6, Port=submission, M=Ea, Addr=::1')dnl  DAEMON_OPTIONS(`Family=inet,  Name=MSP-v4, Port=submission, M=Ea, Addr=127.0.0.1')dnl  dnl #  dnl # Be somewhat anal in what we allow  define(`confPRIVACY_FLAGS',dnl  `needmailhelo,needexpnhelo,needvrfyhelo,restrictqrun,restrictexpand,nobodyreturn,authwarnings')dnl  dnl #  dnl # Define connection throttling and window length  define(`confCONNECTION_RATE_THROTTLE', `15')dnl  define(`confCONNECTION_RATE_WINDOW_SIZE',`10m')dnl  dnl #  dnl # Features  dnl #  dnl # use /etc/mail/local-host-names  FEATURE(`use_cw_file')dnl  dnl #  dnl # The access db is the basis for most of sendmail's checking  FEATURE(`access_db', , `skip')dnl  dnl #  dnl # The greet_pause feature stops some automail bots - but check the  dnl # provided access db for details on excluding localhosts...  FEATURE(`greet_pause', `1000')dnl 1 seconds  dnl #  dnl # Delay_checks allows sender<->recipient checking  FEATURE(`delay_checks', `friend', `n')dnl  dnl #  dnl # If we get too many bad recipients, slow things down...  define(`confBAD_RCPT_THROTTLE',`3')dnl  dnl #  dnl # Stop connections that overflow our concurrent and time connection rates  FEATURE(`conncontrol', `nodelay', `terminate')dnl  FEATURE(`ratecontrol', `nodelay', `terminate')dnl  dnl #  dnl # If you're on a dialup link, you should enable this - so sendmail  dnl # will not bring up the link (it will queue mail for later)  dnl define(`confCON_EXPENSIVE',`True')dnl  dnl #  dnl # Dialup/LAN connection overrides  dnl #  include(`/etc/mail/m4/dialup.m4')dnl  include(`/etc/mail/m4/provider.m4')dnl    dnl LOCAL_CONFIG  dnl EXPOSED_USER(root uucp)dnl # users exempt from masquerading  dnl LOCAL_USER(root)dnl  dnl MASQUERADE_AS(`external_smtp')dnl  dnl FEATURE(`allmasquerade')dnl  dnl FEATURE(`masquerade_envelope')dnl  dnl FEATURE(`nullclient', local_smtp)dnl    LOCAL_CONFIG  ## Custom configurations below (will be preserved)  define(`SMART_HOST', `local_smtp')dnl  define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl  FEATURE(`authinfo', `hash /etc/mail/authinfo')dnl  define(`RELAY_MAILER_ARGS', `TCP $h 25')dnl  dnl #  dnl # Default Mailer setup  MAILER_DEFINITIONS  MAILER(`local')dnl  MAILER(`smtp')dnl  

authinfo:

AuthInfo:local_smtp "U:root" "I:my_username" "P:my_password"  

General problem solving steps when print jobs hang in AIX?

Posted: 14 May 2022 12:06 PM PDT

What should I do if jobs are getting stuck in the print queue even after restarting spooling?

$ stopsrc -g spooler  $ startsrc -g spooler  $ lpstat -oQUEUENAME | wc -l; sleep 30; lpstat -oQUEUENAME | wc -l  139  139    $ oslevel  6.1.0.0  

No comments:

Post a Comment