Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i am new to screen command. i use screen command now frequently to monitor server logs in multiple split screens. but when i leave the office i just close the terminal. Is this ok or do i need to close that screen session?
Your description is a bit on the ambiguous side, but if I'm understanding you correctly, yes, you can close the terminal window. It may be best practice to lock your screen (usu. <CTRL> + <ALT> + <L> or from a menu). If you're opening another TTY session, you can just press <CTRL> + <D> to log out, and <CTRL> + <ALT> + <F7> to switch back to the GUI.
when i come to office, i open terminal, type Screen and execute few commands that monitor logs, for example :
#screen
#tail -f /var/log/exim_mainlog
Ctrl + a
ctrl + c
#tail -f /var/log/maillog
Ctrl + a
Ctrl + S [To split the screen]
now you can see two live monitoring services are runnign on.
when i leave the office, i just close the terminal.
on the next day, same procedure, i open terminal, type screen, and type above things.
now what my doubt is, the screen session which i started yesterday to montior the logs is still running on the target machine even after i close the terminal?
actually i close the terminal when leavign the office, so i think screen commands i executed
>> when i leave the office i just close the terminal. Is this ok or do i need to close that screen session?
Pls advise.
it's ok...
but if you like what it does depends on your intent
example: i telnet to pheebor.com and login as foo, i run screen, and in one (window) i run updatedb(1) (builds db for locate(1). then i ponder logging out and it's effects.
it might be my intent if I ^D^D that terminates telnet on server side, that updatedb stops running ... it might be my intent it continues running
did i run
$ screen &
or
$ screen
and same question for apps run in screen. now also note sh(1) has forking and job control, and see sh(1) manpage about whether sh(1) will attempt to terminates job controlled jobs when it exists. (and that not all sh support job control, etc)
and the answer is simple: use ps(1) to see if screen closes (do this from a different console), and see if things screen was running that you didn't exist are active
if they are and you don't want that: well that's what GNU screen loves to do: gives you ways to do as intended with your virtual consoles in a console
If all you did was close the terminal window (with the X in the top corner) then the screen session is still running.
^ this
Use "screen -ls" to list your currently open screen sessions. You can reconnect to them with "screen -r name".
I'm a little confused though, if you open a terminal and run a tail every day, why are you running screen in the first place? The point of screen is so that you can disconnect/reconnect to a terminal session without stopping the processes running inside. This seems to be the opposite of how you're trying to use it. In other words, why are you using screen when you're just running a tail and you re-open it every morning regardless?
Last edited by suicidaleggroll; 12-02-2015 at 11:40 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.