# adjkerntz spam from a jail.



## jnbek (Apr 27, 2012)

I'*ve* been getting a lot of emails from the periodic crons over the last couple *of* weeks that read:


```
adjkerntz[66176]: sysctl(set: "machdep.wall_cmos_clock"): Operation not permitted
```

from my apache jail. I recently set the timezone in the jail using tzsetup because jail time didn't match the host time. Since then, I've been getting these offending emails every 30 minutes. It does seem that the jail time is correct, as the crons I have set to fire at 7am and 7pm every day, are now firing at those hours. I just want the sysctl emails from the jail to become silent. Any ideas?:\


----------



## aa (Apr 27, 2012)

Edit your /etc/crontab.


----------



## jnbek (May 1, 2012)

While that's a definite possibility there has to be a better way than just editing /etc/crontab. I need the time to be correct in the jail, I would just rather avoid getting spam..


----------



## jan (May 1, 2012)

*A* jail doesn't have its own timer. So the time is the same time from the base system. You can only control the timezone in a jail.

cheers Jan


----------



## jnbek (May 2, 2012)

jan said:
			
		

> *A* jail doesn't have its own timer. So the time is the same time from the base system. You can only control the timezone in a jail.
> 
> cheers Jan



Very odd, because all the jails (except the one spamming me) are set to UTC but the base system is set to Mountain time (meaning the time is currently 6 hours ahead in the jails compared to the host system). How I managed that is beyond me, but it's annoying x(


----------



## jan (May 3, 2012)

*R*un [cmd=]tzsetup[/cmd] in your jails.


----------



## jnbek (May 6, 2012)

jan said:
			
		

> *R*un [cmd=]tzsetup[/cmd] in your jails.



I did that and that's when the spam started.


----------



## gqgunhed (Jul 25, 2012)

I have the same issue at my system. 
All jails I ran "tzsetup" in are producing the "adjkerntz" messages as stated above. 
Those jails running on UTC time do not have those errors.

Main system has the timezone set to CEST. No problem there.


----------



## gqgunhed (Oct 24, 2012)

Problem solved.
As aa stated with the first reply: You must deactivate (say comment out with #) the line in the /etc/crontab in the jail that has the adjkerntz entry.


```
# Adjust the time zone if the CMOS clock keeps local time, as opposed to
# UTC time.  See adjkerntz(8) for details.
#5,31    0-5     *       *       *       root    adjkerntz -a
```


----------



## bdrewery@ (Jul 19, 2022)

`rm /etc/wall_cmos_clock` also fixes the problem for jails without needing to modify the default /etc/crontab file.


```
# adjkerntz -a
adjkerntz 29443 - - sysctl(set: "machdep.wall_cmos_clock"): Operation not permitted
# rm /etc/wall_cmos_clock
# adjkerntz -a
```


----------

