- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- user defined service
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2006 05:33 AM
03-21-2006 05:33 AM
user defined service
I have added a "user defined service" named orainfra. I created in /etc/init.d/orainfra script to startup and stop some application services.
I have added the service with:
chkconfig --add orainfra
[root@svr04 ~]# chkconfig --list |grep orainfra
orainfra 0:off 1:off 2:off 3:on 4:off 5:on 6:off
After this it added the corresponding links in rcX.d correct levels.
This line (into the script) defines the levels to run:
# chkconfig: 35 98 11
At the start of the server I can see that is trying with my service (orainfra) but the service (script) does not executes succesfully. AT startup it does not shows any messages about the succesfull or not of the service execution.
Eventhough once started the server, if I execute manually the service (orainfra) it wors fine:
service orainfra start
or
service orainfra stop
Any idea about why it is not working at the starting up of the server?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2006 06:08 AM
03-21-2006 06:08 AM
Re: user defined service
Also, check your environment variables definition. Ensure that the scripts has all variables needed to sucessfully start the database.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2006 06:22 AM
03-21-2006 06:22 AM
Re: user defined service
Hello Ivan,
The services that the script should startup automatically does not generate any log file. This is, the startup of the services is not really executed I think.
I think that all environment variables are correct because when I execute the "service orainfra start" with root user, everything works OK.
Any other idea?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2006 06:52 AM
03-21-2006 06:52 AM
Re: user defined service
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2006 09:26 AM
03-21-2006 09:26 AM
Re: user defined service
Things to make sure of:
- All executables you're calling in your script are either fully-pathed, or you've re-defined the PATH at the start of your script.
- The hash-bang (#!) is set correctly.
- The script executes fine with a hash-bang of '#!/bin/sh'.
If all of this is ok, do you have any objections to attaching the script to a post so we can have a look through it ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2006 04:02 AM
03-22-2006 04:02 AM
Re: user defined service
The /home/oracle/orainfra.log is generated OK.
The /home/oracle/dbstart1.log is generated empty (0 bytes)
The /home/oracle/dbstart2.log is not generated. This is the line 'echo ...' in script /home/oracle/scripts/dbstart does not executes, so that I think the script is not really executed from /etc/init.d/orainfra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2006 06:58 AM
03-22-2006 06:58 AM
Re: user defined service
>> /home/oracle/orainfra.log 2>>&1
> /home/oracle/dbstart1.log 2>&1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2006 09:13 AM
03-22-2006 09:13 AM
Re: user defined service
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2006 09:42 AM
03-22-2006 09:42 AM
Re: user defined service
That being said, it all looks good. Things to double-check:
Ensure that the appropriate log files are either pre-created and owned by the appropriate users ('oracle' for all logs in this case), and that the user has enough permissions to create files in '/home/oracle/'.
Also ensure that script '/home/oracle/scripts/dbstart' is executable (+x). Given that you say this works if you run it out of the start-up routines however, I'm picking it is, but can't hurt to be doubly-sure.
It all looks good though. Odd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2006 11:52 PM
03-22-2006 11:52 PM
Re: user defined service
su - $ORA_OWNER -c "$USR_HOME/scripts/dbstart" >> /home/oracle/dbstart1.log 2>&1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 06:48 AM
03-23-2006 06:48 AM
Re: user defined service
I have double checkd all mentioned.
Any other idea?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 07:22 AM
03-23-2006 07:22 AM
Re: user defined service
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 07:38 AM
03-23-2006 07:38 AM
Re: user defined service
How can I add to dbstart script the sourcing of the user profile?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 08:44 AM
03-23-2006 08:44 AM
Re: user defined service
. /home/oracle/.bash_profile
You can also use
source /home/oracle/.bash_profile
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 08:57 AM
03-23-2006 08:57 AM
Re: user defined service
I think the switch to oracle user (su - oracle) is the thing that is not working.
Any idea?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 09:05 AM
03-23-2006 09:05 AM
Re: user defined service
Change the '#!/bin/bash' in both scripts to be '#!/bin/bash -x'.
This is for debugging, and will make things very noisy when they run. You should be able to the shell list every line of the script one-by-one, so you can see if it's actually getting into the 'dbstart' routine (I agree it doesn't look like it is). Hopefully, it'll spit something out that makes sense.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 09:33 AM
03-23-2006 09:33 AM
Re: user defined service
No difference at startup execution of the script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 09:33 AM
03-23-2006 09:33 AM
Re: user defined service
No difference in execution of the script at startup time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 10:32 AM
03-23-2006 10:32 AM
Re: user defined service
But all I tray to execute wiht "su - oracle..." is not executed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 10:33 AM
03-23-2006 10:33 AM
Re: user defined service
Any echo's that the start-routine's do should go to the console, so should be seen during the boot-proces.
What does the output of this look like:
ls -al /etc/{rc?,init}.d/*orainfra
Basically, just manually confirm these links point to the right spots.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 10:35 AM
03-23-2006 10:35 AM
Re: user defined service
I can work through a ssh session.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2006 11:59 AM
03-23-2006 11:59 AM
Re: user defined service
And it's not giving you a login on the console ?!? I'd consider that a greater issue. Is it stopping/blanking when it gets to this startup routine, or before it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2006 01:45 AM
03-24-2006 01:45 AM
Re: user defined service
-rwxr-xr-x 1 root root 996 Mar 23 17:08 /etc/init.d/orainfra
[root@svr04 ~]# ls -al /etc/rc5.d/*orainfra
lrwxrwxrwx 1 root root 18 Mar 23 13:26 /etc/rc5.d/S98orainfra -> ../init.d/orainfra
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2006 08:26 AM
03-24-2006 08:26 AM
Re: user defined service
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2006 08:54 AM
03-24-2006 08:54 AM