Dear colls,
first: I put the script (oemagent) into the dir /etc/rc.d and at the symlinks (S14oemagent) to rc3.d and rc5.d. And Reboot the box, I see at the boot.msg that the script is not startet in order of S10*, much more is it start before S10*.
S10winbind is need vor the new Script(S14oemagent), because of user verification on Windows ADS.
Script:
#!/sbin/sh
2 #
3 # DATEI: /etc/init.d/oemagent
4 # DATE : 06.08.2013
5 #
9
10 # Allowed exit values:
11 # 0 = success; causes “OK” to show up in checklist.
12 # 1 = failure; causes “FAIL” to show up in checklist.
13 # 2 = skip; causes “N/A” to show up in the checklist.
14 # Use this value if execution of this script is overridden
15 # by the use of a control variable, or if this script is not
16 # appropriate to execute for some other reason.
17 # 3 = reboot; causes the system to be rebooted after execution.
18
19 # Input and output:
20 # stdin is redirected from /dev/null
21 #
22 # stdout and stderr are redirected to the /etc/rc.log file
23 # during checklist mode, or to the console in raw mode.
24
25 ### BEGIN INIT INFO
26 # Provides: oemagent
27 # Required-Start: $network winbind
28 # Should-Start:
29 # Required-Stop: $network
30 # Should-Stop:
31 # Default-Start: 3 5
32 # Default-Stop: 0 1 2 6
33 # Short-Description: OEM Agent
34 # Description: Startet den OEM Agent
35 #
36 ### END INIT INFO
37
38 #set -vx
39 AGENT_HOME=/oem/12.1/agent_inst
40 PATH=/usr/sbin:/usr/bin:/sbin:${AGENT_HOME}/bin:/bin
41 export PATH AGENT_HOME
42
43
44 rval=0
45
46 # Check the exit value of a command run by this script. If non-zero, the
47 # exit code is echoed to the log file and the return value of this script
48 # is set to indicate failure.
49
50 # Kill the named process(es).
51 # $1=
52
53 killproc() {
54 pid=ps -e | awk '$NF~/'"$1"'/ {print $1}'
55 if [ “X$pid” != “X” ]; then
56 if kill “$pid”; then
57 echo “$1 stopped”
58 else
59 rval=1
60 echo “Unable to stop $1”
61 fi
62 fi
63 }
64
65case $1 in
67 ‘start_msg’)
68 # Emit a short message relating to running this script with
69 # the “start” argument; this message appears as part of the checklist.
70 echo “Starting ORACLE OEM-Agent”
71 ;;
72
73 ‘stop_msg’)
74 # Emit a short message relating to running this script with
75 # the “stop” argument; this message appears as part of the checklist.
76 echo “Stopping ORACLE OEM-Agent”
77 ;;
78
79 ‘start’)
80
81 # source the system configuration variables
82 #if [ -f /etc/rc.config ] ; then
83 # . /etc/rc.config
84 #else
85 # echo “ERROR: /etc/rc.config defaults file MISSING”
86 #fi
87
88 # Check to see if this script is allowed to run…
89 # wait for SLM to disconnect to port
90 echo “ORACLE OEM wird gestartet”
91 su - adm_oem -c “${AGENT_HOME}/bin/emctl start agent”
92 rval=0
93 #fi
94 ;;
95
96 ‘stop’)
97 # source the system configuration variables
98 #if [ -f /etc/rc.config ] ; then
99 # . /etc/rc.config
100 #else
101 # echo “ERROR: /etc/rc.config defaults file MISSING”
102 #fi
103
104 # Check to see if this script is allowed to run…
105 echo “SLM-Server wird jetzt gestoppt”
106 #su - adm_oem -c “${AGENT_HOME}/bin/emctl stop agent”
107
108 rval=0
109 #fi
110 ;;
111 ‘status’)
112 # source the system configuration variables
113 #if [ -f /etc/rc.config ] ; then
114 # . /etc/rc.config
115 #else
116 # echo “ERROR: /etc/rc.config defaults file MISSING”
117 #fi
118
119 # Check to see if this script is allowed to run…
120 su - adm_oem -c “${AGENT_HOME}/bin/emctl status agent”
121 rval=0
122 #fi
123 ;;
124 *)
125 echo “usage: $0 {start stop status)”
126 rval=1
127 ;;
128 esac
129
130 exit $rval
All user rights check and all symlinks.
Have any Body a Idear?
Regards
Joe