Thursday, May 14, 2009

Cron jobs not running & showing "bad user" in logs /var/cron/log

My user informed that the application user (locked) account's cron jobs were not running even after initial setup/ allowing in cron.allow file by system administrator. When I checked the log file (/var/cron/log) in Solaris 10, I could see some entries like:


> CMD: /bin/touch /tmp/kjsdfhsdjk
> appuser 4193 c Wed May 13 03:27:00 2009
! bad user (appuser) Wed May 13 03:27:00 2009
< appuser 4193 c Wed May 13 03:27:00 2009 rc=1
> CMD: /bin/touch /tmp/kjsdfhsdjk
> appuser 4252 c Wed May 13 03:28:00 2009
! bad user (appuser) Wed May 13 03:28:00 2009
< appuser 4252 c Wed May 13 03:28:00 2009 rc=1


Solution was to change "*LK*" to "*LOCKED*" in /etc/shadow file.


# diff shadow shadow-ori
136c136
< appuser:*LOCKED*:14293::::::
---
> appuser:*LK*:14293::::::


This change happened in Solaris 10 only because prior to Solaris 10, the locked accounts used to have "*LK*" in /etc/shadow entries.


If in NIS, then make the maps again by running /var/yp/make. The following is applicable ONLY & ONLY in case of NIS. (Think twice before doing this!!)

# cd /var/yp; ./make
updated netid
pushed netid
updated passwd.adjunct
`group.adjunct.time' is up to date.
pushed passwd.adjunct
`group.adjunct.time' is up to date.
#

4 comments:

Unknown said...

Simple solution and really worked. thanks!

Anonymous said...

Thanks a ton.
Was facing the same issue, changing *LK* to *LOCKED* helped.

Thanks

Unix Geek said...

@Ying: Glad that it worked for you! :)

Unix Geek said...

@Anonymous: Thanks for the feedback.