Linux Command to revive process [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 5 years ago.
Improve this question
Is there a Unix command that monitors arbitrary processes and revive those processes if they got killed by the OS? For example, I have a background daemon that executes periodically but sometimes it would get killed by the OS. I'd like to either revive either that process again or something similar.

Given the vague nature of this question and what the OP has tried, here is an answer. A recent Ubuntu (assumes from the tag), OP uses a systemd system, and in this kinda system, one could write a systemd service script that would restart the daemon if it exits;
~]# cat /usr/lib/systemd/system/myawesome.service
[Unit]
Description=My Awesome Service
After=systemd-logind.service
[Service]
Type=notify
ExecStart=/path/to/my/awesome/daemon
KillMode=process
Restart=always
[Install]
WantedBy=multi-user.target
Then start this service,
~]# systemctl start myawesome.service
~]# systemctl enable myawesome.service # To sustain after a reboot
To know more about systemd service unit files, follow this links:
https://www.freedesktop.org/software/systemd/man/systemd.service.html
https://www.freedesktop.org/software/systemd/man/systemd.unit.html

Related

Cannot mount windows share on boot using fstab [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 12 months ago.
Improve this question
I've got a problem on Debian 10.11 (but I think it's not only Debian related) with onboot mounting Windows share.
cifs-utils 2:6.8-2 amd64 Common Internet File System utilities
cat /etc/fstab | grep share2
gives
//10.100.0.204/share2 /home/share2 cifs auto,vers=default,rw,file_mode=0775,dir_mode=0775,noperm,gid=100,username=user1,password=passwordhard 0 0
When I type:
command mount /home/share2 Works as expected.
dmesg gives me an errors:
[ 5.045482] CIFS VFS: Error connecting to socket. Aborting operation.
[ 5.046471] CIFS VFS: cifs_mount failed w/return code = -101
I think that linux tries too early to mount samba shares.
What can I do about it?
I know that I can use crontab and:
#reboot root sleep 15; mount /home/share2
as workaround but I like resolving problems at source.
If the problem is indeed samba service is loading too fast.
It is possible to edit samba service file.
Add Requires=<a service-name that need to be loaded prior to samba>
This trick is the official pattern to control/manage/order systemd service loading.

Error while installing Antmedia on windows using ubuntu terminal [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 2 years ago.
Improve this question
I was trying to install antmedia and at the time of running the server i got the error :
System has not been booted with systemd as init system (PID 1). Can't
operate.
These are the steps i followed:
Step 1:
wget https://github.com/ant-media/Ant-Media-Server/releases/download/ams-v2.1.0/ant-media-server-2.1.0-community-2.1.0-20200720_1340.zip
Step 2:
unzip ant-media-server-2.0.0-community-2.0.0-20200504_1842.zip
Step 3:
wget https://raw.githubusercontent.com/ant-media/Scripts/master/install_ant-media-server.sh && chmod 755 install_ant-media-server.sh
Step 4:
sudo ./install_ant-media-server.sh ant-media-server-2.0.0-community-2.0.0-20200504_1842.zip
Step 5:
service antmedia status
After runnning "Step 4" I got the error at the last.
Any Solution for this?
or
Am I doing something wrong?
The error I got:
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
E: Command line option 'y' [from -y] is not understood in combination with the other options.
update-alternatives: error: no alternatives for mozilla-javaplugin.so
update-java-alternatives: plugin alternative does not exist: /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/IcedTeaPlugin.so
System has not been booted with systemd as init system (PID 1). Can't operate.
antmedia: unrecognized service
antmedia: unrecognized service
There is a problem in installing the ant media server. Please send the log of this console to contact#antmedia.io
ScreenShot of Terminal
As I understand, you are using Ant Media Server in Ubuntu environment with Windows system. We recommend using Ant Media Server as a start.sh script instead of a service. The other choice is using Ant Media Server in Virtualbox or Vmware.

how to disable dnsmasq service in CentOS 8 [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 2 years ago.
Improve this question
I am install kubernetes v1.18 in CentOS 8, but the coredns start failed, tell me the port 53 is in using, and I using this command to find which app using the port:
lsof -i:53
then I found dnsmasq service are using this port, how to disable or close the auto start the dnsmasq service in CentOS 8? I am trying to kill the process but next time it still started, then using this command but not works:
systemctl disable dnsmasq
besides systemctl disable dnsmasq,
sudo sed -i 's/^dns=dnsmasq/#&/' /etc/NetworkManager/NetworkManager.conf
then restart the networking services
sudo service network-manager restart
sudo service networking restart
after that kill dnsmasq
sudo killall dnsmasq

Can Linux Container run on a virtual machine? [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 8 years ago.
Improve this question
As far as I know, Linux container is different from virtual machine. It's lightweight virtualization technology. So I'm wondering if it can be run on a virtual machine which provisioned by hypervisor like xen, kvm or vmware?
I was trying setup a Linux container(docker + LXC userspace tool) on a virtual machine based on zex. It failed.
[root#docker lib]# service docker start
Starting cgconfig service: Error: cannot mount cpuset to /cgroup/cpuset: Device or resource busy
/sbin/cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failed
Failed to parse /etc/cgconfig.conf [FAILED]
Starting docker: [ OK ]
and if trying to run a container:
root#docker lib]# docker run -i -t ubuntu /bin/echo hello world
lxc-start: error while loading shared libraries: liblxc.so.1: cannot open shared object file: No such file or directory
2014/03/27 14:03:27 Error: start: Cannot start container da0d674d3e31a7c36a9e352f64fd84986cbb872e526cb2dd6adb7473d4f5a430: exit status 127
Actually, I followed a blog to do, the author made it, while I screw it.
Any one can explain that? Or simply tell me it can not be ran on a virtual machine. Really appreciate.
Yes, it can. If your VM's operating system supports the appropriate filesystems, and have containers. I suggest you go though as suggested on https://www.docker.io/gettingstarted/ and use a recent Ubuntu release, since that is known to work.

Why ntpd service is not started automatically after reboot? [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 8 years ago.
Improve this question
After I installed ntpd via yum I run the command systemctl enable ntpd.service and rebooted the computer. After I got the shell prompt I run systemctl -a | grep ntp and I got ntpd.service loaded inactive dead. If I start it manually using systemctl start ntpd.service it works fine. Why is that? How can I ensure the ntpd.service will be up and running after reboot?
This appears to be an issue with fedora, there is a service named "chrony" which prevents ntpd service to start after boot. After removing chrony with yum, ntpd service is started after boot. For more details you can check this.
UPDATE: You can also disable the chronyd that runs on port 123 and then ntpd will start:
sudo systemctl disable chronyd
sudo systemctl start ntpd

Resources