Advertisement

03.27.2008 at 12:34PM PDT, ID: 23275336
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

A question about shutdown scripts
Tags: Linux
When we shutdown our Linux AS 2.1 server, we would like a script to run that will close all of our Progress databases.  The script is ready to go, I need to know if I put the script in the /etc/rc.d/rc0.d and the /etc/rc.d/rc6.d folders.

Thanks,
Mike
Start your free trial to view this solution
Question Stats
Zone: OS
Question Asked By: csg_int_it
Solution Provided By: it4soho
Participating Experts: 4
Solution Grade: A
Views: 5
Translate:
Loading Advertisement...
03.27.2008 at 12:42PM PDT, ID: 21225031

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.27.2008 at 02:00PM PDT, ID: 21225712

Rank: Wizard

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
03.28.2008 at 09:19AM PDT, ID: 21231765

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.16.2008 at 03:10AM PDT, ID: 21366157

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
03.27.2008 at 12:42PM PDT, ID: 21225031

Rank: Wizard

The script should be in the /etc/init.d folder. Then create symlinks to the script in those rcx.d folders in which the database is running (usually rc3.d and rc5.d if you are using X). On redhat it could be a different folder structure, I'm not sure if init.d is also init.d there.
 
03.27.2008 at 02:00PM PDT, ID: 21225712

Rank: Wizard

On a Red Hat system, there's a utility called chkconfig which can manage these symbolic links for you. Check its man page.
Your script needs to be able to start the Progress databases as well as stop them - or at least it has to implement a "start" argument
 
03.28.2008 at 09:19AM PDT, ID: 21231765
OK... this is a long one... sorry in advance to anyone annoyed by that...

I started writing this reply by telling you how to write a startup/shutdown script, what it needed to have & why, and where you needed to put it and why -- the result was too long and too confusing. So, as an alternative, I'm going to fist explain RHL & Fedora system startup & shutdown. If all you want is the HOWTO (and none of the WHY), then skip ahead to the "Step 1" part below.

RedHat, Fedora, and most other SYS-V types of Unix (including LOTS of other Unix's and Linux distributions!) startup and shutdown using something called a "run level" system. For RHL & Fedora, there are typically 7 run levels. The most commonly used ones are:
 0 - halt the system (shutdown & turn off)
 1 - single user mode (almost like a Windows "safe mode")
 3 - "standard" startup, but with no GUI (Command line only!)
 5 - "standard" startup, with the GUI (the Red Hat & Fedora "standard" startup level
 6 - "restart" -- that is, shut down & reboot

How this comes into play is that there are separate directories (folders) for each run level:
 /etc/rc0.d
 /etc/rc1.d
 /etc/rc3.d
 /etc/rc5.d
 /etc/rc6.d
(plus more I haven't explained today)

In each folder are a BUNCH of files (actually symbolic links) that start with the letters S & K (caps). In short, the S files will be run to start a feature, the K files will be run to stop a feature. (The K files are actually run first -- I'll explain the mechanism later). The point here and now is that the S01sysstat and K99sysstat point to the SAME file: /etc/init.d/sysstat

What has happened is that we (Linux gurus) have "encapsulated" all of the "knowledge" about starting, stopping, restarting, or any other important action about "sysstat" into a single file. At a minimum, this file must take the following arguments:
 start: to start the sysstat "feature" (in this case, a single daemon process)
 stop: to stop the "feature" (in this case, stop the daemon)
 status: to show whether the "feature" is currently active or now
 restart: to stop, then start the "feature"

So, when the system starts up, it boots into a "run level" -- which means it runs the K* and then the S* files in the appropriate folder. (the default run level is set in the /etc/inittab file as the initdefault value). For the rest of this "tutorial", I'm going to assume your default run level is a 5.

(NOTE: This is an admittedly ABBREVIATED explanation of startup & shutdown)
AT SYSTEM STARTUP:
After the system starts the kernel, the initdefault level is determined (5 in this example) & after some early "housekeeping", the system runs (in order) all of the S* scripts in /etc/rc5.d directory, each with a "start" argument. Think of it as though you were running:
 /etc/rc5.d/S01sysstat start
 /etc/rc5.d/S04readahead_early start
 ... and so on until
 /etc/rc5.d/S99local start

AT SYSTEM SHUTDOWN
You can actually change the run level of your system at any time with the "init" command. When you're CHANGING run levels, all of the K* scripts are run with stop arguments BEFORE the S* scripts are run. So, in the case of a shutdown (run level 0), when you run the shutdown command (or type "init 0" from a root prompt), the system will run ALL of the scripts /etc/rc0.d/K* in order, and each with a stop argument... like:
 /etc/rc0.d/K01yum stop
 /etc/rc0.d/K02avahi-daemon
 ... and so on to
 /etc/rc0.d/K99sysstat

BUT WAIT! We still have to run the S* scripts! In the case of run level 0, this is usually:
 S00killall start
 S01halt start
The latter of which is how you tell the system to turn off. (Compare that to the file /etc/rc6.d/S01reboot)

One final tidbit: there is a RedHat program called chkconfig that, based on a comment field in the script, will automatically generate the symbolic links in all of the /etc/rc*.d folders.  "chkconfig" (which is also a script) looks for 2 lines (actually, COMMENT lines) in the provided (on the command line) script file that looks like this:
       # chkconfig: 2345 20 80
       # description: Controls some process or functionality
OK, the description is actually not required... but the FIRST line tells chkconfig to create the appropriate links to START your program (that is, to run your script with a "Start" argument when booting into run levels 2, 3, 4, or 5)

Now, the other 2 numbers on the line (the 20 & 80) are the instructions for WHEN to start & stop the program (or, more exactly, in what order to call your script in relation to all the others). Remember, the startup & shutdown commands run the K* scripts (in order), then the S* scripts (in order) -- the numbers just provide the order!

So now, back to the 20 & 80 -- the 2 means that when chkconfig CREATES the links in the /etc/rc[2345].d folders, it will create S-scrpts with a 20 after the S. The other /etc/rc[*].d folders will get K scripts with an 80 after the K... thus, creating the order.

------

OK... so, to answer your question "How do I make the Progress DB turn off nicely at system shutdown":

Step 1: Create a script (called "progressdb"?) and place it in /etc/init.d
 This script must take an argument of "start" and "stop" at a minimum
 This script should have the # chkconfig: line as described above, for example:
# chkconfig: 2345 99 01
# description: start the Progress DB last, and stop it first

Step 2: CHECK your script file! Make sure it works with start and stop options CORRECTLY!

Step 3:Assuming it is already located in /etc/init.d, run the program:
# chkconfig --add progressdb
this will create the startup and shutdown links to your script file. Assuming you named it "progressdb", the result will be that symbolic links will be placed in the /etc/rc*.d folders, ALL of which will "point" to YOUR file: /etc/init.d/progressdb:
 /etc/rc0.d/K80progressdb
 /etc/rc1.d/K80progressdb
 /etc/rc2.d/S20progressdb
 /etc/rc3.d/S20progressdb
 /etc/rc4.d/S20progressdb
 /etc/rc5.d/S20progressdb
 /etc/rc6.d/K80progressdb

Step 4: If you need to start the Progress DB (without restarting your system) run the command:
service progressdb start

I hope this helps.... someone!!!

Dan McAllister
IT4SOHO
Accepted Solution
 
04.16.2008 at 03:10AM PDT, ID: 21366157
Yes you can, just make sure the script starts with a K.  Make the script in /etc/init.d/ (such as /etc/init.d/postgres) and then sym-link it from the rc?.d directory you want it to run at, so when we shutdown we change runlevels (usually 0 or 6), so link it there.
 
 
20080236-EE-VQP-29 / EE_QW_2_20070628