I need to run tomcat on behalf of tomcat user. But in /etc/passwd I have the following line: So when I try to do this: sudo su tomcat ./bin/startup.sh It complains about: su: /bin/nologin: No such file or directory How do I execute the command with proper permissions? Thanks in advance! P.S. I’m trying …
Run processes with priority from shell (not “nice” )
I am looking for the equivalent command to nice, but for setting process priority and selecting the scheduler to use. I need to be able to type (or include in a script) something like run-with-scheduler batch a-big-long-command, or run-with-scheduler round-robin priority 10 to set the process priority and sch…
Program output changes when piped
I have a simple C program to time process startup (I’d rather not post the full code as it’s an active school assignment). My main function looks like this: sample_time() is a function that times how long it takes to fork a new process and returns the result in seconds as a double. The part of sam…
objdump -t /usr/bin/sort command shows no symbols
If I try objdump -t /usr/bin/sort command it says no symbols. But it seems to work on my programs. What is the reason for this? Answer The symbols of /usr/bin/sort has been removed, e.g. with the strip program – for most executables the symbol table is not needed (or only needed for debugging). Here is …
pthread_detach() causes SIGSEGV on 64 bit Linux
Here is a description of my situation: I have to take care of the bug in our product. The thread is created as joinable , it must do its work, terminate and nobody will call pthread_join() for it. So the thread is created with JOINABLE attribute (by default) and before termination it calls the next code: It w…
shm_open and ftruncate() in Shared Memory Programming
I want to create a Shared Memory Object and truncate it to a specific size. SHMSIZE is defined with 512 MODE is set with S_IRUSR | S_IWUSR | S_IWGRP | S_IRGRP | S_IWOTH | S_IROTH Here is my Code While Debugging i watched that the return value of shm_open() is 0 every time, but i can see this object in
How to undo rm -rf? [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack …
Debian test if load average shows real value
How can I test that my kernel is showing the correct load average ? The load is always high on this server, and I doubt it’s the real one. I use kernel 3.2.0 and Debian version 7.3 Answer If you are planning get more info directly from kernel, then it’s better to look at /proc/sched_debug (this re…
Installing ‘lxml’ in Amazon EC2
I am having trouble installing lxml in Amazon EC2. I am having a Linux instance. I entered the following command. Right now, it is not working. It just generate the following error. What is wrong here? How can I install this? Update I used pip install –upgrade setuptools. Now I am getting the below. Ans…
How to find which line is missing in another file
on Linux box I have one file as below A.txt Second file as below B.txt I want to know what is inside A.txt but not in B.txt i.e. it should print value 4 I want to do that on Linux. Answer didn’t test, give it a try