|
sarali wrote: it was indeed the packet len which was not getting set correctly.
I'm happy to have helped.
Best Wishes,
-David Delaune
|
|
|
|
|
I had to write an application long time ago whose job was to check if PID is Active or not.
The Scenario was:
Crontab will execute a process every minute
Process takes longer than a minute
So, new process will check if PID file exists or not
If PID exists new process will abort.
But before aborting new process will ensure that current process is not running longer than 30 minutes. Because, it is observed if the particular process is running more than 20 minutes, it's because some exception that the process couldn't handle. In this case, we simply kill the process for greater good.
Then a scenario crossed my mind.
What if somehow current process failed remove the pid file(whatever the reason) and the PID I am trying to kill is not my my process.
What is the possibility of reaching this scenario.
FYI, I don't handle that service more than 2 years, it's still running. But I want to know if there is any issue.
I do not fear of failure. I fear of giving up out of frustration.
|
|
|
|
|
Mohibur Rashid wrote: What is the possibility of reaching this scenario.
I guess if the process segfaults it could potentially leave behind the pid file. Why can't you just cat /proc/YOURPID/exe from your crontab script and check that the path is equal to what you are expecting?
Try it and let me know.
Best Wishes,
-David Delaune
|
|
|
|
|
I have solved the issue readlink command on exe file under pid.
but repeating PID by OS is my concern.
I do not fear of failure. I fear of giving up out of frustration.
|
|
|
|
|
Mohibur Rashid wrote: but repeating PID by OS is my concern.
Well I am not a Linux expert but I can read documentation just as good as the next guy. The documentation states /proc/sys/kernel/pid_max defaults to 32786. It also states that the Linux kernel will not reuse a PID until complete wrap-around has occurred.
So if your server is spawning over 32786 processes every 30 minutes... Yes, PID reuse would be an issue for you. Otherwise you are OK.
Best Wishes,
-David Delaune
|
|
|
|
|
As you note, the process could abort without removing the pid file. The man page for ps suggests finding the process name by ps -q <pid> -o comm= . You can then compare the two names, and kill when needed.
Another option would be to use fuser and see if the returned pid, if any, matches that of the pid file.
If you have source code to both the worker process and the controller app, then you could place a lock on the pid file in the worker, and check the lock status in the controller. If no lock has been placed on the pid file, then the worker has died without removing the pid file.
|
|
|
|
|
The issue was solved long time ago, at least 2 years ago and thank you!
I do not fear of failure. I fear of giving up out of frustration.
|
|
|
|
|
I am using this link to help me to install a package.
R: Install Add-on Packages[^]
From the documentation I gather I need to have a zipped / tar file.
I downloaded this file "bluez_5.43-2+deb9u1_armhf.deb" and it is not tar file, hence this call fails
im@jim-desktop:~$ R CMD INSTALL bluez_5.43-2+deb9u1_armhf.deb
Warning: invalid package ‘bluez_5.43-2+deb9u1_armhf.deb’
Error: ERROR: no packages specified
Is there another command to install / add package ?
Help will be greatly appreciated.
|
|
|
|
|
I don't know whether to laugh, cry or just shoot myself. Perhaps the best I can do is to quote Wolfgang Pauli: Quote: "That is not only not right; it is not even wrong",
Look, do us all a favor and go out and buy a book on Ubuntu and actually read it.
|
|
|
|
|
I totally agree. I have tried for quite a long time to get this guy to actually learn something about Windows, Linux, compiling, linking, the difference between 32 and 64 bit, all to no avail. My recent attempts to help him just add to my frustration at his lack of understanding of the basics.
|
|
|
|
|
Thank you for that Richard.
For some time I've been thinking that the OP must be some sort of script-kiddie that has managed to install Linux, discovered an IDE and read the first few pages of "C++ for dummies", and now thinks he is on his way to becoming the next Dennis Ritchie. However, this latest query is so egregiously flawed that I've come up with a new theory. It doesn't seem conceivable that any reasonable search query for how to install a .deb file would return a hit for the page given anywhere near the top. That being the case, we must consider that the OP is, in fact, doing this deliberately. Therefore, I can only assume that the OP is some species of troll that is playing some sort of game of "bait the neck-beard". At this point its not unreasonable to assume that getting one of the respondents to announce that they are no longer going to respond accrues major points. If so, I'm going to make someones day by saying I'm not playing any longer. By the way, have you noticed that the OP varies his nickname from "Vaclav_" to "_Vaclav"? Can we thereby assume there's actually 2 of them?
Now if there was only some way to invoke Godwin's law...
|
|
|
|
|
I understand "/../file " means " execute "file " in parent directory, but why is is used in first place ?
In this example I gather the "-L" is linked to "lib" four times.
Do not get it .
-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib
Just asking.
|
|
|
|
|
Vaclav_ wrote: In this example I gather the "-L" is linked to "lib" four times.
Do not get it .
-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib
No. ../ refers to the parent directory, ../../ refers to the grandparent directory, ../../../ refers to the great-grandparent directory, and ../../../../ refers to the great-great-grandparent directory. In this case, you can "walk-back" the final /lib four times so /usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib is an alias for /usr/lib . That looks like it comes from the output of gcc -v <source_file> , which means its auto-generated in the process of compiling the compiler. Why its like that and not a 100% absolute path, I don't know. If you're interested on that point, you should query the gcc mailing lists.
In general, in your own compilations, you'll either use an absolute path like -L /usr/local/foo/lib or a relative path like -L ../foo/lib . You'd use the first if you're accessing a 3rd party library in a non-standard place - in this case /usr/local/foo/lib. The second case would normally be when the library is part of the current project.
|
|
|
|
|
-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib Should equal
-L/usr/lib/gcc/x86_64-linux-gnu/../../../lib equals
-L/usr/lib/gcc/../../lib equals
-L/usr/lib/../lib equals
-L/usr/lib
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Yes, I can see that . the question was - why ?
|
|
|
|
|
You asked:
Vaclav_ wrote: In this example I gather the "-L" is linked to "lib" four times.
Do not get it .
-L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib
Speaking for myself, the question asked suggests that you think the syntax somehow creates four links to "lib", and are unaware of the relationship between an absolute path and a relative path. Both Eddy Vluggen and I tried to answer the question we thought you had asked, and set you straight about what was going on here.
As I stated in my answer, I think this has come from gcc -v output. As I am not a gcc developer, I do not know why the compiler would generate such odd search paths. It could be something to do with hoops needed to generate correct path names on non unix-like operating systems, like say OpenVMS. The thing to do would be to ask the gcc developers mailing list. As it stands, it works fine, and I'm not aware of any significant performance penalty that accrues from doing things this way. Unless you're interested for interests sake, why worry about it? Essentially, it happens "under the hood" - without the -v option, gcc/g++/as/ld/etc can be considered a "black box" that takes in source code and produces either intermediate code [assembler (.s files) and object (.o files) being two possibilities], or an executable program. How it goes about it is, normally, uninteresting to the average developer. Sometimes, yes, you do need to get that information, particularly if you think you've found a bug and are working with the gcc development team to document the bug. Otherwise, we just loop through the "edit, compile, test" loop until we, or our customer, are happy with the results, not worry about how the compiler, or editor, or link-loader, etc actually do their work.
|
|
|
|
|
The only reason I can come up with, is to ensure that the "gcc/x86_64-linux-gnu/5" folder exists as it would fail if it doesn't.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Paths like that usually come from the config when you build the package on a local machine. Config scripts try to be all things to all people so often create what looks like illogical paths, but are necessary because of the way the scripts analyse a local system.
|
|
|
|
|
Are you saying that it came from the way Eclipse was installed and how IDE relates to the "tool chain"?
I need better understanding of this "install" process.
Especially how piece parts of the "application install " are spread into different Linux folders.
I do not see any point to "hit the books" until I run into issues like this.
Pretty munch tired of not knowing these "under the hood" processes - from the ground up.
This thread answered some of my questions, and I appreciate that.
I think will apply my newly acquired knowledge to get better understanding how Linux "packages" are processed / installed.
Thanks
|
|
|
|
|
See title.
Here is lscpu output on x86.
jim@jim-desktop:~$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 55
Model name: Intel(R) Celeron(R) CPU J1900 @ 1.99GHz
Stepping: 3
CPU MHz: 2415.718
CPU max MHz: 2415.7000
CPU min MHz: 1332.8000
BogoMIPS: 3998.40
Virtualization: VT-x
L1d cache: 24K
L1i cache: 32K
L2 cache: 1024K
NUMA node0 CPU(s): 0-3
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 movbe popcnt tsc_deadline_timer rdrand lahf_lm 3dnowprefetch epb pti ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid tsc_adjust smep erms dtherm ida arat
Ana here is what armv7l saiz about bits - nothing.
pi@pi:~ $ lscpu
Architecture: armv7l
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
Model: 4
Model name: ARMv7 Processor rev 4 (v7l)
CPU max MHz: 1200.0000
CPU min MHz: 600.0000
BogoMIPS: 38.40
Flags: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
Is this Linux distro depended ? Ubuntu versus Rasbpian?
Just asking.
|
|
|
|
|
The Architecture type x86_64 tells you the hardware is 64 bit Intel architecture. The operating modes tell you it can run 32-bit or 64-bit applications.
|
|
|
|
|
|
I have given up on building bluez library from source.
Now my question is
how to option / instruct (gcc) compiler / linker to use libbluetooth-dev on native OS?
I have downloaded correct version but have no clue how to or where to option the compiler / linker.
I also like to use correct terminology for the "libbluetoooth-dev" .
Is is a libray or package or what ?
When get the above answered I should be able to apply it to different architecture.
I have also run into some kind of "foregin package " options, but not sure I need it. Maybe later.
Help is much appreciated.
Cheers
|
|
|
|
|
What is "libbluetoooth-dev "? Unix/Linux libraries should have a .a (archive) or .so (shared object) extension to identify the type of library. I have explained a number of times that to include a library named libxxx.a or libxxx.so , you should add an option of the form -lxxx to your build (either gcc or ld). If the name of the library does not follow the standard conventions, then use -l:filename .
For all ld opions see ld(1): GNU linker - Linux man page[^].
|
|
|
|
|
Partially answered my own question - libbluetooth-dev is a "package".
Using it / linking to it is non issue.
|
|
|
|