No coredump file generated in configured directory sometimes [closed] - linux

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 Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I configured one of my Ubuntu1804 user to dump ,
> ulimit -a | grep core
core file size (blocks, -c) unlimited
> cat /proc/sys/kernel/core_pattern
/var/tmp/cores/core.%e.%p.%h.%t.%s
> ls /var/tmp/cores/ -ld
drwxrwxrwx 2 root root 36864 Mar 10 00:05 /var/tmp/cores/
I can get most of the core dumps of crashed process in /var/tmp/cores, but sometimes some crashed process caused by SIGTERM has no coredump file in the directory.
I checked the log of the process missing process, the log said the aborting signal was SIGTERM.
So how came no dump file for it ?

the default action in Linux as described in man 7 signal is to terminate without coredump.
Signal Value Action Comment
────────────────────────────────────────────────────────
SIGTERM 15 Term Termination signal

Related

Why does one command need sudo but the other one doesn't with the same permissions [closed]

Closed. This question is not about programming or software development. 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 Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 days ago.
Improve this question
I have the bzcat command with the following permissions:
-rwxr-xr-x 3 root root 39144 Sep 5 2019 /bin/bzcat
I have the bzmore command with the following permissions:
-rwxr-xr-x 1 root root 1297 Sep 5 2019 /bin/bzmore
And I have a bz2 zip file:
-r-------- 1 root root 61 Feb 17 14:37 flag.bz2
When I use bzmore flag.bz2 it works fine. But when I use bzcat flag.bz2 I get Can't open input file flag.bz2: Permission denied.. Why is this? If I put sudo in front of bzcat it works fine too but why doesn't bzmore need this when they both have the same permissions.
I tried running all the commands to test out what happened.

Why Ubuntu 18.04 use `/sbin/init` instead of `systemd`? [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 Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
First of all, Here is my environment of system:
# cat /proc/version
Linux version 4.15.0-52-generic (buildd#lgw01-amd64-051) (gcc version 7.3.0 (Ubuntu 7.3.0-16ubuntu3)) #56-Ubuntu SMP Tue Jun 4 22:49:08 UTC 2019
# cat /etc/issue
Ubuntu 18.04.2 LTS \n \l
Refer to this Ubuntu Wiki, ubuntu has used Systemd by default since 15.04 and Systemd runs with PID 1 as /sbin/init. However, I found the different result on my ubuntu 18.04:
# ps aux | awk '$2==1{print $0}'
root 1 0.0 0.8 159692 8784 ? Ss Oct24 0:21 /sbin/init noibrs splash
# lsof -p 1 | grep txt
systemd 1 root txt REG 252,1 1595792 927033 /lib/systemd/systemd
So, my question is that:
Why Ubuntu 18.04 use /sbin/init instead of /lib/systemd/systemd?
Why lsof -p 1 | grep txt return /lib/systemd/systemd while the process of PID 1 is /sbin/init?
/sbin/init is a symbolic link to /lib/systemd/systemd
Take a look at the output of stat /sbin/init or readlink /sbin/init
This is what they mean by systemd "running as /sbin/init". The systemd binary is linked as /sbin/init and started by that link name.
Update
To further explain the difference between the ps and lsof output: ps is showing the command that started the process, while lsof is showing which files a process has opened.
When systemd was started, it was called by /sbin/init noibrs splash, the file system resolved the link to the file /lib/systemd/systemd which was then read from disk and executed.

cannot delete /var/log/acpid file [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 Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I am the owner of this file, and have the right permission I think. Why can't I do the operations below:
(I have to delete it. My / is almost full.)
[root#DBsvr log]# ll -ah acpid
-rw-r----- 1 root root 84G Jun 1 14:14 acpid
[root#DBsvr ~]# rm -rf /var/log/acpid
rm: cannot remove `/var/log/acpid': Operation not permitted
[root#DBsvr ~]# > /var/log/acpid
-bash: /var/log/acpid: Operation not permitted
[root#DBsvr ~]# chmod 660 /var/log/acpid
chmod: changing permissions of `/var/log/acpid': Operation not permitted
In order to change permissions and / or delete a file you need write permissions to the parent directory of the file. Also, the file's attributes might come into play too (see man chattr).
Please note also that deleting a file while a process still has the file open won't free the disk space occupied by the file. This is the case if you remove for example a log file while syslogd still tries to write to it.
Thank Sato Katsura for helping me.
[root#DBsvr log]# lsattr /var/log/acpid
-----a------- /var/log/acpid
[root#DBsvr log]# chattr -a /var/log/acpid
Then I can delete it.

Trouble running statrup script on Linux [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
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 Exchange site, you can leave a comment to explain where the question may be able to be answered.
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 Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I'm using the Amazon flavor of Linux
uname -a
Linux mydomain.org 3.19.25-82.99.amzn1.x86_64 #1 SMP Wed Dec 3 21:29:43 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
and I want to run the following script upon system reboot ...
ls -al /home/davea/install/apache-tomcat-6.0.35/bin/startup.sh
-rwxr-xr-x 1 davea mycompany 2023 Nov 28 2011 /home/davea/install/apache-tomcat-6.0.35/bin/startup.sh
So I created this file,
-rwxr-xr-x 1 root root 73 Dec 10 19:29 /etc/init.d/start_tomcat
with the lines
#!/bin/sh
sh /home/davea/install/apache-tomcat-6.0.35/bin/startup.sh
However, when I reboot my system, this script isn't getting invoked. What steps have I left out? I can run the script fine at a command line when I'm logged in.
Edit: Also, I created this symlink in /etc/rc.d ...
ls -al /etc/rc.d/start_tomcat
lrwxrwxrwx 1 root root 24 Dec 10 19:29 /etc/rc.d/start_tomcat -> /etc/init.d/start_tomcat
Still no luck.
You have to add the start-up script under init.d to your default runlevel.
sudo update-rc.d /etc/init.d/start_tomcat defaults
Which should create symlinks to your script under the appropriate /etc/rc?.d folder(s).
This depends on which startup program is being used. Assuming you have privileges to do so, and if the star up program is the chkconfig program your etc/init.d/start script must follow suit in that you need such header fields like:
# chkconfig: <levels> <start> <stop>
# description: <some description>
For other programs, like systemctl (redhat/fedora) you'll need to create a file with directives in it in the following folder:
/etc/systemd/system/
You'd typically make a file called serviceName.service with the following entries:
[Unit]
Description=MyApp
[Service]
ExecStart=/path/to/myService/executable.sh
[Install]
WantedBy=multi-user.target
Then run:
sudo systemctl enable /etc/systemd/system/hello.service
sudo systemctl start hello.service
If this is a LSB (Linux Standards Based) OS/Startup you should follow the tutorial below:
https://wiki.debian.org/LSBInitScripts

Reserved Process ID [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
As per my knowledge Process ID 1 is reserved for init.
What does process id 2 indicate? why no softlink to the binary executable for this process ID.
sudo ls -l /proc/1/exe
lrwxrwxrwx 1 root root 0 Apr 24 14:53 /proc/1/exe --> /sbin/init
But for /proc/2/exe
ls : cannot read symbolic link /proc/2/exe: No such file or directory
lrwxrwxrwx 1 root root 0 Apr 24 14:53 /proc/2/exe
Im using Ubuntu 12.04.
pls share your knowledge.
It's because there is no binary to link to. This process was probably started by the kernel itself. Take a look at the out put of ps aux. Any process you see listed in brackets will not have a exe soft link either.
because at the moment you are asking there is no process of pid 2.
the kernel allocates pids at will.
Or because pid 2 is for some kernel task; on my machine it is for kthreadd which is some pure kernel process. See this answer.

Resources