Sample Header Ad - 728x90

Unix & Linux Stack Exchange

Q&A for users of Linux, FreeBSD and other Unix-like operating systems

Latest Questions

0 votes
0 answers
55 views
Cannot find mqic library when compiling Mqueue-sending C program
On our linux dev server for an application at work, we have an in-house C program called sendFile to, well, send files to the Mqueue. The program has seemingly not been changed since its creation in 2011 and works well enough as is, but I recently tried to add something to it (a 3rd queue definition...
On our linux dev server for an application at work, we have an in-house C program called sendFile to, well, send files to the Mqueue. The program has seemingly not been changed since its creation in 2011 and works well enough as is, but I recently tried to add something to it (a 3rd queue definition), and ran into issues when trying to compile it. The compiling command, which I assembled from the makefile, is as follows : gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer sendFile.c -o sendFile -I/opt/mqm/inc -L/opt/mqm/lib/ -lmqic The last part, -lmqic, is what's causing issues. Specifically, I get this : /bin/ld: skipping incompatible /opt/mqm/lib//libmqic.so when searching for -lmqic /bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/8/../../../libmqic.so when searching for -lmqic /bin/ld: skipping incompatible //lib/libmqic.so when searching for -lmqic /bin/ld: skipping incompatible //usr/lib/libmqic.so when searching for -lmqic /bin/ld: cannot find -lmqic collect2: error: ld returned 1 exit status And when I remove that argument, I get errors due to undefined reference to MQOPEN, MQCONN, MQCLOSE, etc. (functions of the mqic library, I presume). Per the ldd command, I was able to see which libraries are used by the program : linux-vdso.so.1 (0x00007ffcd63e9000) libmqic.so => /opt/mqm/lib64/libmqic.so (0x00007faf14597000) libc.so.6 => /usr/lib64/libc.so.6 (0x00007faf141d2000) libmqe.so => /opt/mqm/lib64/libmqe.so (0x00007faf135f6000) libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007faf133f2000) libm.so.6 => /usr/lib64/libm.so.6 (0x00007faf13070000) /lib64/ld-linux-x86-64.so.2 (0x00007faf1479b000) librt.so.1 => /usr/lib64/librt.so.1 (0x00007faf12e68000) libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007faf12ad3000) libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007faf128b3000) libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007faf1269b000) The /opt/mqm/lib64/libmqic.so library seems to be exactly what -lmqic refers to, and does exist on the server, so I'm rather puzzled as to why the compiler somehow can't find it. I did try to yum install mqic (in case the version on the server is incompatible as the error messages seem to suggest), but it didn't seem to exist under that name (though maybe I need to name it differently). Thanks in advance for any help! It's likely a very easy solution, and I'll be glad to be the fool if so.
Gael L (131 rep)
Sep 3, 2024, 06:27 PM
1 votes
1 answers
325 views
Remove specific emails from sendmail mqueue
How do I remove emails from `mqueue` based on destination address. Needing to remove deferred messages going to " " Due to an endless loop (that has been found and corrected) I have a huge amount of emails deferred or qued for retry in `var/spool/mqueue`. Need to clear these out ASAP as the bounceba...
How do I remove emails from mqueue based on destination address. Needing to remove deferred messages going to "" Due to an endless loop (that has been found and corrected) I have a huge amount of emails deferred or qued for retry in var/spool/mqueue. Need to clear these out ASAP as the bounceback messages are filling up my var/log folder space by 1G every 20min. There is legit email also in the que so can't just empty var/spool/mqueue. How do I filter to just the results I am looking for? And, do I need to stop sendmail first? Results from **df -h** in mqueue showing /dev/sda2 filesystem 100% used due to var/log root@tsunami12:/var/log# df -h Filesystem Size Used Avail Use% Mounted on udev 32G 0 32G 0% /dev tmpfs 6.3G 650M 5.7G 11% /run /dev/sda2 28G 28G 0G 100% / tmpfs 32G 0 32G 0% /dev/shm tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 32G 0 32G 0% /sys/fs/cgroup /dev/sda4 2.1T 986G 1013G 50% /home tmpfs 6.3G 0 6.3G 0% /run/user/1000 tmpfs 6.3G 0 6.3G 0% /run/user/1002 tmpfs 6.3G 0 6.3G 0% /run/user/1003 Results from ls -lh in mqueue root@tsunami12:/var/spool/mqueue# ls -lh -rw-r----- 1 smmta smmsp 0 Mar 17 2020 df02H2TsFs012156 -rw-r----- 1 root smmsp 2.8K Apr 14 10:17 df33EDseEV018975 -rw-r----- 1 root smmsp 3.6K Apr 14 10:12 df33EECwjo001842 -rw-r----- 1 root smmsp 2.3K Apr 14 10:43 df33EEhHEt023903 -rw-r----- 1 root smmsp 2.3K Apr 14 10:45 df33EEj5ai025020 Results from **mailq** command 33J38Htu005703 3623 Tue Apr 18 23:08 (Deferred) 33J382mj005213 3623 Tue Apr 18 23:08 (Deferred) Results from root@tsunami12:/var/log# **tail mail.log** command Apr 19 15:54:56 tsunami12 sm-mta: 33INJGL5000565: to=,,,, delay=20:35:40, xdelay=00:00:00, mailer=esmtp, pri=10924132, relay=smtpin01.vzw.a.cloudfilter.net., dsn=4.0.0, stat=Deferred: Connection reset by smtpin01.vzw.a.cloudfilter.net. Apr 19 15:54:56 tsunami12 sm-mta: 33J0R2EH028306: to=,, delay=19:27:53, xdelay=00:00:00, mailer=esmtp, pri=10655014, relay=att-e2xms-west.mx.a.cloudfilter.net., dsn=4.0.0, stat=Deferred: Connection reset by att-e2xms-west.mx.a.cloudfilter.net. Apr 19 15:54:56 tsunami12 sm-mta: 33J0R2EH028306: to=, delay=19:27:53, xdelay=00:00:00, mailer=esmtp, pri=10655014, relay=tmo-east.mx.a.cloudfilter.net., dsn=4.0.0, stat=Deferred: Connection reset by tmo-east.mx.a.cloudfilter.net. Apr 19 15:54:56 tsunami12 sm-mta: 33J0R2EH028306: to=,,,, delay=19:27:53, xdelay=00:00:00, mailer=esmtp, pri=10655014, relay=smtpin01.vzw.a.cloudfilter.net., dsn=4.0.0, stat=Deferred: Connection reset by smtpin01.vzw.a.cloudfilter.net.
Sarah (11 rep)
Apr 19, 2023, 08:26 PM • Last activity: Apr 24, 2023, 03:04 PM
1 votes
0 answers
86 views
Timeout Error while using Command Queue
I am new to command queue mechanism in Linux. I am using the following: Kernel Tree: git clone https://android.googlesource.com/kernel/msm Kernel Ver: 4.9.96 While doing read/write I observe a timeout error: mmc0: request with tag: 30 flags: 0x2469000 timed out mmc0: mmc_blk_cmdq_complete_rq: txfr e...
I am new to command queue mechanism in Linux. I am using the following: Kernel Tree: git clone https://android.googlesource.com/kernel/msm Kernel Ver: 4.9.96 While doing read/write I observe a timeout error: mmc0: request with tag: 30 flags: 0x2469000 timed out mmc0: mmc_blk_cmdq_complete_rq: txfr error(-110)/resp_err(0) mmc0: mmc_blk_cmdq_complete_rq err req = 0xffffffc0f82acda0, err = -110, err tag = 16 mmc0: mmc_blk_cmdq_err err req = ffffffc0f82acda0, err tag = 16 I checked the CQ registers dump: Following are some of the important ones: CQTDBR: 0x7fffffff CQDPT: 0x7fffffff CQCRI: 0x0000000d What may have caused this error and how to solve it ? Thanks in advance.
nishad kamdar (73 rep)
Feb 1, 2021, 01:19 PM
0 votes
1 answers
158 views
Ran a program as root on accident and now my mq-open cmd's fail with Permisson Denied
Ok so I wanted to know where to see the actual message queue files in a linux system? I have a program that was compiled and ran containing message queues but I ran the program as root by accident and now after running as a regular un privileged user it says Permission Denied when the mq_open fails....
Ok so I wanted to know where to see the actual message queue files in a linux system? I have a program that was compiled and ran containing message queues but I ran the program as root by accident and now after running as a regular un privileged user it says Permission Denied when the mq_open fails. I have looked at my workspace directories and changed all the program files back to being owned by standard user by how to get the queue reset Im not sure where to look?
MacLCM (73 rep)
Aug 14, 2020, 05:19 PM • Last activity: Aug 14, 2020, 05:33 PM
1 votes
1 answers
623 views
Equivalent of /dev/mqueue to enumerate SysV message queues
Linux supports two kinds of message queues: POSIX (i.e., those created by [`mq_open`][1]), and System V (i.e., those created by [`msgget`][2]). For POSIX message queues, [`mq_overview(7)`][3] documents that you can enumerate them via the `mqueue` virtual filesystem, usually mounted at `/dev/mqueue`....
Linux supports two kinds of message queues: POSIX (i.e., those created by mq_open ), and System V (i.e., those created by msgget ). For POSIX message queues, mq_overview(7) documents that you can enumerate them via the mqueue virtual filesystem, usually mounted at /dev/mqueue. However, System V message queues don't show up there. How can I enumerate them?
Joseph Sible-Reinstate Monica (4220 rep)
Apr 28, 2020, 10:56 PM
1 votes
1 answers
2129 views
Check if fs.mqueue.msg_max must be increased and do it
I need to run a program with a bash script. This program may require a larger than default message queue. I know I can increase it with: sudo sysctl fs.mqueue.msg_max=3000 And I could, for instance, check it with: echo "$(sysctl fs.mqueue.msg_max)" which would print, for instance `fs.mqueue.msg_max...
I need to run a program with a bash script. This program may require a larger than default message queue. I know I can increase it with: sudo sysctl fs.mqueue.msg_max=3000 And I could, for instance, check it with: echo "$(sysctl fs.mqueue.msg_max)" which would print, for instance fs.mqueue.msg_max = 100" I need to create a conditional if to increase the size if it is less than a threshold value (and do nothing otherwise). I expected it to look like: queue_size=$(sysctl fs.mqueue.msg_max) if (($queue_size < 3000)) then sudo sysctl fs.mqueue.msg_max 3000 else echo "message queue large enough at $queue_size" fi But this returns: ((: fs.mqueue.msg_max = 200 < 3000: syntax error: invalid arithmetic operator (error token is ".mqueue.msg_max = 200 < 3000") As queue_size received an object which is not the queue size, but something I don't understand nor know how to manipulate.
Mefitico (115 rep)
Jan 30, 2020, 05:27 PM • Last activity: Jan 31, 2020, 03:33 PM
0 votes
1 answers
1112 views
Why do some multiqueue (qdisc mq) have n tx / 1 rx, while others have 1 tx / n rx?
While trying to understand multiqueue queuing disciplines (mq qdisc), I stumbled across the following configs : On my laptop, my WiFi interface implements a mq qdisc with 1 rx and 4 tx : $ sudo tc qdisc list dev wlp2s0 qdisc mq 0: root qdisc pfifo_fast 0: parent :4 bands 3 priomap 1 2 2 2 1 2 0 0 1...
While trying to understand multiqueue queuing disciplines (mq qdisc), I stumbled across the following configs : On my laptop, my WiFi interface implements a mq qdisc with 1 rx and 4 tx : $ sudo tc qdisc list dev wlp2s0 qdisc mq 0: root qdisc pfifo_fast 0: parent :4 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 qdisc pfifo_fast 0: parent :3 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 qdisc pfifo_fast 0: parent :2 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 qdisc pfifo_fast 0: parent :1 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 $ sudo ll /sys/class/net/wlp2s0/queues/ total 0 33458 0 drwxr-xr-x 2 root root 0 août 18 05:54 rx-0/ 33461 0 drwxr-xr-x 3 root root 0 août 18 05:54 tx-0/ 33472 0 drwxr-xr-x 3 root root 0 août 18 05:54 tx-1/ 33483 0 drwxr-xr-x 3 root root 0 août 18 05:54 tx-2/ 33494 0 drwxr-xr-x 3 root root 0 août 18 05:54 tx-3/ On the other hand, on an HP ProLiant server, each NIC implements a mq qdisc with 4 rx and 1 tx : $ sudo tc qdisc show dev eno3 qdisc mq 0: root qdisc pfifo_fast 0: parent :1 bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1 $ sudo ll /sys/class/net/eno3/queues/ total 0 41241 0 drwxr-xr-x 2 root root 0 août 12 23:17 rx-0/ 41244 0 drwxr-xr-x 2 root root 0 août 12 23:17 rx-1/ 41247 0 drwxr-xr-x 2 root root 0 août 12 23:17 rx-2/ 41250 0 drwxr-xr-x 2 root root 0 août 12 23:17 rx-3/ 41256 0 drwxr-xr-x 3 root root 0 août 12 23:17 tx-0/ I guess the point of multiqueuing is performance, so what's the reasoning behind this ? Why does a WiFi card implement "tx multiqueuing", while a NIC implements "rx multiqueuing" ?
ChennyStar (1969 rep)
Aug 18, 2019, 05:26 AM • Last activity: Dec 18, 2019, 08:09 PM
2 votes
0 answers
1006 views
How to check usage of mqueues reliably?
I run a testing server for software that depends on the massive usage of [mqueues][1] (POSIX messages queues). I increased limits to a reasonable level and got it working a long time ago. However, the number of tests (and their mqueues) keeps rising and the tests are starting to fail at creating new...
I run a testing server for software that depends on the massive usage of mqueues (POSIX messages queues). I increased limits to a reasonable level and got it working a long time ago. However, the number of tests (and their mqueues) keeps rising and the tests are starting to fail at creating new mqueues, although the limits don’t seem to be exhausted. $ cat /proc/sys/fs/mqueue/queues_max # maximum mqueue count 65535 $ sudo mount -t mqueue none /mnt $ ls -1 /mnt | wc -l # current mqueue count 8445 $ ulimit -q # maximum bytes in mqueues 819200 $ du -s /mnt # current mqueues size 0 /mnt After a failing call to mq_open() , errno is set to 24 which means (according to /usr/include/asm-generic/errno-base.h ): #define EMFILE 24 /* Too many open files */ Therefore I checked the limit for open files but it seems to be not exhausted, too. $ ulimit -n # file descriptors limit 1024 $ lsof -u $(whoami) | wc -l # currently open files 306 **Are these checks correct? Is there anything more I should check?** --- I have looked at https://unix.stackexchange.com/questions/230346/how-to-check-ulimit-usage but the usage checks seem to be specific to particular limits and mqueues are not mentioned there. Since the behavior of mqueues has been changing over time due to bugs , my kernel version is 4.1.13-rt15+. I built the kernel myself using the appropriate real-time patch with no further modifications. I have not switched the kernel recently (when the problem started to appear).
Melebius (767 rep)
Jan 3, 2018, 10:30 AM • Last activity: Nov 19, 2019, 09:46 AM
2 votes
0 answers
440 views
Why is the limit for POSIX message queues so low?
Was going to use a bunch of message queues to communicate between different threads in two processes, but it appears that the max is 10 (Ubuntu 18.10). Just wondering what the reason is for not having this default max number of message queues higher?
Was going to use a bunch of message queues to communicate between different threads in two processes, but it appears that the max is 10 (Ubuntu 18.10). Just wondering what the reason is for not having this default max number of message queues higher?
Ryder Bergerud (121 rep)
Mar 30, 2019, 08:55 PM
3 votes
0 answers
2304 views
Multiqueue tun/tap interface
I am trying to understand how Multiqueue tuntap interface works. Following the instructions provided at: https://www.kernel.org/doc/Documentation/networking/tuntap.txt I was able to create multiple queues. However, I don't know how to check the queus status and where they are created. I tried: $ tc...
I am trying to understand how Multiqueue tuntap interface works. Following the instructions provided at: https://www.kernel.org/doc/Documentation/networking/tuntap.txt I was able to create multiple queues. However, I don't know how to check the queus status and where they are created. I tried: $ tc -s class show dev tap0 (where tap0 is my tap interface), I see around 255 queues, even for a single ioctl call with IFF_MULTI_QUEUE flag. So probably I am looking at the wrong place. Here is the snippet of the output of the above command: class mq :1 root Sent 4741 bytes 37 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 class mq :2 root Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 . . . class mq :ff root Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 class mq :100 root Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0) backlog 0b 0p requeues 0 Secondly, I am not sure how to steer packets to these queues based on some filter or classifier using TC or anyother tool.
Deys Nima (31 rep)
Jan 22, 2019, 07:38 PM • Last activity: Jan 29, 2019, 09:30 PM
0 votes
1 answers
2162 views
Handling multiple messages in message queue
I've done some research about this topic but I didn't understand it quite well. From `msgsnd man page` : > The msgsnd() system call appends a copy of the message pointed to by > msgp to the message queue whose identifier is specified by msqid. Does this mean that when i use a `msgget` to create a me...
I've done some research about this topic but I didn't understand it quite well. From msgsnd man page : > The msgsnd() system call appends a copy of the message pointed to by > msgp to the message queue whose identifier is specified by msqid. Does this mean that when i use a msgget to create a message queue the Enqueue and Dequeue happens automatically with msgsnd and msgrcv? For example, if I want to use a message queue that can simultaneously hold N messages, when i use msgsnd i put a message to the queue and when i use msg rcv i get it from here and delete that message? If that's the case i shouldn't implement manually enqueue and dequeue to create a list of N messages because it's enough to set a value to const void *msgp from int msgsnd(int msqid, const void *msgp, size_t msgsz, int msgflg); to add one more message in the queue and it is enough that this is received by msgrcv to be deleted from the queue otherwise it remains in the queue until it is received by some process, am i correct? But then how much messages this queue can contain if i'm not the one setting how many can be contained?
Zeno Raiser (227 rep)
Jan 4, 2018, 02:55 PM • Last activity: Feb 22, 2018, 11:02 AM
Showing page 1 of 11 total questions