FreeBSD bugmaster | 3 Aug 2009 13:07
Picon
Favicon

freebsd-jail@...

Note: to view an individual PR, use:
  http://www.freebsd.org/cgi/query-pr.cgi?pr=(number).

The following is a listing of current problems submitted by FreeBSD users.
These represent problem reports covering all versions including
experimental development code and obsolete releases.

S Tracker      Resp.      Description
--------------------------------------------------------------------------------
o kern/133265  jail       [jail] is there a solution how to run nfs client in ja
o kern/119842  jail       [smbfs] [jail] "Bad address" with smbfs inside a jail
o bin/99566    jail       [jail] [patch] fstat(1) according to specified jid
o bin/32828    jail       [jail] w(1) incorrectly handles stale utmp slots with 

4 problems total.

Michael Scheidell | 6 Aug 2009 16:12

crontab hanging won't die on SIGTERM in jail

anyone having problems during an in jail shutdown with crontab hanging?
I have seen this in 6.4 and 7.1, on i386 and amd64.
I don't remember problems with 6.3

using jailtools (jkill -r), OR
shutdown -r +0

OR

 reboot
reboot: SIGTSTP init: No such process

truss shows:
truss -p 87553
(null)()                                         = 0 (0x0)
gettimeofday({1249567500.835698},0x0)            = 0 (0x0)
stat("tabs",{mode=drwx------ ,inode=10458278,size=512,blksize=4096}) = 0 
(0x0)
stat("/etc/crontab",{mode=-rw-r--r-- 
,inode=10461256,size=748,blksize=4096}) = 0 (0x0)
gettimeofday({1249567500.836244},0x0)            = 0 (0x0)
fork()                                           = 88217 (0x15899)
gettimeofday({1249567500.836862},0x0)            = 0 (0x0)
nanosleep({60.000000000})                        ERR#4 'Interrupted 
system call'
SIGNAL 20 (SIGCHLD)
SIGNAL 20 (SIGCHLD)
wait4(0xffffffff,0xbfbfe99c,0x1,0x0)             = 88217 (0x15899)
wait4(0xffffffff,0xbfbfe99c,0x1,0x0)             ERR#10 'No child processes'
sigreturn(0xbfbfe9d0)                            ERR#4 'Interrupted 
(Continue reading)

Michael Scheidell | 6 Aug 2009 16:23

Re: crontab hanging won't die on SIGTERM in jail

this doesn't stop cron:

/etc/rc.d/cron stop
(just keeps spitting out the pid)

killall -SIGTERM cron (doesn't work)

killall -SIGQUIT|SIGKILL seems to work.

Workaround is this:

echo "sigstop=SIGQUIT" > /etc/rc.conf.d/cron

works fine now.

isn't needed in base, just in jail.

Michael Scheidell wrote:
> anyone having problems during an in jail shutdown with crontab hanging?
> I have seen this in 6.4 and 7.1, on i386 and amd64.
> I don't remember problems with 6.3
>
>
> using jailtools (jkill -r), OR
> shutdown -r +0
>
> OR
>
> reboot
> reboot: SIGTSTP init: No such process
(Continue reading)

Michael Scheidell | 6 Aug 2009 17:03

Re: crontab hanging won't die on SIGTERM in jail

meant sig_stop=.

stranger yet, this works:

echo 'sig_stop=SIGTERM' > /etc/rc.conf.d/cron

truss shows the sigterm now just fine.

Michael Scheidell wrote:
> this doesn't stop cron:
>
> /etc/rc.d/cron stop
> (just keeps spitting out the pid)
>
> killall -SIGTERM cron (doesn't work)
>
> killall -SIGQUIT|SIGKILL seems to work.
>
>
> Workaround is this:
>
> echo "sigstop=SIGQUIT" > /etc/rc.conf.d/cron
>
> works fine now.
>
>
> isn't needed in base, just in jail.
>
>
>
(Continue reading)

Marco Steinbach | 6 Aug 2009 17:30
Picon

Re: crontab hanging won't die on SIGTERM in jail

Michael Scheidell schrieb:
> anyone having problems during an in jail shutdown with crontab hanging?
> I have seen this in 6.4 and 7.1, on i386 and amd64.
> I don't remember problems with 6.3
> 

Using 6.3, 6.4 and 7.2 on i386 and amd64, I never experienced this 
behaviour.  To make sure, I just tried killall -SIGTERM cron and 
/etc/rc.d/cron stop in several jails on different machines, and this 
seems to work as intended for me.

MfG CoCo
Michael Scheidell | 6 Aug 2009 17:50

Re: crontab hanging won't die on SIGTERM in jail

then doing this doesn't make any sense (but fixed it)

echo 'sig_stop=SIGTERM' > /etc/rc.conf.d/cron

or, this even fixed it:

echo 'sig_stop=SIGTERM' >> /etc/rc.conf

the 'killall -SIGTERM cron' worked UNLESS I HAD PREVIOUSLY TRIED 
/etc/rc.d/cron stop.

now, with sig_stop in a conf file, it works.  doesn't make sense, but works.

Something, somewhere, somebody is masking or setting sig_stop to '' as a 
default.  I can't find it.

rc.subr seems to indicate it will set it to SIGTERM if undef:

grep sig_stop /etc/*
rc.subr:#                       kill $sig_stop $rc_pid
rc.subr:#                       ($sig_stop defaults to TERM.)
rc.subr:                        _doit=$(_run_rc_killcmd "${sig_stop:-TERM}")

nothing in /etc/defaults/* or /etc/rc.conf overrides it

grep sig_stop /etc/defaults/*

grep sig_stop /etc/rc.d/cron
grep sig_stop /etc/rc.d/*
/etc/rc.d/nfsd:sig_stop="USR1"
(Continue reading)

Stef Walter | 6 Aug 2009 18:11

Re: crontab hanging won't die on SIGTERM in jail

Michael Scheidell wrote:
> anyone having problems during an in jail shutdown with crontab hanging?
> I have seen this in 6.4 and 7.1, on i386 and amd64.
> I don't remember problems with 6.3

I see this same problem in certain jails. A jail that has this problem
does it consistently, jails without the problem (on the same machine,
same FreeBSD userland/kernel) don't have the problem consistently.

In these cases, sending cron the TERM signal just doesn't do anything.

You have to wait for at least one minute after jail startup for cron to
get into this unTERMable state.

I haven't had time to do further debugging on this, but I figured I'd
pitch in with what I've experienced.

Cheers,

Stef

Michael Scheidell | 6 Aug 2009 19:17

Re: crontab hanging won't die on SIGTERM in jail


Stef Walter wrote:
> Michael Scheidell wrote:
>   
>> anyone having problems during an in jail shutdown with crontab hanging?
>> I have seen this in 6.4 and 7.1, on i386 and amd64.
>> I don't remember problems with 6.3
>>     
>
> I see this same problem in certain jails. A jail that has this problem
> does it consistently, jails without the problem (on the same machine,
> same FreeBSD userland/kernel) don't have the problem consistently.
>
> In these cases, sending cron the TERM signal just doesn't do anything.
>
> You have to wait for at least one minute after jail startup for cron to
> get into this unTERMable state.
>
>   
YOU ARE RIGHT!  it is intermentent.
Try this (for me) on those boxes (before you try /etc/rc.d/cron restart:

echo 'sig_stop=SIGKILL' > /etc/rc.conf.d/cron

you arn't running ezjail, are you? could there be anything in ezjail 
that would do this?

yes:
boot someone in jail.
/etc/rc.d/cron restart
(Continue reading)

Stef Walter | 7 Aug 2009 03:11

Re: crontab hanging won't die on SIGTERM in jail

Michael Scheidell wrote:
> you arn't running ezjail, are you? could there be anything in ezjail
> that would do this?

I'm not running ezjail, and I don't think it's related.

For me the common denominator for the jails that exhibit this, is that
java (java/jdk15) is started from an rc.d script. This is anecdotal at
best.

It also doesn't happen immediately. Today I was playing with such a jail
and cron would happily restart (ie: '/etc/rc.d/cron restart') until I
left it alone for a few hours.

I have a dummy cron job (eg: /usr/bin/true), which runs every minute.
/var/log/cron shows that the job is still being run even when cron is
ignoring the TERM signal.

Cheers,

Stef

Stef Walter | 7 Aug 2009 03:14

Re: crontab hanging won't die on SIGTERM in jail

Michael Scheidell wrote:
>>> anyone having problems during an in jail shutdown with crontab hanging?
>>> I have seen this in 6.4 and 7.1, on i386 and amd64.
>>> I don't remember problems with 6.3

Oh, and I'm seeing it on 6.3-RELEASE-p12 i386 userland jails running on
7.2-RELEASE-p1 amd64 kernel. I'll try to migrate one of the offending
jails to a system with the same kernel version as the jail.

That's why I didn't post about this earlier: I'm sufficiently off the
beaten path, to not expect help debugging such things... :S

Cheers,

Stef


Gmane