Why is daemon service not starting during boot time ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rameshjumgam
    New Member
    • Dec 2010
    • 10

    Why is daemon service not starting during boot time ?

    Hi i am running my shell script daemon,
    OS :Linux
    Linux cv-codc-embu 2.6.18-194.el5PAE #1 SMP Tue Mar 16 22:00:21 EDT 2010 i686 athlon i386 GNU/Linux

    my /etc/inittab file content is
    Code:
    # inittab       This file describes how the INIT process should set up
    #               the system in a certain run-level.
    #
    # Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
    #               Modified for RHS Linux by Marc Ewing and Donnie Barnes
    #
    
    # Default runlevel. The runlevels used by RHS are:
    #   0 - halt (Do NOT set initdefault to this)
    #   1 - Single user mode
    #   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
    #   3 - Full multiuser mode
    #   4 - unused
    #   5 - X11
    #   6 - reboot (Do NOT set initdefault to this)
    #
    id:5:initdefault:
    
    # System initialization.
    si::sysinit:/etc/rc.d/rc.sysinit
    
    l0:0:wait:/etc/rc.d/rc 0
    l1:1:wait:/etc/rc.d/rc 1
    l2:2:wait:/etc/rc.d/rc 2
    l3:3:wait:/etc/rc.d/rc 3
    l4:4:wait:/etc/rc.d/rc 4
    l5:5:wait:/etc/rc.d/rc 5
    l6:6:wait:/etc/rc.d/rc 6
    
    # Trap CTRL-ALT-DELETE
    ca::ctrlaltdel:/sbin/shutdown -t3 -r now
    
    # When our UPS tells us power has failed, assume we have a few minutes
    # of power left.  Schedule a shutdown for 2 minutes from now.
    # This does, of course, assume you have powerd installed and your
    # UPS connected and working correctly.
    pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"
    "/etc/inittab" 59L, 1800C
    My shell script excutable is in /etc/init.d
    permissions are 755

    i have added
    chkconfig --add dmgtd
    [root@cv-codc-embu ~]# chkconfig --list dmgtd
    dmgtd 0:off 1:on 2:on 3:on 4:on 5:on 6:off
    symbolics links also created in /etc/rc.d/

    rc0.rc1...rc6

    and my /etc file content

    Code:
    a2ps.cfg               default               inittab.rpmorig   multipath_bindings        rc1.d              sudoers.16227
    a2ps-site.cfg          depmod.d              inputrc           multipath.conf            rc2.d              sudoers.19196
    acpi                   desktop-profiles      iproute2          multipath.conf.cisco      rc3.d              sudoers.19922
    adjtime                dev.d                 iscsi             multipath.conf.rpmorig    rc4.d              sudoers.22921
    aliases                dhcp6c.conf           issue             Muttrc                    rc5.d              sudoers.25288
    aliases.bak            DIR_COLORS            issue.net         Muttrc.local              rc6.d              sudoers.26292
    aliases.db             DIR_COLORS.xterm      issue.ssh         netplug                   rc.config.d        sudoers.28573
    alsa                   director.conf         java              netplug.d                 rc.d               sudoers.30137
    alternatives           dnsmasq.conf          jvm               NetworkManager            rc.local           sudoers.3182
    anacrontab             dnsmasq.d             jvm-commmon       nisp_domains              rc.sysinit         sudoers.6436
    asound.state           dumpdates             jwhois.conf       nscd.conf                 readahead.d        sudoers.9262
    at.deny                enscript.cfg          kde               nsswitch.conf             reader.conf        sudoers.9479
    audisp                 environment           kderc             nsswitch.conf.files       reader.conf.d      sudoers.9645
    audit                  esd.conf              kdump.conf        nsswitch.conf.nis         redhat-lsb         sysconfig
    auto.director          exports               kdump.conf.cisco  nsswitch.conf.nis-compat  redhat-release     sysctl.conf
    autofs_ldap_auth.conf  exports.mvfs          kdump_id_dsa      nsswitch.conf.nisplus     resolv.conf        syslog.conf
    auto.indirect          fb.modes              kdump_id_dsa.pub  nsswitch.conf.rpmorig     rmt                syslog_updater
    auto.indirect.m4       filesystems           krb5.conf         ntp                       rpc                system-profile
    auto.master            firmware              ksysguarddrc      ntp.conf                  rpm                system-profile.old
    auto.master.files      fonts                 ldap.conf         odbc.ini                  rwtab              system-profile.save
    auto.master.nis        foomatic              ld.so.cache       odbcinst.ini              rwtab.d            termcap
    auto.master.nisplus    fstab                 ld.so.conf        oddjob                    samba              udev
    auto.master.old        gconf                 ld.so.conf.d      oddjobd.conf              sane.d             updatedb.conf
    auto.master.rpmorig    gcrypt                lftp.conf         oddjobd.conf.d            sasl2              updatedb.conf.orig
    auto.misc              gdm                   libaudit.conf     openldap                  screenrc           vimrc
    auto.misc.cisco        ghostscript           libuser.conf      opt                       scrollkeeper.conf  vimrc.rpmsave
    auto.misc.rpmorig      gimp                  localtime         pam.d                     scsi_id.config     virc
    auto.net               gnome-vfs-2.0         login.defs        pam_pkcs11                securetty          warnquota.conf
    auto.smb               gnome-vfs-mime-magic  logrotate.conf    pam_smb.conf              security           wgetrc
    auto.ws                gpm-root.conf         logrotate.d       pango                     selinux            wpa_supplicant
    avahi                  gre.d                 lsb-release.d     passwd                    sensors.conf       X11
    bashrc                 group                 ltrace.conf       passwd-                   services           xdg
    blkid                  group-                lvm               pcmcia                    services.orig      xinetd.conf
    bluetooth              grub.conf             mail              pinforc                   sestatus.conf      xinetd.d
    bonobo-activation      gshadow               mailcap           pki                       setroubleshoot     xml
    cdrecord.conf          gssapi_mech.conf      mail.rc           pm                        setuptool.d        yp.conf
    cipe                   gtk-2.0               makedev.d         ppp                       sgml               yp.conf.prev
    conman.conf            hal                   man.config        prelink.cache             shadow             yum
    cron.d                 host.conf             maven             prelink.conf              shadow-            yum.conf
    cron.daily             hosts                 mgetty+sendfax    prelink.conf.d            shells             yum.repos.d
    cron.deny              hosts.allow           mime.types        printcap                  skel               zlogin
    cron.hourly            hosts.deny            minicom.users     profile                   slrn.rc            zlogout
    cron.monthly           hosts.orig            mke2fs.conf       profile.d                 smrsh              zprofile
    crontab                hp                    modprobe.conf     protocols                 snmp               zshenv
    cron.weekly            htdig                 modprobe.conf~    purple                    socks.conf         zshrc
    csh.cshrc              httpd                 modprobe.d        quotagrpadmins            sound
    csh.login              idmapd.conf           motd              quotatab                  ssh
    cups                   init.d                motd.BAK          racoon                    stunnel
    cvs-rpm                initlog.conf          mtab              rc                        sudoers
    dbus-1                 inittab               mtools.conf       rc0.d                     sudoers.13426
    while boot time it is not starting plz help me some?

    Thanks in advance...
    Last edited by Niheel; Mar 5 '11, 11:12 PM. Reason: Code tags, also this seems very similar to your earlier question.
  • sicarie
    Recognized Expert Specialist
    • Nov 2006
    • 4677

    #2
    I will merge these threads as soon as the issue is resolved so there's no confusion.

    What is your script called and where is it located? Is it in /etc/init.d? What are the specific symlinks you created in the /etc/rc2.d and /etc/rc3.d folders?

    Comment

    • rameshjumgam
      New Member
      • Dec 2010
      • 10

      #3
      Hi sicarie,

      1)Through my daemon script it starts some process, it is located in /etc/init.d/
      2)Symbolic links i have created is
      in
      [root@cv-codc-embu ~]# file /etc/rc.d/rc0.d/K90dmgtd
      /etc/rc.d/rc0.d/K90dmgtd: symbolic link to `../init.d/dmgtd'

      [root@cv-codc-embu ~]# file /etc/rc.d/rc1.d/K90dmgtd
      /etc/rc.d/rc1.d/K90dmgtd: symbolic link to `../init.d/dmgtd'

      [root@cv-codc-embu ~]# file /etc/rc.d/rc2.d/S10dmgtd
      /etc/rc.d/rc2.d/S10dmgtd: symbolic link to `../init.d/dmgtd'

      [root@cv-codc-embu ~]# file /etc/rc.d/rc3.d/S10dmgtd
      /etc/rc.d/rc3.d/S10dmgtd: symbolic link to `../init.d/dmgtd'


      [root@cv-codc-embu ~]# file /etc/rc.d/rc4.d/S10dmgtd
      /etc/rc.d/rc4.d/S10dmgtd: symbolic link to `../init.d/dmgtd'

      [root@cv-codc-embu ~]# file /etc/rc.d/rc5.d/S10dmgtd
      /etc/rc.d/rc5.d/S10dmgtd: symbolic link to `../init.d/dmgtd'

      [root@cv-codc-embu ~]# file /etc/rc.d/rc6.d/K90dmgtd
      /etc/rc.d/rc6.d/K90dmgtd: symbolic link to `../init.d/dmgtd'

      and after rebooting the system i have checked like

      [root@cv-codc-embu ~]# /sbin/service dmgtd status
      /opt/CSCOpx/etc/commonscript.sh : line 82: /tmp/cscotmp/LOG_NAME.txt: No such file or directory
      Usage: /etc/init.d/dmgtd { start | stop | kill}

      Means my service is calling while boot time but start argument is not getting passed where i should take care plz help Thanks in advance....

      Comment

      • sicarie
        Recognized Expert Specialist
        • Nov 2006
        • 4677

        #4
        The two things that jump out at me are errors and that you have a script in each level of the /etc/rc.d folders when you probably shouldn't. Those levels are init levels - they start different processes.

        For instance, the kernel doesn't automatically boot with the capacity to be networked. It has to load that ability once it's able to be supported. That's why there are several init scripts with the same name throughout those folders - they load different parts of those programs when the resources are available (you can research 'linux run levels' through Google if you're curious about this). Also, the scripts starting with K are "kill" scripts for when the computer is shutting down. You should definitely remove yours unless there is a certain way your script should be stopped.

        I would recommend calling your script one time in the /etc/rc3.d folder, and removing the others.

        The other thing I notice is the error - line 82. It looks like your script calls another script that needs to log to a specific file. That log file does not exist, and therefore I believe your script is erring out.

        Try running ./dmgtd from the folder that the dmgtd script is in.

        You should see that error. You can fix this by running

        mkdir /tmp/cscotmp
        touch LOG_NAME.txt

        That will ensure the directory is there, and the file is there for writing.

        After that is done, re-run your script (./dmgtd) and make sure no other errors occur. It's possible that script is expecting a variable called $LOG_NAME, so you might want to check that if you keep getting an error with that other script.
        Last edited by sicarie; Mar 9 '11, 06:44 PM.

        Comment

        Working...