Shell screen dies inside jail

For some reason my screen sessions disappears, when I disconnect from my shell to a jailed system. So when I connect back to sshd and type screen -rD then there's no screen to reattach.
 
I'm not seeing that using either the jexec <JID> tcsh method of starting a shell within a jail or the ezjail-admin console <jail>. I'm just doing the Ctrl-A - D to detach and checking with screen -ls before quitting. It's still there when I SSH in and I can attach to it. What are the steps you are doing?
 
I think I found the reason, .. I've removed
Code:
daily_clean_tmps_enable="yes"
from /etc/periodic.conf. Up until now there still running since Thursday.

I can also recreate it, for instance if I remove /tmp/screens and reconnect to the shell then they do not exist anymore.
 
You can also take a look at the daily_clean_tmps_ignore variable in /etc/defaults/periodic.conf and append to it as shown in some of the examples in that file. If you still want left behind files to be cleaned up that may be the cleanest solution.
 
Would I have to include the directories or would this do:

Code:
daily_clean_tmps_ignore="$daily_clean_tmps_ignore *.pts-*.*"

And how do I keep the main jail system from cleaning the jail systems. Because I might want to clean the /tmp directory of the main system but not necessary that of the jail systems.
 
And how do I keep the main jail system from cleaning the jail systems. Because I might want to clean the /tmp directory of the main system but not necessary that of the jail systems.
The host does not clean a jail's /tmp, this is done by the jail itself (unless the host and jail share the same filesystem, which is not recommended).

You can also set SCREENDIR to, for example, /var/run/ instead.
 
All my jails are in /usr/jails would you consider that the same filesystem.
They're different. If you look closely you'll notice each jail will have a /usr/jails/<jailname>/tmp. Therefor each jail has it's own /tmp.
 
Yeah I know just wanted to make sure, I was understanding it properly. However I can see that my main system is also cleaning files on the jails, it shows in the daily run output report, that it deleted files from the jail file system.

For example it shows:
Code:
Cleaning disks:
/usr/jails/sample/usr/home/sample/irclogs/2015/EFnet/#apache.01-14.log

However that might be 100.clean-disks rather then 110.clean-tmps.

The thing is, .. I didn't set:
Code:
daily_clean_tmps_enable="yes"
on the jail systems, .. and yet it deleted the screen files from the /tmp directory, on the main system the screen files kept intact and screen kept working.
 
Looking at /etc/periodic/daily/100.clean-disks, it looks far more aggressive as it does a find / <args>. However, it is only looking for a smaller subset of files in the daily_clean_disks_files variable. That would match your IRC logs because of the "#" symbol but shouldn't match the screen logs.

The /etc/periodic/daily/110.clean-tmps only looks at /tmp by default so as SirDice mentioned the host would not clean the jails directories by default. Because of that you could use the following periodic.conf entries on the host and all jails.

Code:
daily_clean_tmps_enable="YES"
daily_clean_tmps_ignore="$daily_clean_tmps_ignore *.pts-*.*"

However, if you have only ever set this on the host then the jails would not be cleaned up by it. Are you sure that you are losing your Screen sessions after periodic(8) does it's thing everyday and it's not something else?
 
Well I haven't lost them since, iI could re-enable it and see what happens. However clean disks are still running.
 
Back
Top