/etc/rc3.d startup script does not work, runs fine manually

Issues related to applications and software problems
Post Reply
kvashishta
Posts: 66
Joined: 2015/02/15 18:35:55

/etc/rc3.d startup script does not work, runs fine manually

Post by kvashishta » 2015/03/24 16:15:21

Team,

I have a script in /etc/rc3.d this script does not work when the system is booted up or rebooted. I am able to however easily without any extra work run the script just fine after the server is rebooted.
This to me suggests something awry with the environment variables. I do have /root/.bashrc which is probably the cause of my woes.

I googled and found that things will likely work if I add the following to the shell script:


chmod a+x ~/.bashrc
PS1='$ '
source ~/.bashrc

So, will I be all good if I add these three lines prior to anything else in the bash script? Regards,

Kartik Vashishta

User avatar
TrevorH
Site Admin
Posts: 33221
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: /etc/rc3.d startup script does not work, runs fine manua

Post by TrevorH » 2015/03/24 16:20:38

Initscripts should be in /etc/init.d/ and then set up with the correct runlevels using the chkconfig command. This requires some special comments to be added to the initscript to tell chkconfig what to do. You can see examples in all the other existing initscripts.

Without seeing your script or any error messages that get generated, no-one is going to be able to do more than guess what the problem is.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply