dereenigne.org

reverse engineered

GNU Screen Autostart

I got a Debian based VPS recently, and every so often I find myself needing to reboot the server. I keep forgetting to start my GNU Screen and Irssi windows again though.

Adding the following line to /etc/rc.local allows GNU Screen to automatically run at boot time. This line runs Screen from my unpriviledged account, loads Irssi within that Screen, and then backgrounds itself, ready for the next time I login.

/bin/su unprivilegeduser -c "/usr/bin/screen -dmS sessionname /usr/bin/irssi"

EDIT: I’ve since ditched Screen in favour of tmux, and moved to a crontab for starting irssi after restarts.

Place the following in your local crontab file:

@reboot /usr/bin/tmux new-session -d -n irssi /usr/bin/irssi

comments powered by Disqus