Sponsored Content
Full Discussion: Creating script in rc.d
Top Forums UNIX for Advanced & Expert Users Creating script in rc.d Post 303042983 by MadeInGermany on Wednesday 15th of January 2020 02:33:20 AM
Old 01-15-2020
rc.local is for compatibility with BSD Unix, not well supported in Linux Smilie

In your start/stop script reate a dependency header - comments with certain keywords that belong to the LSB (Linux Standard Base).
Then put it in the init.d directory so it is seen by the chkconfig command.
Code:
chkonfig -add myscript
chkonfig --list
chkonfig myscript on
chkconfig --list

The on command creates suitable S and K numbers for the run levels, trying to fulfill the dependency in the LSB header.
 

10 More Discussions You Might Find Interesting

1. Programming

creating a new C script

All right. Heres the deal, I need to know everysingle command or funtion there is to create a new c file (file.c). Heres the catch: I cannot use text editors!!!:mad: I heard of a "gcc" command is that any good?:confused: Thanks..:cool: (2 Replies)
Discussion started by: AbRa-KaDabRa
2 Replies

2. UNIX for Dummies Questions & Answers

creating a script

I am trying to create a application in OSX through UNIX that will run a script to mount an image from a CD-ROM and run the application which it corresponds to, all with double clicking on a icon in OSX. Any thoughts or ideas? -Mad (3 Replies)
Discussion started by: madknowledge
3 Replies

3. Shell Programming and Scripting

Need help creating a script

I need to automate the following process: I have a list of ip address for printers in a file called iplist.txt, I need to take that list and run the command snmpget -v 1 -c public ip address sysName.0 for each ip address to see if the printer is running snmp, I want to the create a file... (4 Replies)
Discussion started by: inLine6
4 Replies

4. Shell Programming and Scripting

(Urgent):Creating flat file using sql script and sqlplus from UNIX Shell Script

Hi, I need help urgently for following issue. Pls help me to resolve this issue. I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql) I given... (6 Replies)
Discussion started by: praka
6 Replies

5. Shell Programming and Scripting

help needed with creating challenging bash script with creating directories

Hi, Can someone help me with creating a bash shell script. I need to create a script that gets a positive number n as an argument. The script must create n directories in the current directory with names like map_1, map_2 etcetera. Each directory must be contained within its predecessor. So... (7 Replies)
Discussion started by: I-1
7 Replies

6. Programming

need help with creating a sh script

Hi everyone I’m not a programmer and my knowledge of scripting is very poor, now I’m stock in a task at work and would really appreciate it if someone could help me out. Here is the problem: 1. I have a file with 9 million entries that look like this : 611424167 610864581 611881523 609585386... (3 Replies)
Discussion started by: hiker1064
3 Replies

7. UNIX for Dummies Questions & Answers

Creating a script

Alright, well I did some more research since I originally posted this thread, and as much as I'd like to delete it, I can't, so I'll just extend my initial question a little. Right now I have 3 scripts: 1#!/bin/bash # script1 - Write all files modfied x days ago find .. -daystart -mtime 0... (2 Replies)
Discussion started by: Aussiemick
2 Replies

8. Shell Programming and Scripting

Need help in creating file restoration script from a backup script.

Hi all i am struggling in creating a restore of env files while doing applications clone. the first file i created for copying the important configurations file which is running perfect now for reverting the changes i mean when i am restoring these files to its original places i have to do... (7 Replies)
Discussion started by: javeedkaleem
7 Replies

9. Shell Programming and Scripting

Creating IN list in PLSQL script dynamically by using shell script

Hi all, I have a PLSQL script which has a IN list where it takes some ids as input. For example SELECT * FROM EMPLOYEE WHERE EMPLOYEE_ID IN (comma separated list ) I want to run this quest inside a shell script but I would like to prepare the IN list dynamically where the employee ids... (1 Reply)
Discussion started by: LoneRanger
1 Replies

10. Shell Programming and Scripting

Help with creating a script

Hi everyone, I am completely new to this forum and I have some questions regarding a script I am writing. I would be happy if anyone could help me with the small and precise script which should include if, then, else, while until, case and select. The scenario is as follows: 1) A user... (3 Replies)
Discussion started by: codenotfound
3 Replies
CHKCONFIG(8)                                                  System Manager's Manual                                                 CHKCONFIG(8)

NAME
chkconfig - enable or disable system services SYNOPSIS
chkconfig -t|--terse [names] chkconfig -s|--set [name state] chkconfig -e|--edit [names] chkconfig -c|--check name [state] chkconfig -l|--list [--deps] [names] chkconfig -A|--allservices chkconfig -a|--add [names] chkconfig -d|--del [names] DESCRIPTION
chkconfig is used to manipulate the runlevel links at boot time (see init.d(7)). It can be thought of as a frontend to insserv(8). Chk- config can run in six different modes: terse list mode, set mode, edit mode, list mode, add mode and delete mode. The last three modes were added for compatiblity reasons. TERSE LIST MODE
This mode lists the state of the specified services, or all known services if no service name was provided. Every printed line consists of the name of the service and the runlevels the service is configured for at the moment. If it is configured in no runlevel, off is used instead, if it is configured in the runlevels defined as a default by the start script, on is used. If the service is an enabled inetd or xinetd service, inetd and xinetd are used. Inetd/xinetd services are configured in /etc/inetd.d and /etc/xinetd.d, respectively. You can use the -A or --allservices parameter to get all services (even the boot.*-services) listed. If chkconfig is called without arguments, all services are listed in terse mode. SET MODE
Set mode is used to configure at which runlevel a service should be started. The arguments must be specified as pairs of service name and new state. You can use on and off as special states to select the default set of runlevels or to disable a service completely. You can use inetd or xinetd to configure a service managed by the inetd/xinetd daemons. Insserv can calculate dependencies for only one service at the same time. To work around this limitation imposed by insserv, chkconfig uses the '-f' option of insserv when it reads the list of services from standard input. Note that --force switches off all dependency checks and could lead to depending services no longer working, use with care. If no services are specified, chkconfig reads lines from standard input. Each line must consist of a service/state pair. As this is exactly the output of the terse list mode, this can be used to reconfigure a service specification saved by a former run. If the option -f or --force is also given, insserv is called with a '-f' option. EDIT MODE
This mode is a combination of the terse list mode and set mode. It writes the state of all specified services (or all known services, if no service was provided) into a temporary file, starts an editor and re-configures all services to reflect the states of the changed tempo- rary file. CHECK MODE
This mode can be used to check the state of a service. chkconfig exits with a return code of '0' if the service is enabled in all of the specified runlevels, otherwise the exit status is '1'. If chkconfig is called with only a service name the current runlevel of the system is used for checking. LIST MODE
List mode prints for each specified service a line that consists of the service name and for runlevels zero to six on or off depending if the service will be started or not. on will be printed in bright green if the output is written to a terminal. If the --deps option is given, the names of the services that must be started before this service is appended to each line. The inetd/xinetd services are listed in extra sections. You can use the -A or --allservices parameter to get all services (even the boot.*-services) listed. ADD MODE
Calls insserv to enable a service and uses list mode to display the new setting afterwards. DEL MODE
Same as add mode, but disable the service. OTHER OPTIONS
When no service names are given on the command line, chkconfig defaults to all known services excluding those that are not enabled in run- levels 1 to 6 and start with 'boot.'. Use the --allservices or -A option if you want to see such services as well. EXAMPLES
chkconfig list the runlevel configuration of all known services chkconfig apache list the runlevel configuration of the apache web server chkconfig -t apache xntpd list the runlevel configuration of the apache web server and the network time protocol daemon. chkconfig apache on configure the apache web server to be started on next boot time. chkconfig apache 5 configure the apache web server to be started only if the system reaches runlevel 5. chkconfig apache 35 configure the apache web server for runlevel 3 and 5. chkconfig apache on xntpd off configure two services chkconfig finger xinetd configure a xinetd service chkconfig -A >~root/chkconfig.save backup the current configuration chkconfig -s <~root/chkconfig.save restore the configuration chkconfig -e apache xntpd change the runlevel configuration interactively chkconfig -e change the runlevel configuration of all services interactively FILES
/etc/init.d/ path to the boot script base directory as required by the Linux Standard Base Specification (LSB). /etc/inetd.d/ path to the inetd services. See the inetd manpage to find out how to enable this feature. /etc/xinetd.d/ path to the xinetd services. SEE ALSO
init.d(7), init(7), inetd(8) xinetd(8) insserv(8) COPYRIGHT
2003 SuSE Linux AG, Nuernberg, Germany. AUTHOR
Michael Schroeder <mls@suse.de> Oct 2006 CHKCONFIG(8)
All times are GMT -4. The time now is 06:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy