Screen session is not creating and running on Ubuntu [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 connected via ssh to my Ubuntu server.
And I want to create a screen session with a command to run sh script.
I'm trying to do it this way:
screen -dm -S myserver server/start.sh
But nothing happens.
Even screen list is empty.
screen -list
No Sockets found in /run/screen/S-root.
How can I fix it?
Ubuntu 20.04, Screen version 4.08.00 (GNU) 05-Feb-20
Also, I want to put this command on system unit, to make systemd to run the script at system boot. But I can't to make it runs even using a command via ssh.

The problem was that script was failing with an error. I should make cd to run the script.
screen -S myserver -dm bash -c "cd server;sh start.sh"

Related

Crontab has no access to docker commands [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 10 months ago.
Improve this question
Recently I started working on Ubuntu 18.04.4 LTS machine. I have created a small project which should run from a docker container with command:
docker run docker_name "2022-04-11"
This command runs like a charm when I run it manually (I have sudo permissions), but breaks when I try to run it from sudo crontab.
I tried to log all output from the crontab to file myjob.log with command:
0 1 * * * docker run docker_name "2022-04-11" >> /home/projects/project/myjob.log 2>&1
Then I saw that myjob.log file contains an error message:
/bin/sh: 1: docker: not found
It got me confused. Why I can run docker commands, but crontab can't?
Check you crontab you are probably missing something like:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
If you are running as your user not root you have to add it to the top.
The short of it is that your $PATH isn't set so you can't find the docker command.

CoTURN server stops after some time [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've installed CoTURN on Ubuntu 16.04 server. I'm starting the TURN server with the below command:
turnserver -a -o -v -n --cert /etc/letsencrypt/live/mydomain.com/fullchain.pem --pkey /etc/letsencrypt/live/mydomain.com/privkey.pem -u username:password -r "mydomain.com"
I check with Trickle ice and it works fine. But after some random time (typically in days) it stops working/shuts down.
Is there any way to run it forever or at least get an email if the service stops?
Thanks!
I use the NPM tool called PM2 for that. If the service goes down, you can get notifications. Monit can do that - and also restart if necessary.
npm i pm2
pm2 start turnserver
sudo apt install monit
nano /etc/monit/monitrc
Here you can find examples how to enable a specific service. In your case it's the turnserver.
Config

How can I pre-provide sudo access to pacaur in a shell script? [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 4 years ago.
Improve this question
I've got a shell script which is supposed to install some packages from the Arch User Repository. The shell script is as follows:
#!/bin/sh
pacaur -S google-chrome --noconfirm # install google-chrome
The problem is, if I run this script using sudo sh script.sh, it'll just return: "you cannot perform this operation as root". If I run it without sudo, it'll ask for sudo later on when installing.
My question is, how can I avoid it asking me. I'd like this script to take care of installing all my packages just as is, without requiring me to actually give access manually. Would there be a way?
If you run sudo -v before calling the pacaur, this will ask you for your credentials and cache them for the next 15 minutes. You don't need to call sudo with pacaur anymore. As long as pacaur finishes running within the next 15 minutes, it will not have to ask for credentials again.

execute script with parameters on linux boot [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 5 years ago.
Improve this question
I'm working with a Debian based Linux. Have a script that needs to be executed on boot. Found these instructions describing on how it needs to be one. My only difference is that I need to run a script with a parameter at bootup (myscript.sh --some-option 23). I can't use a wrapper script. I won't explain why, but I will only say that I just can't. Does anyone know how to do it?
The cron daemon has a #reboot command. That runs your script at reboot. So simply edit your crontab and add a line like this:
#reboot /your/script/test.sh
Assuming you are using a system with systemd, this is easy enough. Create a new service file "foo.service":
[Unit]
Description=Powertop autotune
[Service]
ExecStart=/usr/sbin/powertop --auto-tune # XXX replace with your command
[Install]
WantedBy=multi-user.target
and then install it:
ln -s /home/kris/Scripts/systemd/powertop.service /lib/systemd/system
systemctl enable powertop
systemctl start powertop
Obviously your paths and particulars will be different. In particular, the /lib/systemd/system might not be the right place in your distribution.

Can I Run docker on linux mint 13? [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've tried to install docker on my machine, following the instructions for Precise 12.04 found here.
When I try:
curl -sSL https://get.docker.com/ | sh
I get the result:
Either your platform is not easily detectable, is not supported by this
installer script (yet - PRs welcome! [hack/install.sh]), or does not yet have
a package for Docker. Please visit the following URL for more detailed
installation instructions:
https://docs.docker.com/en/latest/installation/
My kernel:
$ uname -r
3.13.0-61-generic
You can download the short installer script to take a look at why it is giving you this message:
curl -sSL https://get.docker.com/ >install-docker.sh
$EDITOR install-docker.sh
Doing that, I see several checks for lsb_release. Is your system missing that command? If so, see this to install it. Or maybe it’s not returning “ubuntu”. If you fix this, the docker installer script may work fine.
If that doesn’t work, you can hard-code a case for your OS (Mint?) in the ubuntu|debian case (line 243), like:
ubuntu|debian|linuxmint) # or maybe you’ll need here: *)
When done editing (or installing lsb_release), run the script to see if it will complete:
sudo ./install-docker.sh

Resources