Monday, July 5, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


How to check Processor Generation?

Posted: 05 Jul 2021 09:52 AM PDT

I was trying to exchange my laptop in an online site and i need to provide them my processor generation. They have shown how to check that in windows machine but i'm using a linux machine. How to check my processor generation in linux?

how to create a project having following dependencies?

Posted: 05 Jul 2021 09:48 AM PDT

enter image description herethe concept of make file and make command should be used as much as I know. kindly give some hints.

Linux Mint 20.1 : No wireless internet connection option

Posted: 05 Jul 2021 09:30 AM PDT

I installed Linux Mint and connected the PC to my wifi network without problems. I updated drivers, rebooted and now there is no option to connect to wireless connections, I mean, I left-click the icon on the task bar and only "Wired" option appears.

If I open "Driver Manager", no drivers about wireless connection appear, only about NVIDIA graphic card

I've already tried (Linux Mint-17) Unable to connect to wireless network make command says make: *** No rule to make target 'clean'. Stop.

Operating System Linux Mint 20.1 Cinnamon Cinamon Version 4.8.6 Linux Kernel 5.4.0-74-generic Processor Intel© Core™ i5-8300H CPU @ 2.30GHz × 4 Memory 15.5 GiB Hard Drives 1756.4 GB Graphics Card Intel Corporation UHD Graphics 630 (Mobile) (prog-if 00 [VGA controller])

Bash Script copy each zip file which is listed in a Text file to another folder and zip this folder

Posted: 05 Jul 2021 09:50 AM PDT

Hello i have some trouble to get a script working. Here are my requirements what i want to do

  1. I have a folder with zip files and the amount can be larger than 5000 for example 12000 or lesser than 5000.

    1. Now i have to copy each zip file in this folder to a destination folder and the amount of zip files should not be greather than 5000 but can be lower than 5000.

    2. After a zip file was copied the should be removed in cas that i can not be copied twice.

    3. In the Sourcefolder are permanently incoming zip files.

The Problem is now the loop doesnt work he does copy only 1 file and loops trough this 5000 times.

Can one of you support me or point me to the correct path :) what am i doing wrong?

Here is my code:

    cd $src      ls -d $PWD/* >> $src/filelist.txt      LINES=`cat $src/filelist.txt`      COUNTER=0            for i in $LINES; do          until [ $counter -gt 5000 ]; do              cp $i $workdir              let "counter+=1"              echo $counter          done      done  

regards chrootENV

How read file paths mentioned in a text file inside a Korn shell script?

Posted: 05 Jul 2021 08:42 AM PDT

I am writing a script to read multiple log files and find lines with a specific string. However I am getting an error when trying to egrep/grep on the file.

I have a file that has the names of the log files to read (see below)

files.txt

./code_a.log  ./code_b.log  

log_analysis.ksh

#!/bin/ksh    platform=$1  lw_platform=$(echo "$platform" | tr '[:upper:]' '[:lower:]')  log_dir="/project/$lw_platform/logs/"  read_file="/user/LogAnalysis/files.txt"  out_file="/user/LogAnalysis/out3.txt"    echo $lw_platform  echo $log_dir    while -r line; do        echo "Began: $line" >> $out_file        cd ${log_dir}        egrep -n 'ERROR:' $line >> $out_file        echo "End: $line" >> $out_file    done < $read_file  

ERROR

.grep: 0652-033 Cannot open ./code_a.log

However I don't get this error if I run the same egrep command directly into the shell. Proves that I have the permissions to read the file.

How to ovewrite plugins configuration with user configuration?

Posted: 05 Jul 2021 08:28 AM PDT

I'd like to use tmux-pain-control but I have C-h set to move window right, and since tpm says it needs to go at the very bottom of the configuration file, the plugins always overwrite my configuration.

How can I make it so I can overwrite the plugin configuration?

Why does this disk img mount only though a CDROM block device?

Posted: 05 Jul 2021 08:40 AM PDT

I've created a disk image (not just a partition) of an SD card using dd. It contains one ext4 partition.

I've been trying to mount this img on Debian via a loopback mount, but it refuses to detect and mount the ext4 that is contained in it.

The only way I was able to mount it was through a VM where I attached this img file to the CDROM device. After which I was able to mount it through the CDROM block device (/dev/sr0)

mounting attempts

Attempting to mount after doing a losetup:

losetup

What gives?

Try to mount SMB share on NAS and get "Operation not supported"

Posted: 05 Jul 2021 08:08 AM PDT

I have several Synology NAS, running DSM 6.2.2-24922 Update 5, which I successfully mount on Ubuntu 18.04 with:

sudo mount -t cifs //192.168.x.y/folder_name -o username=user,password=???????,uid=1000,sec=ntlm,vers=1.0 /local_mount_point  

I have bought a new one, which is running DSM 6.2.4-25556. I attempt to mount in the same way and I get this error:

mount: /local_mount_point: mount(2) system call failed: Operation not supported.  

Enable SMB Share is enabled on the new NAS, with the same settings as the others.

Can anyone advise?

Unix shell script to filter the log result based on time and status

Posted: 05 Jul 2021 08:01 AM PDT

Suggest a script or a command, which will pick log entries recorded from the time 11:30:40 to 12:10:20 inclusively and write to console only those, which are related to 'accepted' invoices?

Given : Log entries- billNo, customerName, Company, Amount, Status(accepted/declined).

Example

[INFO ] 2020-06-02 11:40:26.145 [main] [Server Logger] – Customer1 has uploaded an invoice for company 'ABCD'. Amount = 100$. State: declined

[INFO ] 2020-06-02 14:35:58.332 [main] [Server Logger] – Customer2 has uploaded an invoice for company 'EFGH'. Amount = 11$ . State: accepted

[INFO ] 2020-05-12 11:52:26.145 [main] [Server Logger] - Customer3 has uploaded an invoice for company ''. Amount = 30$. State: accepte

[INFO ] 2020-05-12 12:00:26.145 [main] [Server Logger] – Customer4 has uploaded an invoice for company 'ASWE'. Amount = 500$. State: declined

[INFO ] 2020-05-12 13:40:26.145 [main] [Server Logger] – Customer5 has uploaded an invoice for company 'FDFDF'. Amount = 80$. State: declined

Test if a command's output is an empty string and print its results if its not empty

Posted: 05 Jul 2021 08:06 AM PDT

I am using solutions from Test if a command outputs an empty string. In addition to those solutions, I want to print command's output if its not empty.

I was wondering would it be possible to print command's output if its not empty by calling the command only one time.

I can do it by re-calling the same command inside the if condition, but now second call may consume additional CPU usage, since we already obtained its result.


Possible approach could be, where the same command is called two times:

if [[ $(ls -A) ]]; then      ls -A  else      echo "no files found"  fi  

output=$(git diff --ignore-blank-lines --color-words HEAD | tr -d ' \n\r\t ' | wc -c)  if [ "$output" -gt 0 ]; then      git diff --ignore-blank-lines --color-words HEAD   else      echo "diff is empty"  fi  

Sleep while process uses more than n% CPU

Posted: 05 Jul 2021 07:37 AM PDT

I am on macOS. I want to write a bash script which pauses for 0.5 seconds (i.e. sleeps) while a certain process (which I know by command name only) uses more than, say 5% CPU. I could

pgrep command_name

and then

ps -p PID -o %cpu | tail -1 | cut -c 3-5

to get the CPU usage and use this number in a while loop. Can this be done more elegantly (ideally in one line of code)?

Application that logs the program executed

Posted: 05 Jul 2021 07:25 AM PDT

I am new to Linux. I have installed mx Linux 19.I wanted to know availability of any software application that logs the cpu activity similar to the one seen while disabling quite splash for debugging purpose to know execution history and status of programs by the OS.

How to sort uniq values from a text file?

Posted: 05 Jul 2021 10:00 AM PDT

I have a text file as shown below:

A f1  B f2  A f3  B f4  B f5  

I want to sort it based on first column values and keep it in separate files.

Desired output:

A.txt:

A f1   A f3  

B.txt:

B f2  B f4  B f5  

Tried it with uniq but it's not working. Edit: I am not able to post the desired way the txt file and output file should be, but it should one below in next lines

Cannot build kgdboe against kernel headers

Posted: 05 Jul 2021 07:13 AM PDT

I am trying to build kgdboe according to the following tutorial. I am running Ubuntu 20.04 with an updated kernel 5.9.0 as I needed a driver which was not available in stock kernel. I updated the kernel by downloading the headers, modules and kernel image .deb packages and installing them manually. My uname -r output is 5.9.0-050900-generic. When I try to build the module with make -C /lib/modules/$(uname -r)/build M=$(pwd), I get the error:

ERROR: modpost: "__module_address" [/home/ipc/Downloads/kgdboe/kgdboe.ko] undefined!  

I have also manually downloaded complete Linux kernel source tree from GIT and checked out 5.9.0. If I make this module with path in make command pointing to the full source tree, the module buids. But since the module magic version and uname -r output doesn't match, I am unable to insert the module even with modprobe -f.

My question is, why am I not able to build with only the linux headers? Am I missing some step that prepares the headers folder for building modules? I am trying to find a way of building this module against the kernel headers or if I could update the version magic of built module (5.9.0) to uname -r output.

How to redirect ls output into `less -R` if the output size is large

Posted: 05 Jul 2021 08:03 AM PDT

If the count of ls output is more than 20 could it be redirected into less -R, in order the keep the bash clean. If its less than 20, the output could printed into the terminal.

When I do ls for example in /home/user/ folder and if there over 200 files all their names are printed out into the terminal.

In case if its over 200, or based on the height of the terminal, somehow can we redirect the results into less -R and let after pressing q in less keep the terminal clean.

I have tried following solution but right after I press q in less the printed outputs remain in the terminal.


my setup:

export PAGER="less"  export LESS="-iR -j4 --shift 5 -P ?n?f%f .?m(file %i of %m) ..?ltlines %lt-%lb?L/%L. :byte %bB?s/%s. .?e(END) ?x- Next\: %x.:?pB%pB\%..%t"    function ls {      output=$(command ls -h --color=always -v --author --time-style=long-iso -C | wc -l)      if [ $output -gt 20 ]; then          command ls -h --color=always -v --author --time-style=long-iso -C "$@" | less -R      else          command ls -h --color=always -v --author --time-style=long-iso -C "$@" | less -R -F -X      fi  }    alias ls='ls -h --color=always -v --author --time-style=long-iso'  

keystroke in x11 cannot be repeated onpress

Posted: 05 Jul 2021 06:18 AM PDT

I am using nixOS on a 2017 Macbook pro, and I want to use a tiling window manager for my workflow. The keyboard is working normally in console, which can repeat keypress when I hold the button. But when I start x11 and use a display manager(tried lightdm and gdm) and a window manager (tried i3, xmonad, leftwm), my keystroke there cannot be repeated on hold.

I have been searching around, yet I can barely found clue showing me whats wrong. This is the result of xset -q

enter image description here

How to logging IP address with firewalld SNAT?

Posted: 05 Jul 2021 06:22 AM PDT

I try to setting up SNAT with firewalld on my CentOS 8 PC to make NAT router like below.

Users access to the Web Server via CentOS8.

[UserPC]---(192.168.0.0/24)---[CentOS 8]---(10.0.0.0/24)---[Web Server]  

I want to logging 4 IP addresses at a line, like a firewall appliance.

  1. UserPC
  2. Web Server
  3. UserPC (After NAT)
  4. Web Server (After NAT,but I don't use DNAT in this case.)

I found the 1.UserPC and 2.WebServer in the /var/log/firewall file. But I can't logging "3.UserPC(After NAT)" and "4.Web Server(After NAT)".

My CentOS8 PC has 2 NICs.

  • Internal I/F : 192.168.0.1/24
  • External I/F : 10.0.0.1/24 , 10.0.0.2/24 , 10.0.0.3/24 (3 IPaddresses)

Here are my firewall-cmd rules.

ipv4 filter FORWARD 0 -i <Internal I/F> -o <External I/F> -j ACCEPT  ipv4 filter FORWARD 0 -m tcp -p tcp -j LOG --log-prefix 'FORWARD LOG:'  ipv4 filter FORWARD 0 -i <External I/F> -o <Internal I/F> -m state --state RELATED,ESTABLISHED -j ACCEPT  ipv4 nat PREROUTING 0 -m tcp -p tcp -j LOG --log-prefix 'PREROUTING LOG:'  ipv4 nat POSTROUTING 0 -s 192.168.0.0/24 -o <External I/F> -j SNAT --to-source 10.0.0.3  ipv4 nat POSTROUTING 0 -m tcp -p tcp -j LOG --log-prefix 'POSTROUTING LOG:'  ipv4 nat OUTPUT 0 -m tcp -p tcp -j LOG --log-prefix 'OUTPUT LOG:'  

I checked the access.log in the WebServer, source IP address is "10.0.0.3". I wonder the order of firewalld rules is not good, I changed the rules order. But it does not work well.

Next I checked nft list ruleset, I found the rules below.

table ip nat {      chain PREROUTING{          blahblahblah      }      chain INPUT{          blahblahblah      }      chain POSTROUTING{          type nat hoook postrouting priority srcnat; policy accept;          oifname "External I/F" ip saddr 192.168.0.0/24 counter packets 2 bytes 120 snat to 10.0.0.1          meta l4proto tcp counter packets 100 bytes 0 log prefix "POSTROUTING LOG:"      }  }  

I think I need to add some statements or keyword or something. How and what do I have to add to this meta line? And is my thought correct ?

I would be grateful if anyone could tell me. Thank you.

Regular expression for a string

Posted: 05 Jul 2021 09:44 AM PDT

Hi I have a md file containing the below string and I want to write a regular expression for this.

Conditions

  1. The id will be anything.
  2. The type will be youtube,vimeo etc
  3. ID and type are mandatory fields
{% include video.html id="T3q6QcCQZQg" type="youtube" %}  

So I want to check the string is in a proper format in bash script otherwise will through an error.

Current code look like this . The below code is working for me without an ID. But I need to add a regex for id as well

IFS=$'\n' read -r -d '' -a VIDEOS < <( grep  "video.html"  "$ROOT_DIR$file" && printf '\0' )    #output => {% include video.html id="T3q6QcCQZQg" type="youtube" %}    for str in "${VIDEOS[@]}"      do           if [[ "$str" =~ ({%)[[:space:]](include)[[:space:]](video.html)[[:space:]](type="youtube"|type="vimeo")[[:space:]](%})$ ]]; then              flag="dummy"              echo "Invalid format::  $second"          fi  done  

Please help

grep/awk for matching both strings

Posted: 05 Jul 2021 08:59 AM PDT

I need to use an if statement that is true only if "is loaded" AND "is running" occur in a service status command output:

$groupservice status  service 1 is loaded  service 2 is running   

As already mentioned I've tried to use this:

$service status | awk '/is loaded/ && /is running/'  

but I dont' get any output. The only way to run it is in this way:

if [[ $(service status | grep "is loaded") ]]  && [[ $(service status | grep "is running") ]]  

but I'd prefer to use a shorter expression. Where am I wrong? thank you

PAM unable to dlopen(sensepam.so): /lib/security/sensepam.so: undefined symbol: OPENSSL_init_crypto

Posted: 05 Jul 2021 08:49 AM PDT

I'm write a linux pam authentication module with c programming under ubuntu.My idea is when login input username and password that compare with web server saved username and password, if they are the same,then you can get into system,or you can't enter system.

Because web server is like https://xxxxxxxxx.com , so I write c code with openssl, my c code(sensepam.c) is like this:

#include <stdio.h>  #include <stdlib.h>  #include <unistd.h> /* read, write, close */  #include <string.h>  #include <security/pam_appl.h>  #include <security/pam_modules.h>  #include <security/pam_ext.h>    #include <sys/socket.h> /* socket, connect */  #include <netinet/in.h> /* struct sockaddr_in, struct sockaddr */  #include <netdb.h> /* struct hostent, gethostbyname */  #include <arpa/inet.h>  #include <openssl/crypto.h>  #include <openssl/x509.h>  #include <openssl/pem.h>  #include <openssl/ssl.h>  #include <openssl/err.h>    void error(const char *msg) { perror(msg); exit(0); }    int sendreq(pam_handle_t *pamh, int argc, const char *uname, const char *pwd)  {      int i;      pam_syslog(pamh, 5, "********into  sendreq******");        /* first where are we going to send it? */      int portno = 1234;      char *host = "xxxxxxx.com";      char *method = "GET";      char *path = "/authModule/authenticate";      char *header = "Host:xxxxxxx.com:1234";      char body[1024];      char* test_ok = "aaaaaaa";      SSL *ssl = NULL;      int OK_status = 0;      X509 *server_cert;      char* str = NULL;      int err;      char querystring[1024];      //int argc = 6;      int ret = 0;        struct hostent *server;      struct sockaddr_in serv_addr;      struct in_addr ip;      SSL_CTX *ctx = NULL;      int sockfd, bytes, sent, received, total, message_size;      const SSL_METHOD *client_method;      char *message, response[4096];        if (argc < 5) { puts("Parameters: <host> <port> <method> <path> [<data> [<headers>]]"); exit(0); }                  memset(querystring,0,1024);      strcat(querystring,"username=");      strcat(querystring,uname);      strcat(querystring,"&password=");      strcat(querystring,pwd);      strcat(querystring,"&reamId=1024");      printf("querystring is %s-%d", querystring, strlen(querystring));              SSL_library_init();      ERR_load_crypto_strings();      SSL_load_error_strings();      OpenSSL_add_all_algorithms();        client_method = SSLv23_client_method( );      ctx = SSL_CTX_new(client_method);      if (!ctx) {          fprintf (stderr, "SSL_CTX_new failed:\n");          ERR_print_errors_fp (stderr);          return 0;      }           server = gethostbyname(host);      if (server == NULL) error("ERROR, no such host");        bcopy(server->h_addr, &(ip.s_addr), server->h_length);              sockfd = socket(AF_INET, SOCK_STREAM, 0);      memset(&serv_addr, '\0', sizeof(serv_addr));      serv_addr.sin_family = AF_INET;      serv_addr.sin_port = htons(portno);       memcpy(&(serv_addr.sin_addr.s_addr),              server->h_addr, server->h_length);      err = connect(sockfd, (struct sockaddr*) &serv_addr,                   sizeof(serv_addr));      if (err < 0) { perror("can't connect to server port"); exit(1); }         ssl = SSL_new(ctx);       if (!ssl) {          fprintf (stderr, "SSL_new failed:\n");          ERR_print_errors_fp (stderr);          return 0;      }        SSL_set_fd(ssl, sockfd);       err = SSL_connect(ssl);         server_cert = SSL_get_peer_certificate(ssl);      printf("(6) server's certificate was received:\n\n");      str = X509_NAME_oneline(X509_get_subject_name(server_cert), 0, 0);      printf(" subject: %s\n", str);      str = X509_NAME_oneline(X509_get_issuer_name(server_cert), 0, 0);      printf(" issuer: %s\n\n", str);        X509_free(server_cert);          /* How big is the message? */      message_size=0;      if(!strcmp(method,"GET"))      {          message_size+=strlen("%s %s%s%s HTTP/1.0\r\n");        /* method         */          message_size+=strlen(path);                            /* path           */          message_size+=strlen(header);                          /* headers        */          if(argc>5)              message_size+=strlen(querystring);                 /* query string   */          for(i=6;i<argc;i++)                                    /* headers        */              message_size+=strlen(header)+strlen("\r\n");          message_size+=strlen("\r\n");                          /* blank line     */      }      else      {          message_size+=strlen("%s %s HTTP/1.0\r\n");          message_size+=strlen(method);                         /* method         */          message_size+=strlen(path);                         /* path           */          for(i=6;i<argc;i++)                                    /* headers        */              message_size+=strlen(header)+strlen("\r\n");          if(argc>5)              message_size+=strlen("Content-Length: %d\r\n")+10; /* content length */          message_size+=strlen("\r\n");                          /* blank line     */          if(argc>5)              message_size+=strlen(body);                     /* body           */      }        /* allocate space for the message */      message=malloc(message_size);        /* fill in the parameters */      if(!strcmp(method,"GET"))      {          if(argc>5)              sprintf(message,"%s %s%s%s HTTP/1.0\r\n",                  strlen(method)>0?method:"GET",               /* method         */                  strlen(path)>0?path:"/",                 /* path           */                  strlen(querystring)>0?"?":"",                      /* ?              */                  strlen(querystring)>0?querystring:"");                 /* query string   */          else              sprintf(message,"%s %s HTTP/1.0\r\n",                  strlen(method)>0?method:"GET",               /* method         */                  strlen(path)>0?path:"/");                /* path           */          //for(i=6;i<argc;i++)                                    /* headers        */          {strcat(message,header);strcat(message,"\r\n");}          strcat(message,"\r\n");                                /* blank line     */            pam_syslog(pamh, 5, message);      }      else      {          sprintf(message,"%s %s HTTP/1.0\r\n",              strlen(method)>0?method:"POST",                  /* method         */              strlen(path)>0?path:"/");                    /* path           */          //for(i=6;i<argc;i++)                                    /* headers        */          //    {strcat(message,argv[i]);strcat(message,"\r\n");}          //if(argc>5)          //    sprintf(message+strlen(message),"Content-Length: %d\r\n",strlen(argv[5]));          strcat(message,"\r\n");                                /* blank line     */          //if(argc>5)          //    strcat(message,argv[5]);                           /* body           */      }        /* What are we going to send? */      printf("Request:\n%s\n",message);        /* create the socket */      sockfd = socket(AF_INET, SOCK_STREAM, 0);      if (sockfd < 0) error("ERROR opening socket");        /* lookup the ip address */      server = gethostbyname(host);      if (server == NULL) error("ERROR, no such host");        /* fill in the structure */      memset(&serv_addr,0,sizeof(serv_addr));      serv_addr.sin_family = AF_INET;      serv_addr.sin_port = htons(portno);      memcpy(&serv_addr.sin_addr.s_addr,server->h_addr,server->h_length);        /* connect the socket */      if (connect(sockfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0)          error("ERROR connecting");      /* send the request */      total = strlen(message);      sent = 0;      do {          bytes = SSL_write(ssl,message+sent,total-sent);           if (bytes < 0)              error("ERROR writing message to socket");          if (bytes == 0)              break;          sent+=bytes;      } while (sent < total);        shutdown (sockfd, 1); /* send EOF to server */        pam_syslog(pamh, 5, response);      memset(response,0,sizeof(response));      total = sizeof(response)-1;      received = 0;      do {          bytes = SSL_read(ssl,response+received,total-received);          if (bytes < 0)              error("ERROR reading response from socket");          if (bytes == 0)              break;          received+=bytes;      } while (bytes > 0);      printf("Response:\n%s\n",response);           SSL_shutdown(ssl);      close(sockfd);      SSL_free(ssl);      SSL_CTX_free(ctx);         }    PAM_EXTERN int pam_sm_setcred( pam_handle_t *pamh, int flags, int argc, const char **argv ) {          return PAM_SUCCESS;  }    PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc, const char **argv) {          printf("Acct mgmt\n");          return PAM_SUCCESS;  }    PAM_EXTERN int pam_sm_authenticate( pam_handle_t *pamh, int flags,int argc, const char **argv ) {          int retval;            const char* pUsername;          const char* pPassword;          char cmd[255];          memset(cmd, 0, 255);            retval = pam_get_user(pamh, &pUsername, "Username: ");            printf("Welcome %s\n", pUsername);            if (retval != PAM_SUCCESS) {                  return retval;          }            retval = pam_get_authtok(pamh, PAM_AUTHTOK, &pPassword , NULL);            pam_syslog(pamh, 5, "mypam.so login");          pam_syslog(pamh, 5, pUsername);          pam_syslog(pamh, 5, pPassword);              if (!sendreq(pamh, 6, pUsername, pPassword)) {                  return PAM_AUTH_ERR;          }            pam_syslog(pamh, 5, "add user...");          sprintf(cmd,"useradd -m %s",pUsername);          system(cmd);            return PAM_SUCCESS;  }    int main(int argc, char *argv[])  {      char *uname="aaaaa";      char *pwd="123";      sendreq(NULL, 6, uname, pwd);  }  

my gdm-password is like below:

aaa@ubuntu:/etc/pam.d$  cat gdm-password   auth sufficient sensepam.so  account sufficient sensepam.so    #%PAM-1.0  auth    requisite       pam_nologin.so  auth    required    pam_succeed_if.so user != root quiet_success  @include common-auth  auth    optional        pam_gnome_keyring.so  @include common-account  # SELinux needs to be the first session rule. This ensures that any   # lingering context has been cleared. Without this it is possible   # that a module could execute code in the wrong domain.  session [success=ok ignore=ignore module_unknown=ignore default=bad]        pam_selinux.so close  session required        pam_loginuid.so  # SELinux needs to intervene at login time to ensure that the process  # starts in the proper default security context. Only sessions which are  # intended to run in the user's context should be run after this.  # pam_selinux.so changes the SELinux context of the used TTY and configures  # SELinux in order to transition to the user context with the next execve()  # call.  session [success=ok ignore=ignore module_unknown=ignore default=bad]        pam_selinux.so open  session optional        pam_keyinit.so force revoke  session required        pam_limits.so  session required        pam_env.so readenv=1  session required        pam_env.so readenv=1 user_readenv=1 envfile=/etc/default/locale  @include common-session  session optional        pam_gnome_keyring.so auto_start  @include common-password    

my system infomation is like below:

aaa@ubuntu:~$  uname -a  Linux ubuntu 5.8.0-59-generic #66~20.04.1-Ubuntu SMP Thu Jun 17 11:14:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux  

I have installed openssl :

aaa@ubuntu:~$  openssl version -a  OpenSSL 1.1.1k  25 Mar 2021  built on: Fri Jul  2 10:45:57 2021 UTC  platform: linux-x86_64  options:  bn(64,64) rc4(16x,int) des(int) idea(int) blowfish(ptr)   compiler: gcc -fPIC -pthread -m64 -Wa,--noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM -DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DNDEBUG  OPENSSLDIR: "/usr/local/ssl"  ENGINESDIR: "/usr/local/lib/engines-1.1"  Seeding source: os-specific    

I use below command to compile:

#!/bin/bash    gcc -fPIC -fno-stack-protector -c src/sensepam.c -lssl -lcrypto    sudo ld -x --shared -o /usr/lib/x86_64-linux-gnu/security/sensepam.so  sensepam.o    rm sensepam.o  

But when I try to login system,it can't work,so I view the log at /var/log/auth.log

  Jul  5 15:50:54 ubuntu systemd-logind[644]: System is rebooting.  Jul  5 15:51:03 ubuntu systemd-logind[646]: New seat seat0.  Jul  5 15:51:03 ubuntu systemd-logind[646]: Watching system buttons on /dev/input/event0 (Power Button)  Jul  5 15:51:03 ubuntu systemd-logind[646]: Watching system buttons on /dev/input/event1 (Sleep Button)  Jul  5 15:51:03 ubuntu systemd-logind[646]: Watching system buttons on /dev/input/event2 (AT Translated Set 2 keyboard)  Jul  5 15:51:03 ubuntu gdm-launch-environment]: pam_unix(gdm-launch-environment:session): session opened for user gdm by (uid=0)  Jul  5 15:51:03 ubuntu systemd-logind[646]: New session c1 of user gdm.  Jul  5 15:51:04 ubuntu systemd: pam_unix(systemd-user:session): session opened for user gdm by (uid=0)  Jul  5 15:51:04 ubuntu su: (to aaa) root on none  Jul  5 15:51:04 ubuntu su: pam_unix(su:session): session opened for user aaa by (uid=0)  Jul  5 15:51:04 ubuntu systemd: pam_unix(systemd-user:session): session opened for user aaa by (uid=0)  Jul  5 15:51:04 ubuntu su: pam_unix(su:session): session closed for user aaa  Jul  5 15:51:06 ubuntu polkitd(authority=local): Registered Authentication Agent for unix-session:c1 (system bus name :1.71 [/usr/bin/gnome-shell], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)  Jul  5 15:51:12 ubuntu gdm-password]: PAM unable to dlopen(sensepam.so): /lib/security/sensepam.so: undefined symbol: OPENSSL_init_crypto  Jul  5 15:51:12 ubuntu gdm-password]: PAM adding faulty module: sensepam.so  Jul  5 15:51:12 ubuntu gdm-password]: pam_unix(gdm-password:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 15:51:14 ubuntu systemd: pam_unix(systemd-user:session): session closed for user aaa  Jul  5 15:51:15 ubuntu gdm-password]: pam_unix(gdm-password:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 15:51:15 ubuntu gdm-password]: pam_unix(gdm-password:auth): authentication failure; logname= uid=0 euid=0 tty=/dev/tty1 ruser= rhost=  user=uos001  Jul  5 15:51:19 ubuntu gdm-password]: PAM unable to dlopen(sensepam.so): /lib/security/sensepam.so: undefined symbol: OPENSSL_init_crypto  Jul  5 15:51:19 ubuntu gdm-password]: PAM adding faulty module: sensepam.so  Jul  5 15:51:19 ubuntu gdm-password]: pam_unix(gdm-password:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 15:51:22 ubuntu gdm-password]: pam_unix(gdm-password:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 15:51:22 ubuntu gdm-password]: gkr-pam: unable to locate daemon control file  Jul  5 15:51:22 ubuntu gdm-password]: gkr-pam: stashed password to try later in open session  Jul  5 15:51:22 ubuntu gdm-password]: pam_unix(gdm-password:session): session opened for user aaa by (uid=0)  Jul  5 15:51:22 ubuntu systemd-logind[646]: New session 3 of user aaa.  Jul  5 15:51:22 ubuntu systemd: pam_unix(systemd-user:session): session opened for user aaa by (uid=0)  Jul  5 15:51:22 ubuntu gdm-password]: gkr-pam: gnome-keyring-daemon started properly and unlocked keyring  Jul  5 15:51:23 ubuntu gnome-keyring-daemon[1830]: The Secret Service was already initialized  Jul  5 15:51:23 ubuntu gnome-keyring-daemon[1830]: The PKCS#11 component was already initialized  Jul  5 15:51:24 ubuntu polkitd(authority=local): Registered Authentication Agent for unix-session:3 (system bus name :1.142 [/usr/bin/gnome-shell], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)  Jul  5 15:51:27 ubuntu gdm-launch-environment]: pam_unix(gdm-launch-environment:session): session closed for user gdm  Jul  5 15:51:27 ubuntu systemd-logind[646]: Session c1 logged out. Waiting for processes to exit.  Jul  5 15:51:27 ubuntu systemd-logind[646]: Removed session c1.  Jul  5 15:51:27 ubuntu polkitd(authority=local): Unregistered Authentication Agent for unix-session:c1 (system bus name :1.71, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)  Jul  5 15:51:29 ubuntu dbus-daemon[608]: [system] Failed to activate service 'org.bluez': timed out (service_start_timeout=25000ms)  Jul  5 15:51:38 ubuntu systemd: pam_unix(systemd-user:session): session closed for user gdm  Jul  5 15:51:39 ubuntu sudo: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 15:51:41 ubuntu sudo: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 15:51:41 ubuntu sudo:      aaa : TTY=pts/0 ; PWD=/var/log ; USER=root ; COMMAND=/usr/bin/su  Jul  5 15:51:41 ubuntu sudo: pam_unix(sudo:session): session opened for user root by (uid=0)  Jul  5 15:51:41 ubuntu su: (to root) aaa on pts/0  Jul  5 15:51:41 ubuntu su: pam_unix(su:session): session opened for user root by (uid=0)  Jul  5 15:57:28 ubuntu sudo: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 15:57:32 ubuntu sudo: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 15:57:32 ubuntu sudo: pam_unix(sudo:auth): authentication failure; logname= uid=1000 euid=0 tty=/dev/pts/1 ruser=aaa rhost=  user=aaa  Jul  5 15:57:35 ubuntu sudo: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 15:57:37 ubuntu sudo: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 15:57:37 ubuntu sudo:      aaa : TTY=pts/1 ; PWD=/home/aaa ; USER=root ; COMMAND=/usr/bin/ld -x --shared -o /usr/lib/x86_64-linux-gnu/security/sensepam.so /usr/local/lib/libcrypto.so sensepam.o  Jul  5 15:57:37 ubuntu sudo: pam_unix(sudo:session): session opened for user root by (uid=0)  Jul  5 15:57:37 ubuntu sudo: pam_unix(sudo:session): session closed for user root  Jul  5 15:57:40 ubuntu sudo:      aaa : TTY=pts/1 ; PWD=/home/aaa ; USER=root ; COMMAND=/usr/bin/ld -x --shared -o /usr/lib/x86_64-linux-gnu/security/sensepam.so /usr/local/lib/libcrypto.so sensepam.o  Jul  5 15:57:40 ubuntu sudo: pam_unix(sudo:session): session opened for user root by (uid=0)  Jul  5 15:57:40 ubuntu sudo: pam_unix(sudo:session): session closed for user root  Jul  5 16:07:15 ubuntu sudo:      aaa : TTY=pts/1 ; PWD=/usr/lib/x86_64-linux-gnu/security ; USER=root ; COMMAND=/usr/bin/su -  Jul  5 16:07:15 ubuntu sudo: pam_unix(sudo:session): session opened for user root by (uid=0)  Jul  5 16:07:15 ubuntu su: (to root) aaa on pts/1  Jul  5 16:07:15 ubuntu su: pam_unix(su-l:session): session opened for user root by (uid=0)  Jul  5 16:09:04 ubuntu systemd-logind[649]: New seat seat0.  Jul  5 16:09:04 ubuntu systemd-logind[649]: Watching system buttons on /dev/input/event0 (Power Button)  Jul  5 16:09:04 ubuntu systemd-logind[649]: Watching system buttons on /dev/input/event1 (Sleep Button)  Jul  5 16:09:04 ubuntu systemd-logind[649]: Watching system buttons on /dev/input/event2 (AT Translated Set 2 keyboard)  Jul  5 16:09:04 ubuntu gdm-launch-environment]: pam_unix(gdm-launch-environment:session): session opened for user gdm by (uid=0)  Jul  5 16:09:05 ubuntu systemd-logind[649]: New session c1 of user gdm.  Jul  5 16:09:05 ubuntu systemd: pam_unix(systemd-user:session): session opened for user gdm by (uid=0)  Jul  5 16:09:05 ubuntu su: (to aaa) root on none  Jul  5 16:09:05 ubuntu su: pam_unix(su:session): session opened for user aaa by (uid=0)  Jul  5 16:09:05 ubuntu systemd: pam_unix(systemd-user:session): session opened for user aaa by (uid=0)  Jul  5 16:09:05 ubuntu su: pam_unix(su:session): session closed for user aaa  Jul  5 16:09:07 ubuntu polkitd(authority=local): Registered Authentication Agent for unix-session:c1 (system bus name :1.71 [/usr/bin/gnome-shell], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)  Jul  5 16:09:17 ubuntu gdm-password]: PAM unable to dlopen(sensepam.so): /lib/security/sensepam.so: undefined symbol: OPENSSL_init_crypto  Jul  5 16:09:17 ubuntu gdm-password]: PAM adding faulty module: sensepam.so  Jul  5 16:09:17 ubuntu gdm-password]: pam_unix(gdm-password:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 16:09:20 ubuntu gdm-password]: pam_unix(gdm-password:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 16:09:20 ubuntu gdm-password]: pam_unix(gdm-password:auth): authentication failure; logname= uid=0 euid=0 tty=/dev/tty1 ruser= rhost=  user=uos001  Jul  5 16:09:24 ubuntu gdm-password]: PAM unable to dlopen(sensepam.so): /lib/security/sensepam.so: undefined symbol: OPENSSL_init_crypto  Jul  5 16:09:24 ubuntu gdm-password]: PAM adding faulty module: sensepam.so  Jul  5 16:09:24 ubuntu gdm-password]: pam_unix(gdm-password:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 16:09:27 ubuntu gdm-password]: pam_unix(gdm-password:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 16:09:27 ubuntu gdm-password]: gkr-pam: unable to locate daemon control file  Jul  5 16:09:27 ubuntu gdm-password]: gkr-pam: stashed password to try later in open session  Jul  5 16:09:27 ubuntu gdm-password]: pam_unix(gdm-password:session): session opened for user aaa by (uid=0)  Jul  5 16:09:27 ubuntu systemd-logind[649]: New session 3 of user aaa.  Jul  5 16:09:27 ubuntu systemd: pam_unix(systemd-user:session): session opened for user aaa by (uid=0)  Jul  5 16:09:27 ubuntu gdm-password]: gkr-pam: gnome-keyring-daemon started properly and unlocked keyring  Jul  5 16:09:28 ubuntu gnome-keyring-daemon[1842]: The PKCS#11 component was already initialized  Jul  5 16:09:28 ubuntu gnome-keyring-daemon[1842]: The Secret Service was already initialized  Jul  5 16:09:29 ubuntu polkitd(authority=local): Registered Authentication Agent for unix-session:3 (system bus name :1.147 [/usr/bin/gnome-shell], object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8)  Jul  5 16:09:30 ubuntu dbus-daemon[606]: [system] Failed to activate service 'org.bluez': timed out (service_start_timeout=25000ms)  Jul  5 16:09:32 ubuntu gdm-launch-environment]: pam_unix(gdm-launch-environment:session): session closed for user gdm  Jul  5 16:09:32 ubuntu systemd-logind[649]: Session c1 logged out. Waiting for processes to exit.  Jul  5 16:09:32 ubuntu systemd-logind[649]: Removed session c1.  Jul  5 16:09:32 ubuntu polkitd(authority=local): Unregistered Authentication Agent for unix-session:c1 (system bus name :1.71, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)  Jul  5 16:17:01 ubuntu CRON[3961]: pam_unix(cron:session): session opened for user root by (uid=0)  Jul  5 16:17:01 ubuntu CRON[3961]: pam_unix(cron:session): session closed for user root  Jul  5 16:30:01 ubuntu CRON[6263]: pam_unix(cron:session): session opened for user root by (uid=0)  Jul  5 16:30:01 ubuntu CRON[6263]: pam_unix(cron:session): session closed for user root  Jul  5 16:42:09 ubuntu gdm-password]: PAM unable to dlopen(sensepam.so): /lib/security/sensepam.so: undefined symbol: OPENSSL_init_crypto  Jul  5 16:42:09 ubuntu gdm-password]: PAM adding faulty module: sensepam.so  Jul  5 16:42:09 ubuntu gdm-password]: pam_unix(gdm-password:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 16:42:14 ubuntu gdm-password]: pam_unix(gdm-password:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 16:42:14 ubuntu gdm-password]: gkr-pam: unlocked login keyring  Jul  5 17:01:25 ubuntu gdm-password]: PAM unable to dlopen(sensepam.so): /lib/security/sensepam.so: undefined symbol: OPENSSL_init_crypto  Jul  5 17:01:25 ubuntu gdm-password]: PAM adding faulty module: sensepam.so  Jul  5 17:01:25 ubuntu gdm-password]: pam_unix(gdm-password:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 17:02:23 ubuntu gdm-password]: pam_unix(gdm-password:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 17:02:23 ubuntu gdm-password]: gkr-pam: unlocked login keyring  Jul  5 17:17:01 ubuntu CRON[14250]: pam_unix(cron:session): session opened for user root by (uid=0)  Jul  5 17:17:01 ubuntu CRON[14250]: pam_unix(cron:session): session closed for user root  Jul  5 17:22:02 ubuntu gdm-password]: PAM unable to dlopen(sensepam.so): /lib/security/sensepam.so: undefined symbol: OPENSSL_init_crypto  Jul  5 17:22:02 ubuntu gdm-password]: PAM adding faulty module: sensepam.so  Jul  5 17:22:02 ubuntu gdm-password]: pam_unix(gdm-password:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 17:22:05 ubuntu gdm-password]: pam_unix(gdm-password:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 17:22:05 ubuntu gdm-password]: gkr-pam: unlocked login keyring  Jul  5 17:30:01 ubuntu CRON[16439]: pam_unix(cron:session): session opened for user root by (uid=0)  Jul  5 17:30:01 ubuntu CRON[16439]: pam_unix(cron:session): session closed for user root  Jul  5 17:34:46 ubuntu gdm-password]: PAM unable to dlopen(sensepam.so): /lib/security/sensepam.so: undefined symbol: OPENSSL_init_crypto  Jul  5 17:34:46 ubuntu gdm-password]: PAM adding faulty module: sensepam.so  Jul  5 17:34:46 ubuntu gdm-password]: pam_unix(gdm-password:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 17:34:50 ubuntu gdm-password]: pam_unix(gdm-password:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 17:34:50 ubuntu gdm-password]: gkr-pam: unlocked login keyring  Jul  5 17:35:03 ubuntu sudo: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 17:35:05 ubuntu sudo: pam_unix(sudo:auth): Couldn't open /etc/securetty: No such file or directory  Jul  5 17:35:05 ubuntu sudo:      aaa : TTY=pts/0 ; PWD=/var/log ; USER=root ; COMMAND=/usr/bin/su  Jul  5 17:35:05 ubuntu sudo: pam_unix(sudo:session): session opened for user root by (uid=0)  Jul  5 17:35:05 ubuntu su: (to root) aaa on pts/0  Jul  5 17:35:05 ubuntu su: pam_unix(su:session): session opened for user root by (uid=0)      

I think the error point is :

PAM unable to dlopen(sensepam.so): /lib/security/sensepam.so: undefined symbol: OPENSSL_init_crypto  

so Is there any way to solve this problem?Thanks!

How to concatenate a specific column from several file

Posted: 05 Jul 2021 09:53 AM PDT

I have a data file A.tsv (field separator = \t) :

id  clade   mutation  243 40A SDF  254 20B  261 40A  267 20B  

B.tsv (field separator = \t) :

id  clade   mutation  243 40A  254 20B  261 40A  267 20B SLT  

C.tsv (field separator = \t) :

id  clade   mutation  243 40A  254 20B  261 40A MGG  267 20B  

And I want to concatenate all the file into one, knowing that the only column that is different between all the file is the column mutation. The result expected is :

id  clade   mutation  243 40A SDF  254 20B  261 40A MGG  267 20B SLT  

So far I tried :

awk 'BEGIN{FS=OFS="\t"} NR==FNR{klos[NR]=$3; next} $3==""{$3=klos[FNR]} 1' *.tsv > output.tsv  

But it didn't works. Do you have a way to do that ? Thanks

PS: Here is a sample test, in my real condition I have more than 3 files. But like the example, there are not two file with the same thing in the mutation column.

VirtualBox/Android - Unable to run Google Play Apps

Posted: 05 Jul 2021 06:32 AM PDT

I'll provide more details below, but the bottom line is that I have android running in a virtual machine with a Ubuntu 20.04 host. For any app that I've downloaded from the Google Play store, I get the following error message when I click on it:

[App Name] keeps stopping

where "[App Name]" is Doodle Jump or whatever. Also, when I click on the app, text output on a black background appears for a tiny amount of time. Other apps that came with the android installation appear to work fine.

I installed the Android x86 8.1 ISO.

I am using VirtualBox 6.1 installed on Ubuntu 20.04.

During the VM setup, I selected that the "Type" of the VM was Linux and the Version was "Other (64-bit)".

It has 8gb of storage and 2gb ram. Also, I had to set the "Graphics Controller" setting to "VBoxSVGA" to get the graphics to work properly. Let me know if there are any more details I should add.

Any help is greatly appreciated.

I messed with Fstab, my computer wont boot anymore - debian 10

Posted: 05 Jul 2021 06:21 AM PDT

Earlier today, I thought it would be a good idea to add two hard drives to my fstab in order for them to boot automatically on startup. I made a mess and the computer wont boot anymore.

After reading about these kind of problems on the internet, I tried to boot from a Ubuntu Live USB, mount my Debian partition in /mnt and remove from fstab the two lines that caused the problem. I successfully did that, but the computer won't boot nonetheless.

To clarify, when I try to start on my regular partition, I manage to go to grub, and I'll get a black screen no matter what I select afterwards (recovery or regular mode).

Here is what my fstab currently look like:

# /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/sda2 during installation  UUID=17206754-902a-4ffd-9e92-72da2ad05591 /               ext4    errors=remount-ro 0       1  # /boot/efi was on /dev/sda1 during installation  UUID=A659-81E6  /boot/efi       vfat    umask=0077      0       1  # swap was on /dev/sda3 during installation  UUID=571be9ab-7e08-47e6-84ee-cbfc9db19719 none            swap    sw   

sda2 is where everything is installed.

Also, I have noticed that an empty folder fstab: is created every time I boot. I have tried to get rid of it, but it keeps coming back. I can't find this folder on other Linux installations of mine.

I'm not too sure what to do anymore, I'm pretty sure I restored the fstab file to its initial state, but it still wont boot.

Fail to enable NFS on Yocto Linux

Posted: 05 Jul 2021 09:42 AM PDT

I'm trying to enable NFS on a Linux image built using Yocto. The image is running on a dev board - Qualcomm RB5. After booting up, mount.nfs didn't seem to work, complaining

mount.nfs: No such device  

When I check using dmesg | grep nfs, I got the following info but can't figure out myself what's the reason for the failure

[    7.323526] systemd[597]: proc-fs-nfsd.mount: Failed to connect stdout to the journal socket, ignoring: No such file or directory  [    7.326328] request_module fs-nfsd succeeded, but still no fs?  [    7.337908] systemd[1]: proc-fs-nfsd.mount: Mount process exited, code=exited, status=32/n/a  [    7.338655] systemd[1]: proc-fs-nfsd.mount: Failed with result 'exit-code'.  [    7.346027] systemd[1]: nfs-mountd.service: Job nfs-mountd.service/start failed with result 'dependency'.  [    7.346754] systemd[1]: nfs-server.service: Job nfs-server.service/start failed with result 'dependency'.  [    7.454332] systemd[649]: proc-fs-nfsd.mount: Failed to connect stdout to the journal socket, ignoring: No such file or directory  [    7.459122] systemd[1]: proc-fs-nfsd.mount: Mount process exited, code=exited, status=32/n/a  [    7.460157] systemd[1]: proc-fs-nfsd.mount: Failed with result 'exit-code'.  [    8.235626] systemd[726]: proc-fs-nfsd.mount: Failed to connect stdout to the journal socket, ignoring: No such file or directory  [    8.241962] systemd[1]: proc-fs-nfsd.mount: Mount process exited, code=exited, status=32/n/a  [    8.243164] systemd[1]: proc-fs-nfsd.mount: Failed with result 'exit-code'.  

When I check using "systemctl status proc-fs-nfsd.mount", it shows the following:

Jan 01 06:55:40 qrb5165-rb5 mount[1377]: mount: /proc/fs/nfsd: unknown filesystem type 'nfsd'.  

which is confusing since I thought I enabled nfs.

I made sure I enabled NFS support in local.conf. The following are the lines that I used to enable NFS:

DISTRO_FEATURES_append = " nfs"  EXTRA_IMAGE_FEATURES += "nfs-server"  EXTRA_IMAGE_FEATURES += "nfs-client"  

Anything that I missed?

Script that groups backups by date then deletes files+folders older than X days

Posted: 05 Jul 2021 09:11 AM PDT

We have 30 days of backups = 30 folders, the backup runs hourly so in each of these folders, there are 24 files in each folder. We need to run a script that keeps the five latest dates of files.

For example, if today is June 30 and I run that script, it doesnt matter how many files are in the folders June 25, June 26, June 27, July 28, July 29 it will keep all five folders and only delete the folders from June 24 and older.

Would also be nice to skip folders that have data < 10kb incase a backup task created an empty zip file.

What I have been testing so far:

find /files/ -ctime +5 -printf "%TY-%Tm-%Td\n" | sort -u -r | tail -n+5 | xargs rm -R    -ctime +5 = which files we want to expire created more than 5 days ago,  -printf "%TY-%Tm-%Td\n" outputs the dates of the folders so we can sort them  sort -u -r = sorting the output so we can do tail  tail -n +5 = tail skips the 5 newest filegroups: grouped by date, not just 5 newest files  

Is this logic correct? I also need some kind of xarg to execute "rm -R" on the resultant list of "old backups".

Thanks in advance!

Pairing bluetooth headset fails with error org.bluez.Error.AuthenticationTimeout

Posted: 05 Jul 2021 07:01 AM PDT

I'm having a problem connecting to my Bluetooth headset. I can pair it to other systems, so I know it's working, however, on my new laptop on which I recently installed Manjaro i3, it fails.

This is what I'm doing (and the output I see):

bluetoothctl  [bluetooth]# power on  [bluetooth]# agent on  [bluetooth]# default-agent  [bluetooth]# scan on    <-- finds my headset  [bluetooth]# trust <mac>  Changing <mac> trust succeeded  [bluetooth]# pair <mac>  Attempting to pair with <mac>  Failed to pair: org.bluez.Error.AuthenticationTimeout  [bluetooth]#   

I've been going through the internet for the past 4 hours, but I didn't find any solution.

Any help is sincerely appreciated

alsa 16 channel audio playback using dshare plugin is getting stuck at poll function on /dev/snd/timer

Posted: 05 Jul 2021 08:22 AM PDT

Problem: Send 16 channel audio TDM stream over SAI(5) datalines using freescale IMX8m. There's no codec termination on the HW. only the data is framed in a TDM fromat and sent over the I2S Datalines. There's an FPGA that receives the data on the other end of Imx8m datalines and de-multiplexes it to multiple audio out sources.

Issue: When playing 8 (4 stereo sources) channels, the TDM frame seems to be working without any issues. But when i increase the TDM frame size to 16 channels (8 stereo sources), once in a while the playback is stuck before even beginning the playback. it remains stuck in the poll() function and never returns. this poll function is called at the top level from snd_pcm_write_areas() in /alsa-lib/src/pcm/pcm.c

Here's what I have found during my debug between aplay app/alsa-lib <=> alsa-pcm-snd-driver <==> fsl_sai driver > HW

  1. when the playback is functioning properly i can see the snd_pcm_direct.spcm->hw.ptr getting incremented by frame size*1 (or more) for every snd_pcm_write_areas call. this pointer seems to keep track of the #of frames in time that should have been sent out. its an unsigned int value with a boundary of 0x40000000 and the ptr loops back again once it reaches the boundary. From alsa-lib/src/pcm/pcm.c file
 static int snd_pcm_dshare_start_timer(snd_pcm_direct_t *dshare)   {    int err;    snd_pcm_hwsync(dshare->spcm);      dshare->slave_appl_ptr= dshare->slave_hw_ptr = *dshare->spcm->hw.ptr;  
  1. When the playback is stuck at poll function i see that this pointer never got updated and is stuck at period size (frame size * n) or at some multiple of frame size.
  2. I have seen several alsa posts online regarding the playback being stuck but no solution or direction to take in case of.
  3. Also read one post, mentioning this to be an existing alsa bug as of 4.14 kernel, when using Dshare/Dmix/Dsnoop plugins.
  4. I have tried moving from 1.1.2 to 1.1.5 or 1.1.7 version but no luck. Apparently this issue doesn't happen when using the HW cards, only when using the above mentioned plugins this issue is seen.

I am not sure which one leads to the other and which one is the bug that needs to be fixed.

The poll function getting stuck due to timer getting into bad state or the timer getting into bad state leading to the poll getting stuck.

Some details of how we creating the TDM frame we have a 16 channel audio (8 independent stereo pairs) that need to be sent as a frame to the HW to be written out on one of the SAI datalines (4 data lines). These 8 sources can be played independently and the sources will occupy the slots in the TDM frame according to the channel map as specified in the asound.conf configuration file.

The dshare plugin is being used to create the shared buffer that will hold the frame. I have created 8 virtual sources in the conf file, one for each playback process. each source can be used in a separate aplay process for playing a 8 different source. see the batch file that plays all the 8 sources.

output from aplay -L/l

null      Discard all samples (playback) or generate zero samples (capture)  src1      TDM 0 channel 0/1 for audio playback  src2      TDM 1 channel 2/3 for audio playback  src3      TDM 2 channel 4/5 for audio playback  src4      TDM 3 channel 6/7 for audio playback  src5      TDM 4 channel 8/9 for audio playback  src6      TDM 5channel 10/11 for audio playback  src7      TDM 6 channel 12/13 for audio playback  src8      TDM 7 channel 14/15 for audio playback  default:CARD=<xxxxx>      Default Audio Device  sysdefault:CARD=<xxxxxxxx>      Default Audio Device  

asound.conf file

# NOTE: this is for sharing multiple channels on a single (TDM) audio device with multple ALSA clients    # shared buffer for playback  pcm_slave.tdmshare {      pcm "hw:0"      channels 16      rate 48000          # fixed, because all dshare devices must use the same samplerate.      format S24_LE      period_size 512      buffer_size 1024  }    # src1 shared pcm device and corresponding virtual playback device  pcm.src1_dshare {      type dshare      ipc_key 43544553      slave tdmshare      bindings.0 0      bindings.1 4  }  pcm.src1 {      type plug      slave.pcm "src1_dshare"   hint {                  show {                          @func refer                          name defaults.namehint.basic                  }                  description "TDM 0 channel 0/1 for audio playback"          }  }    # src2 shared pcm device and corresponding virtual playback device  pcm.src2_dshare {      type dshare      ipc_key 43544553      slave tdmshare      bindings.0 8      bindings.1 12  }  pcm.src2 {      type plug      slave.pcm "src2_dshare"   hint {                  show {                          @func refer                          name defaults.namehint.basic                  }                  description "TDM 1 channel 2/3 for audio playback"          }  }    # src3 shared pcm device and corresponding virtual playback device  pcm.src3_dshare {      type dshare      ipc_key 43544553      slave tdmshare      bindings.0 1      bindings.1 5  }  pcm.src3 {      type plug      slave.pcm "src3_dshare"   hint {                  show {                          @func refer                          name defaults.namehint.basic                  }                  description "TDM 2 channel 4/5 for audio playback"          }  }    # src4 shared pcm device and corresponding virtual playback device  pcm.src4_dshare {      type dshare      ipc_key 43544553      slave tdmshare      bindings.0 9      bindings.1 13  }  pcm.src4 {      type plug      slave.pcm "src4_dshare"   hint {                  show {                          @func refer                          name defaults.namehint.basic                  }                  description "TDM 3 channel 6/7 for audio playback"          }  }    # src5 shared pcm device and corresponding virtual playback device  pcm.src5_dshare {      type dshare      ipc_key 43544553      slave tdmshare      bindings.0 2      bindings.1 6  }  pcm.src5 {      type plug      slave.pcm "src5_dshare"   hint {                  show {                          @func refer                          name defaults.namehint.basic                  }                  description "TDM 4 channel 8/9 for audio playback"          }  }    # src6 shared pcm device and corresponding virtual playback device  pcm.src6_dshare {      type dshare      ipc_key 43544553      slave tdmshare      bindings.0 10      bindings.1 14  }  pcm.src6 {      type plug      slave.pcm "src6_dshare"   hint {                  show {                          @func refer                          name defaults.namehint.basic                  }                  description "TDM 5channel 10/11 for audio playback"          }  }    # src7 shared pcm device and corresponding virtual playback device  pcm.src7_dshare {      type dshare      ipc_key 43544553      slave tdmshare      bindings.0 3      bindings.1 7  }  pcm.src7 {      type plug      slave.pcm "src7_dshare"   hint {                  show {                          @func refer                          name defaults.namehint.basic                  }                  description "TDM 6 channel 12/13 for audio playback"          }  }    # src8 shared pcm device and corresponding virtual playback device  pcm.src8_dshare {      type dshare      ipc_key 43544553      slave tdmshare      bindings.0 11      bindings.1 15  }  pcm.src8 {      type plug      slave.pcm "src8_dshare"   hint {                  show {                          @func refer                          name defaults.namehint.basic                  }                  description "TDM 7 channel 14/15 for audio playback"          }  }  

batch file for playing all 8 sources

aplay -Dplug:src1 /data/PCMCH1-Ch2_1.wav&  aplay -Dplug:src2 /data/PCMCH3-Ch4_1.wav&  aplay -Dplug:src3 /data/PCMCH5-Ch6_1.wav&  aplay -Dplug:src4 /data/PCMCH7-Ch8_1.wav&  aplay -Dplug:src5 /data/PCMCH1-Ch2_1.wav&  aplay -Dplug:src6 /data/PCMCH3-Ch4_1.wav&  aplay -Dplug:src7 /data/PCMCH5-Ch6_1.wav&  aplay -Dplug:src8 /data/PCMCH7-Ch8_1.wav&  

Please let me know if there's something that can be modified in asound.conf file or if there's any limitation that i am hitting when playing 16 vs 8 channels in the alsa-lib that's causing this issue.

The other links that i have seen regarding this issue are below. they are very old links and some say its fixed but i am not sure how it was fixed or what those patches were. our system is using alsa version 1.1.6 with kernel 4.14 and is present in this build. please point me to any patchset or link that shows how to resolve this issue. i have hit a dead end at this time regarding this issue and also due to my limited knowledge in this area.

[https://bugzilla.redhat.com/show_bug.cgi?id=534130][1]

[https://www.raspberrypi.org/forums/viewtopic.php?t=64936][2]

[https://sourceforge.net/p/alsa/mailman/message/26464680/][3]

error: disk lvmid/... not found Entering rescue mode

Posted: 05 Jul 2021 08:01 AM PDT

I deleted the partition containing Fedora to install Ubuntu (in Win 10), but after I rebooted I'm getting the following error message: "error: disk 'lvmid/Xe53HM-hHmX-fDKu-BCLf-Oa9w-n4Dt-7f9UdA/WE42Po-BN7m-Og4c-LTcX-zVN7-cTJm-sMdNzo' not found" entering rescue mode.

I think I lost my bootloader. How to recover the bootloader?

fstab mount problem

Posted: 05 Jul 2021 09:02 AM PDT

Fresh install Of Mint 17.

I have few partition and 3 OSs Win/Ubuntu-Gnome/ and this newly installed Mint. One of these partition is a storage disk for all documents, photos etc.. and I used to use it from both Linux OSs without any problem and mount it during start by editing fstab. Last days i decided to try Mint 17.3 and after installation I wanted to edit fstab via disk manager and

  • after changing mounting properties to

    dev/disk/by-uuid/xxxx(here proper UUID) /mnt/Local ext4 nosuid,nodev,nofail,x-gvfs-show 0 0  

    it failed with

    Error mounting system-managed device /dev/sda3:  Command-line mount "/mnt/Local"' exited with non-zero exit status 32:  mount: wrong fstype, bad option, bad superblock on /dev/sda3`  
  • So I check it with fsck.ext4 /dev/sda3 : no faults
  • Then I tried mount with mount /dev/sda3 /mnt/Local And it was mounted successfully :) (and it is mounted as ext4 - as it should be)

I tried all possible options via UUID, via /dev/sda3 via LABEL and it is not working - the same error... I have to add that the same option in fstab under my Ubuntu Gnome works properly... Any ideas?

Btrfs/ZFS Network Replication

Posted: 05 Jul 2021 10:00 AM PDT

Is it possible to replicate a ZFS or Btrfs raid volume in real-time (or as close to as possible, network specs aside) over a network?

ZFF and Btrfs are ideal because of their CoW properties.

I'm thinking something similar to DRBD, but DRBD won't work because it requires a single block device, and we're ruling out the option of exporting each disk as a DRBD device because that would get messy.

I don't want to use send/receive because they would be too slow, even if scripted.

Ideally, I'd like something relatively simple to avoid unnecessary complexity.

No comments:

Post a Comment