I am trying to install the nohup
command. When I run sudo apt-get install nohup
I get:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package nohup
What is the issue here?
I am trying to install the nohup
command. When I run sudo apt-get install nohup
I get:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package nohup
What is the issue here?
I'm running KDE Neon which is Ubuntu 18.04 Bionic (LTS) with the latest KDE desktop packages on top of it.
Since upgrading to this from Xenial I have lost the ability for processes to survive SSH session disconnects... specifically nohup, tmux, screen, byobu and all their children are killed when disconnecting.
Here's a simple test to demonstrate the problem
# connect over ssh
cd /tmp
nohup watch date &
ps -ef | grep watch
# disconnect and reconnect
ps -ef | grep watch # process is gone
I tried reverting tmux and byobu to older versions before discovering nohup was also effected. This leads me to believe that it's either SSHd config or systemd.
Apparently systemd decided to change it's default behaviour to nuke all users processes when a user disconnects some time ago. I tried to revert the behaviour by editing /etc/systemd/logind.conf and setting KillUserProcesses=no and then rebooting (service systemd-logind restart didn't work). It didn't work... I'm at my wits end.
Help!
Server is Ubuntu 16.04. I have a process running with nohup
that logs into a local file. This file gets big enough to consume 100% disk space. To resolve this I have to kill the process first and then remove the log file. Then I restart the process. How can I resolve this with a script or some other tool?
I've got an init.d
script which I want it to work in the background, even when I quit from the terminal. However I've tried making it run in the background with nohup
but had "no hope", because when I quit, by looking at the pstree
I can see the PID disappears and thus nohup
stops working.
Q: Is there another apart from nohup
way of pushing a script that works in the foreground to the background, even after you quit the terminal?
I run my script with this command
nohup python a.py > /var/log/a.log 2>&1&
This is okay but every time I run this command /var/log/a.log file is truncated. Is there a way to append this file no matter what?