Not able to start cron service in Solaris 10

Hi,

This is Solaris-10 x86. I am not able to start cron service, configured in FMRI. It is in maintenance and when I clear it, it seems like calling and failing on /etc/init.d/tcs-rtm script. I am not able to figure out, why cron is calling that script, if this failure is because of that. Cron should be independent of any custom script. And from where, I can get rid of this dependency ?

# svcs -p cron
STATE          STIME    FMRI
maintenance    16:08:03 svc:/system/cron:default
# svcadm clear svc:/system/cron:default
# cd /var/svc/log
# tail -f system-cron:default.log
[ Oct 18 16:09:00 Executing start method ("/etc/init.d/tcs-rtm start") ]
/export/home/routadm/sms911/cfg/sms911.smsiot-tpcapp1.rtmgr.sh
su: Sorry
[ Oct 18 16:09:04 Method "start" exited with status 0 ]
[ Oct 18 16:09:04 Stopping because all processes in service exited. ]
[ Oct 18 16:09:04 Executing stop method ("/etc/init.d/tcs-rtm stop") ]
This feature is not implemented
[ Oct 18 16:09:04 Method "stop" exited with status 0 ]
[ Oct 18 16:09:04 Executing start method ("/etc/init.d/tcs-rtm start") ]
/export/home/routadm/sms911/cfg/sms911.smsiot-tpcapp1.rtmgr.sh
su: Sorry
[ Oct 18 16:09:08 Method "start" exited with status 0 ]
[ Oct 18 16:09:08 Stopping because all processes in service exited. ]
[ Oct 18 16:09:08 Executing stop method ("/etc/init.d/tcs-rtm stop") ]
This feature is not implemented
[ Oct 18 16:09:08 Method "stop" exited with status 0 ]
[ Oct 18 16:09:08 Restarting too quickly, changing state to maintenance ]

# svcs -p cron
STATE          STIME    FMRI
maintenance    16:09:08 svc:/system/cron:default
#

# cat /etc/init.d/tcs-rtm  <-------------------And this is the script
#!/bin/sh
####
# Copyright (c) 2008 XXXXXXXXXXX, Inc
# All Rights Reserved
#
# Name:  /etc/init.d/tcs-rtm
# File:  $Id$
# Build: $Date$
#
# Purpose: Startup Run Time Manager
####

TCS_USER="routadm"
TCS_APP_DIR="sms911"
TCS_APP_CFG=/export/home/${TCS_USER}/${TCS_APP_DIR}/cfg
_myhost=`uname -n`
TCS_SCRIPT=`ls $TCS_APP_CFG/*${_myhost}.rtmgr.sh | tail -1`

case "$1" in
start)
        if [ -x ${TCS_SCRIPT} ]; then
echo ${TCS_SCRIPT}
          su - routadm -c "${TCS_SCRIPT}"
        else
          echo "$TCS_SCRIPT not found..."
          exit 1
        fi
        exit 0
        ;;
  stop)
        echo "This feature is not implemented"
        ;;
  *)
        echo "Usage: $0 [ start | stop ]" >&2
        exit 1
       ;;
esac


###

#   End

###
#

Thanks

What happens when you attempt to execute the script from the command line, without cron ?

The cron service itself is corrupted. It should not run that script.

--- Post updated at 13:52 ---

For further diagnosis please give output from

svcs -l cron

Are the other services okay?

1 Like

Here is output :

# svcs -l cron
fmri         svc:/system/cron:default
name         TCS RTM function
enabled      true
state        maintenance
next_state   none
state_time   Fri Oct 18 16:09:08 2019
logfile      /var/svc/log/system-cron:default.log
restarter    svc:/system/svc/restarter:default
contract_id
#

And I see something strange in its configuration

svc:/system/cron> listprop
general                  framework
general/single_instance  boolean  true
dependents               framework
start                    method
start/limit_privileges   astring  :default
start/privileges         astring  :default
start/project            astring  :default
start/resource_pool      astring  :default
start/supp_groups        astring  :default
start/timeout_seconds    count    60
start/type               astring  method
start/use_profile        boolean  false
start/working_directory  astring  :default
start/exec               astring  "/etc/init.d/tcs-rtm start"
start/group              astring  routadm
start/user               astring  routadm
stop                     method
stop/timeout_seconds     count    60
stop/type                astring  method
stop/exec                astring  "/etc/init.d/tcs-rtm stop"
stop/project             astring  :default
stop/resource_pool       astring  :default
stop/working_directory   astring  :default
tm_common_name           template
tm_common_name/C         ustring  "TCS RTM function"
svc:/system/cron>

It should be

svc:/system/cron> listprop
usr                           dependency
usr/entities                  fmri     svc:/system/filesystem/local
usr/grouping                  astring  require_all
usr/restart_on                astring  none
usr/type                      astring  service
ns                            dependency
ns/entities                   fmri     svc:/milestone/name-services
ns/grouping                   astring  require_all
ns/restart_on                 astring  none
ns/type                       astring  service
general                       framework
general/action_authorization  astring  solaris.smf.manage.cron
general/entity_stability      astring  Unstable
general/single_instance       boolean  true
dependents                    framework
dependents/cron_multi-user    fmri     svc:/milestone/multi-user
startd                        framework
startd/ignore_error           astring  core,signal
start                         method
start/exec                    astring  /lib/svc/method/svc-cron
start/group                   astring  root
start/limit_privileges        astring  :default
start/privileges              astring  :default
start/project                 astring  :default
start/resource_pool           astring  :default
start/supp_groups             astring  :default
start/timeout_seconds         count    60
start/type                    astring  method
start/use_profile             boolean  false
start/user                    astring  root
start/working_directory       astring  :default
stop                          method
stop/exec                     astring  :kill
stop/timeout_seconds          count    60
stop/type                     astring  method
tm_common_name                template
tm_common_name/C              ustring  "clock daemon (cron)"
tm_man_cron                   template
tm_man_cron/manpath           astring  /usr/share/man
tm_man_cron/section           astring  1M
tm_man_cron/title             astring  cron
tm_man_crontab                template
tm_man_crontab/manpath        astring  /usr/share/man
tm_man_crontab/section        astring  1
tm_man_crontab/title          astring  crontab
1 Like

I was able to fix it. Thanks

Moderator comments were removed during original forum migration.