473,396 Members | 1,895 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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
Expand|Select|Wrap|Line Numbers
  1. # inittab       This file describes how the INIT process should set up
  2. #               the system in a certain run-level.
  3. #
  4. # Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
  5. #               Modified for RHS Linux by Marc Ewing and Donnie Barnes
  6. #
  7.  
  8. # Default runlevel. The runlevels used by RHS are:
  9. #   0 - halt (Do NOT set initdefault to this)
  10. #   1 - Single user mode
  11. #   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
  12. #   3 - Full multiuser mode
  13. #   4 - unused
  14. #   5 - X11
  15. #   6 - reboot (Do NOT set initdefault to this)
  16. #
  17. id:5:initdefault:
  18.  
  19. # System initialization.
  20. si::sysinit:/etc/rc.d/rc.sysinit
  21.  
  22. l0:0:wait:/etc/rc.d/rc 0
  23. l1:1:wait:/etc/rc.d/rc 1
  24. l2:2:wait:/etc/rc.d/rc 2
  25. l3:3:wait:/etc/rc.d/rc 3
  26. l4:4:wait:/etc/rc.d/rc 4
  27. l5:5:wait:/etc/rc.d/rc 5
  28. l6:6:wait:/etc/rc.d/rc 6
  29.  
  30. # Trap CTRL-ALT-DELETE
  31. ca::ctrlaltdel:/sbin/shutdown -t3 -r now
  32.  
  33. # When our UPS tells us power has failed, assume we have a few minutes
  34. # of power left.  Schedule a shutdown for 2 minutes from now.
  35. # This does, of course, assume you have powerd installed and your
  36. # UPS connected and working correctly.
  37. pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"
  38. "/etc/inittab" 59L, 1800C
  39.  
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

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

Thanks in advance...
Mar 5 '11 #1
3 4309
sicarie
4,677 Expert Mod 4TB
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?
Mar 7 '11 #2
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....
Mar 7 '11 #3
sicarie
4,677 Expert Mod 4TB
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.
Mar 9 '11 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Hansi | last post by:
1) How do I make a Windows Service system-critical, so that a user cannot stop it, not even from the task- manager? 2) Can I start a winforms application from a windows service? thanks hansi
0
by: Per Bergland | last post by:
After many woes, I finally managed to get a stack dump of my System Service (written in C#) that insists on crashing when launched at system boot time (see below on how to get this dump - I...
3
by: Netto | last post by:
Hi all,... I'd like to know where can I get information about what is happening to postgresql so it can't be started... all I get is: Starting postgresql service: ...
2
by: len smith | last post by:
I'd like to build a content management application that can connect to any webserver to manage content. Can I do this with Web Services? Is it possible to choose a web service at run time, or...
0
by: Rich Bernstein | last post by:
I would like to name a service at install time, so that multiple services could use the same executable (but different configuration settings). In order to do this, my service needs to find out at...
4
by: cyshao | last post by:
Why Windows doesn't allow to launch daemon/service in command line ?? Unix/Linux can simply do that....
1
by: amirmira | last post by:
I would like to set command line arguments to a service at install time. I need to do this because I need to get information from different registry locations depending on my command line argument....
0
by: Bruceneedshelp | last post by:
My application starts logging and executes shell commands on startup. The application runs fine, except when it executes at boot time. In other words when I make it a "startup" application on my...
2
by: tshad | last post by:
I have a Windows Service I am trying to get to work, which is not working correct, but one of the things it does is start Notepad.exe. The program seems to be doing this and it shows in the...
17
Dheeraj Joshi
by: Dheeraj Joshi | last post by:
Since UNIX forum is for Linux,Unix,BSD and my issue is regarding Solaris i am posting it in lounge..... In Linux during a service start via init.d a file under /var/lock/subsys/(servicename) is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.