Sponsored Content
Operating Systems Linux Troubleshooting init.d script Post 303026244 by Scrutinizer on Thursday 22nd of November 2018 08:59:17 AM
Old 11-22-2018
Did you check de rc[0-n].d run level links? Do you have LSB comment headers in your init script?

From the man page:
Quote:
When run with the defaults option, update-rc.d makes links named
/etc/rcrunlevel.d/name that point to the script /etc/init.d/name, using runlevel and
dependency information from the init.d script LSB comment header.
If any files named /etc/rcrunlevel.d/??name already exist then update-rc.d does
nothing.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Troubleshooting Script

I am fairly new to Unix (Sun OS) scripting with Ksh, and I could use a little help troubleshooting my script. When I run it, I get the error "if unexpected" on the function setYear. If I comment out the setYear function, I get the error "for unexpected" on the function sendEmails. This leads me... (8 Replies)
Discussion started by: mharley
8 Replies

2. UNIX for Advanced & Expert Users

Init 6 & Init 0 problem

Hi Expert, I have encountered some problem with my SUN system. Everytime when i issue command #init 6 OR #init 0 it just logout and prompt for login again instead of rebooting the server when run init 6 and system shutdown when run init 0.. I can only reboot the system using reboot ... Was... (6 Replies)
Discussion started by: sc2005
6 Replies

3. Shell Programming and Scripting

calling a function in Shell script troubleshooting

Some Code After Some code part is executed the control doesnt go to rvin_doxx_scrt.. and the script exits rvin_doxx_scrt() { Some Code } if (som code) ... (4 Replies)
Discussion started by: ultimatix
4 Replies

4. Linux

How to I change init levels after typing init 1

Dear all, I typed in init 1 on my redhat box as root and according to wikipedia (http://en.wikipedia.org/wiki/Runlevel): 1 Single-User Mode Does not configure network interfaces, start daemons, or allow non-root logins So now I can't connect back to it. How do I change the init back to 3?... (8 Replies)
Discussion started by: z1dane
8 Replies

5. UNIX for Advanced & Expert Users

Problem on init 0, execution is the same with init 6

Hi, I am experiencing a weird thing on my SUNFIRE machine with Solaris 9 OS. When I do init 0 to shutdown the machine to go to ok prompt, what it did was shutdown and reboot like an init 6 command do. I did check the corresponding rc scripts that were involved with init 0 and compared with rc... (2 Replies)
Discussion started by: Yenthanh
2 Replies

6. Red Hat

init-script failing because of /etc/rc.d/init.d/functions

I encountered a problem on one of our database servers. OS: CentOS 5.5 final Kernel: 2.6.18-238.5.1.el5.028stab085.2 (OpenVZ kernel) We wrote some DB-Start/Stop-scripts ("/db2/admin/scripts_dba/start_services.ksh" and ".../stop_services.ksh") to start the database instances. (Database... (1 Reply)
Discussion started by: bakunin
1 Replies

7. Red Hat

Unable to get $PWD value from script in /etc/init.d

Hi ppl hope to have your advice, i am run out of idea... I have 3 scripts: a.sh, b.sh, and c.sh a.sh resided in /etc/init.d b.sh and c.sh /opt/xSystem I intend to start my system with "service" command which will trigger my a.sh service a.sh start then. a.sh will trigger... (4 Replies)
Discussion started by: cielle
4 Replies

8. UNIX for Advanced & Expert Users

Init.d script stdout location

I'm looking into a Solaris(S10) startup problem, with a script configured to run in /etc/rc3.d. It's written to output trace information to a logfile using tee, but the file itself is clearly not being updated. Is there a default stdout/stderr location for startup scripts where the other branch of... (6 Replies)
Discussion started by: JerryHone
6 Replies

9. Shell Programming and Scripting

INIT Script Getting Executed Twice?

Hello All, I copied and pasted the "/etc/init.d/skeleton" file to a new one so I could create my own init script for a program. Basically the ONLY edit I made to the skeleton "template" so far was to search and replace "FOO" with "snort". *NOTE: I know there are a bunch of snort init scripts... (6 Replies)
Discussion started by: mrm5102
6 Replies

10. Shell Programming and Scripting

Start up init d script

Hi All, I'm trying to build a start up script, wud be gr8 if any one can explain what the below field means and how can i check it for my script. DAEMON_PATH="/home/wes/Development/projects/myapp" DAEMON=myapp DAEMONOPTS="-my opts" NAME=myapp DESC="My daemon description"... (4 Replies)
Discussion started by: Karthick N
4 Replies
INVOKE-RC.D(8)							 Debian GNU/Linux						    INVOKE-RC.D(8)

NAME
invoke-rc.d - install and remove System-V style init script links SYNOPSIS
update-rc.d [-f] name remove update-rc.d name defaults update-rc.d name defaults-disabled update-rc.d name disable|enable [ S|2|3|4|5 ] DESCRIPTION
update-rc.d updates the System V style init script links /etc/rcrunlevel.d/NNname whose target is the script /etc/init.d/name. These links are run by init when it changes runlevels; they are generally used to start and stop system services such as daemons. runlevel is one of the runlevels supported by init, namely, 0123456789S, and NN is the two-digit sequence number that determines where in the sequence init will run the scripts. This manpage documents only the usage and behaviour of update-rc.d. For a discussion of the System V style init script arrangements please see init(8) and the Debian Policy Manual. INSTALLING INIT SCRIPT LINKS
update-rc.d requires dependency and runlevel information to be provided in the init.d script LSB comment header of all init.d scripts. See the insserv(8) manual page for details about the LSB header format. When run with the defaults option, update-rc.d makes links named /etc/rcrunlevel.d/[SK]NNname that point to the script /etc/init.d/name, using runlevel and dependency information from the init.d script LSB comment header. When run with the defaults-disabled option, update-rc.d makes links named /etc/rcrunlevel.d/KNNname that point to the script /etc/init.d/name, using dependency information from the init.d script LSB comment header. This means that the init.d script will be dis- abled (see below). If any files named /etc/rcrunlevel.d/[SK]??name already exist then update-rc.d does nothing. The program was written this way so that it will never change an existing configuration, which may have been customized by the system administrator. The program will only install links if none are present, i.e., if it appears that the service has never been installed before. Older versions of update-rc.d also supported start and stop options. These options are no longer supported, and are now equivalent to the defaults option. A common system administration error is to delete the links with the thought that this will "disable" the service, i.e., that this will prevent the service from being started. However, if all links have been deleted then the next time the package is upgraded, the package's postinst script will run update-rc.d again and this will reinstall links at their factory default locations. The correct way to disable services is to configure the service as stopped in all runlevels in which it is started by default. In the System V init system this means renaming the service's symbolic links from S to K. The script /etc/init.d/name must exist before update-rc.d is run to create the links. REMOVING SCRIPTS
When invoked with the remove option, update-rc.d removes any links in the /etc/rcrunlevel.d directories to the script /etc/init.d/name. The script must have been deleted already. If the script is still present then update-rc.d aborts with an error message. update-rc.d is usually called from a package's post-removal script when that script is given the purge argument. Any files in the /etc/rcrunlevel.d directories that are not symbolic links to the script /etc/init.d/name will be left untouched. DISABLING INIT SCRIPT START LINKS
When run with the disable [ S|2|3|4|5 ] options, update-rc.d modifies existing runlevel links for the script /etc/init.d/name by renaming start links to stop links with a sequence number equal to the difference of 100 minus the original sequence number. When run with the enable [ S|2|3|4|5 ] options, update-rc.d modifies existing runlevel links for the script /etc/init.d/name by renaming stop links to start links with a sequence number equal to the positive difference of current sequence number minus 100, thus returning to the original sequence number that the script had been installed with before disabling it. Both of these options only operate on start runlevel links of S, 2, 3, 4 or 5. If no start runlevel is specified after the disable or enable keywords, the script will attempt to modify links in all start runlevels. OPTIONS
-f Force removal of symlinks even if /etc/init.d/name still exists. EXAMPLES
Insert links using the defaults: update-rc.d foobar defaults The equivalent dependency header would have start and stop dependencies on $remote_fs and $syslog, and start in runlevels 2-5 and stop in runlevels 0, 1 and 6. Remove all links for a script (assuming foobar has been deleted already): update-rc.d foobar remove Example of disabling a service: update-rc.d foobar disable Example of a command for installing a system initialization-and-shutdown script: update-rc.d foobar defaults Example of a command for disabling a system initialization-and-shutdown script: update-rc.d foobar disable BUGS
See http://bugs.debian.org/sysv-rc. FILES
/etc/init.d/ The directory containing the actual init scripts. /etc/rc?.d/ The directories containing the links used by init and managed by update-rc.d . /etc/init.d/skeleton Model for use by writers of init.d scripts. SEE ALSO
Debian Policy Manual, /etc/init.d/skeleton, insserv(8), sysv-rc-conf(8), bum(8), init(8) AUTHOR
Ian Jackson, Miquel van Smoorenburg Licence: GNU Public Licence v2 or Later (GPLv2+) COPYRIGHT
2001 Hernique Holschuh 14 November 2005 INVOKE-RC.D(8)
All times are GMT -4. The time now is 08:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy