amuck-landowner

screen at bootup?

mtwiscool

New Member
I want to be able to run screen with a .sh script at boot up.

I have tried corn jobs but it won't launch.

Is they any way to do this?
 

Mun

Never Forget
nano /etc/rc.local

Before the exit put your command with 'screen -d -m' before it. If you don't wish to run as root then su - <user> -c "screen -d -m command" &

Then exit and restart server to check.
 

mtwiscool

New Member
nano /etc/rc.local

Before the exit put your command with 'screen -d -m' before it. If you don't wish to run as root then su - <user> -c "screen -d -m command" &

Then exit and restart server to check.
Not working :(

Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
screen -d -m ./1.sh
exit 0
 

mtwiscool

New Member
Your need to put the full location of the script and not ./

,Ashley
Code:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
screen -d -m /root/1.sh
exit 0
 

tonyg

New Member
Just create a new /etc/init.d/ script and launch it from there.

Forget about /etc//rc.local
 
Last edited by a moderator:

mtwiscool

New Member
Just create a new /etc/init.d/ script and launch it from there.

Forget about /etc//rc.local
my sh script.

Code:
#!/bin/bash
tcptunnel --local-port=22 --remote-port=4722 --remote-host=95.128.47.39 --bind-address=23.94.62.8 --stay-alive & tcptunnel --local-port=80 --remote-port=4723 --remote-host=95.128.47.39 --bind-address=23.94.62.8 --stay-alive & tcptunnel --local-port=22 --remote-port=5522 --remote-host=95.128.47.39 --bind-address=23.94.62.7 --stay-alive & tcptunnel --local-port=80 --remote-port=5524 --remote-host=95.128.47.39 --bind-address=23.94.62.7 --stay-alive
 

tonyg

New Member
my sh script.


#!/bin/bash
tcptunnel --local-port=22 --remote-port=4722 --remote-host=95.128.47.39 --bind-address=23.94.62.8 --stay-alive & tcptunnel --local-port=80 --remote-port=4723 --remote-host=95.128.47.39 --bind-address=23.94.62.8 --stay-alive & tcptunnel --local-port=22 --remote-port=5522 --remote-host=95.128.47.39 --bind-address=23.94.62.7 --stay-alive & tcptunnel --local-port=80 --remote-port=5524 --remote-host=95.128.47.39 --bind-address=23.94.62.7 --stay-alive
Where is the screen command?

Which OS?
 

raj

Active Member
@OP can you elaborate on what "doesn't work" means?  Are you seeing errors in your logs?  Did it do nothing? Is it giving you a path issue?
 

raj

Active Member
Depends on what you're running.  Check /var/log/messages or /var/log/syslog or /var/log/daemon or something of that sort. 
 
Top
amuck-landowner