<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: user defined service in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756005#M22366</link>
    <description>&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hello Ivan,&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;I think that all environment variables are correct because when I execute the "service orainfra start" with root user, everything works OK.&lt;BR /&gt;&lt;BR /&gt;Any other idea?&lt;BR /&gt;</description>
    <pubDate>Tue, 21 Mar 2006 14:22:04 GMT</pubDate>
    <dc:creator>Tonatiuh</dc:creator>
    <dc:date>2006-03-21T14:22:04Z</dc:date>
    <item>
      <title>user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756003#M22364</link>
      <description>Red Hat Enterprise Linux 4&lt;BR /&gt;&lt;BR /&gt;I have added a "user defined service" named orainfra. I created in /etc/init.d/orainfra script to startup and stop some application services.&lt;BR /&gt;&lt;BR /&gt;I have added the service with:&lt;BR /&gt;&lt;BR /&gt;chkconfig --add orainfra&lt;BR /&gt;&lt;BR /&gt;[root@svr04 ~]# chkconfig --list |grep orainfra&lt;BR /&gt;orainfra        0:off   1:off   2:off   3:on    4:off   5:on    6:off&lt;BR /&gt;&lt;BR /&gt;After this it added the corresponding links in rcX.d correct levels.&lt;BR /&gt;&lt;BR /&gt;This line (into the script) defines the levels to run:&lt;BR /&gt;&lt;BR /&gt;# chkconfig: 35 98 11 &lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;Eventhough once started the server, if I execute manually the service (orainfra) it wors fine:&lt;BR /&gt;&lt;BR /&gt;service orainfra start&lt;BR /&gt;or&lt;BR /&gt;service orainfra stop&lt;BR /&gt;&lt;BR /&gt;Any idea about why it is not working at the starting up of the server?</description>
      <pubDate>Tue, 21 Mar 2006 13:33:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756003#M22364</guid>
      <dc:creator>Tonatiuh</dc:creator>
      <dc:date>2006-03-21T13:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756004#M22365</link>
      <description>Check your database log files. Where did you configured the kernel parameters for the database? If /etc/sysctl.conf is right, if /etc/rc.local is wrong and database may not start because the kernel parameters are not configured yet.&lt;BR /&gt;&lt;BR /&gt;Also, check your environment variables definition. Ensure that the scripts has all variables needed to sucessfully start the database.</description>
      <pubDate>Tue, 21 Mar 2006 14:08:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756004#M22365</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2006-03-21T14:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756005#M22366</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Hello Ivan,&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;I think that all environment variables are correct because when I execute the "service orainfra start" with root user, everything works OK.&lt;BR /&gt;&lt;BR /&gt;Any other idea?&lt;BR /&gt;</description>
      <pubDate>Tue, 21 Mar 2006 14:22:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756005#M22366</guid>
      <dc:creator>Tonatiuh</dc:creator>
      <dc:date>2006-03-21T14:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756006#M22367</link>
      <description>Redirect your script output to a log file, the start section, check the log file to verify what is happening.</description>
      <pubDate>Tue, 21 Mar 2006 14:52:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756006#M22367</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2006-03-21T14:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756007#M22368</link>
      <description>The environment during the boot phase isn't the same as after it's booted and you've logged in.&lt;BR /&gt;&lt;BR /&gt;Things to make sure of:&lt;BR /&gt;&lt;BR /&gt;- 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.&lt;BR /&gt;&lt;BR /&gt;- The hash-bang (#!) is set correctly.&lt;BR /&gt;&lt;BR /&gt;- The script executes fine with a hash-bang of '#!/bin/sh'.&lt;BR /&gt;&lt;BR /&gt;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 ?</description>
      <pubDate>Tue, 21 Mar 2006 17:26:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756007#M22368</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2006-03-21T17:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756008#M22369</link>
      <description>I have attached the scripts.&lt;BR /&gt;&lt;BR /&gt;The /home/oracle/orainfra.log is generated OK.&lt;BR /&gt;&lt;BR /&gt;The /home/oracle/dbstart1.log is generated empty (0 bytes)&lt;BR /&gt;&lt;BR /&gt;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&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Mar 2006 12:02:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756008#M22369</guid>
      <dc:creator>Tonatiuh</dc:creator>
      <dc:date>2006-03-22T12:02:54Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756009#M22370</link>
      <description>Use the following redirection:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; /home/oracle/orainfra.log 2&amp;gt;&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;&amp;gt; /home/oracle/dbstart1.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;</description>
      <pubDate>Wed, 22 Mar 2006 14:58:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756009#M22370</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2006-03-22T14:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756010#M22371</link>
      <description>The 2&amp;gt;&amp;gt;&amp;amp;1 redirection generates no logfile. This is, it does not send anything to logfile.</description>
      <pubDate>Wed, 22 Mar 2006 17:13:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756010#M22371</guid>
      <dc:creator>Tonatiuh</dc:creator>
      <dc:date>2006-03-22T17:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756011#M22372</link>
      <description>'2&amp;gt;&amp;gt;&amp;amp;1' isn't right, it should just be '2&amp;gt;&amp;amp;1'.  The appending is handled by file-descriptor 1's redirection ('&amp;gt;&amp;gt; /home/...').&lt;BR /&gt;&lt;BR /&gt;That being said, it all looks good.  Things to double-check:&lt;BR /&gt;&lt;BR /&gt;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/'.&lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;It all looks good though. Odd.</description>
      <pubDate>Wed, 22 Mar 2006 17:42:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756011#M22372</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2006-03-22T17:42:06Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756012#M22373</link>
      <description>Yes, it was in a hurry, the real command should look like:&lt;BR /&gt;&lt;BR /&gt;su - $ORA_OWNER -c "$USR_HOME/scripts/dbstart" &amp;gt;&amp;gt; /home/oracle/dbstart1.log 2&amp;gt;&amp;amp;1</description>
      <pubDate>Thu, 23 Mar 2006 07:52:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756012#M22373</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2006-03-23T07:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756013#M22374</link>
      <description>I am afraid that the 2&amp;gt;&amp;amp;1 does not generate logfile.&lt;BR /&gt;&lt;BR /&gt;I have double checkd all mentioned.&lt;BR /&gt;&lt;BR /&gt;Any other idea?</description>
      <pubDate>Thu, 23 Mar 2006 14:48:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756013#M22374</guid>
      <dc:creator>Tonatiuh</dc:creator>
      <dc:date>2006-03-23T14:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756014#M22375</link>
      <description>Try removing the - from the su (su oracle -c), add to dbstart script the sourcing of the user profile. I remember an error like "not a tty" when using "su -" from startup scripts.</description>
      <pubDate>Thu, 23 Mar 2006 15:22:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756014#M22375</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2006-03-23T15:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756015#M22376</link>
      <description>I have removed the "-c" with same result. &lt;BR /&gt;&lt;BR /&gt;How can I add to dbstart script the sourcing of the user profile?</description>
      <pubDate>Thu, 23 Mar 2006 15:38:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756015#M22376</guid>
      <dc:creator>Tonatiuh</dc:creator>
      <dc:date>2006-03-23T15:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756016#M22377</link>
      <description>Use dot-space-path_to_profile, like this:&lt;BR /&gt;&lt;BR /&gt;. /home/oracle/.bash_profile&lt;BR /&gt;&lt;BR /&gt;You can also use&lt;BR /&gt;&lt;BR /&gt;source /home/oracle/.bash_profile</description>
      <pubDate>Thu, 23 Mar 2006 16:44:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756016#M22377</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2006-03-23T16:44:39Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756017#M22378</link>
      <description>I did it with ". /home/oracle/.bash_profile" without better result.&lt;BR /&gt;&lt;BR /&gt;I think the switch to oracle user (su - oracle) is the thing that is not working.&lt;BR /&gt;&lt;BR /&gt;Any idea?</description>
      <pubDate>Thu, 23 Mar 2006 16:57:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756017#M22378</guid>
      <dc:creator>Tonatiuh</dc:creator>
      <dc:date>2006-03-23T16:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756018#M22379</link>
      <description>If that were the case, you'd be getting an error when you 'su' which would be visible.&lt;BR /&gt;&lt;BR /&gt;Change the '#!/bin/bash' in both scripts to be '#!/bin/bash -x'.&lt;BR /&gt;&lt;BR /&gt;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.</description>
      <pubDate>Thu, 23 Mar 2006 17:05:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756018#M22379</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2006-03-23T17:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756019#M22380</link>
      <description>The "-x" option shows line-by-line the execution of the script but only when it is exeucted manually (after startup process finished).&lt;BR /&gt;&lt;BR /&gt;No difference at startup execution of the script.</description>
      <pubDate>Thu, 23 Mar 2006 17:33:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756019#M22380</guid>
      <dc:creator>Tonatiuh</dc:creator>
      <dc:date>2006-03-23T17:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756020#M22381</link>
      <description>The "-x" option shows line-by-line the execution of the script but only when it is exeucted manually (after startup process finished).&lt;BR /&gt;&lt;BR /&gt;No difference in execution of the script at startup time.</description>
      <pubDate>Thu, 23 Mar 2006 17:33:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756020#M22381</guid>
      <dc:creator>Tonatiuh</dc:creator>
      <dc:date>2006-03-23T17:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756021#M22382</link>
      <description>I have modified the orainfra script (service) to execute all oracle commandos directly with oracle user and in that case all es executed (with wrong results because it must be execute with oracle, but it is execute).&lt;BR /&gt;&lt;BR /&gt;But all I tray to execute wiht "su - oracle..." is not executed.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 23 Mar 2006 18:32:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756021#M22382</guid>
      <dc:creator>Tonatiuh</dc:creator>
      <dc:date>2006-03-23T18:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: user defined service</title>
      <link>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756022#M22383</link>
      <description>That's not right!&lt;BR /&gt;&lt;BR /&gt;Any echo's that the start-routine's do should go to the console, so should be seen during the boot-proces.&lt;BR /&gt;&lt;BR /&gt;What does the output of this look like:&lt;BR /&gt;&lt;BR /&gt;ls -al /etc/{rc?,init}.d/*orainfra&lt;BR /&gt;&lt;BR /&gt;Basically, just manually confirm these links point to the right spots.</description>
      <pubDate>Thu, 23 Mar 2006 18:33:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/user-defined-service/m-p/3756022#M22383</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2006-03-23T18:33:20Z</dc:date>
    </item>
  </channel>
</rss>

