init.d script - /sbin/service: line 66: 23002 Terminated
i copy init.d script 3proxyx to 3proxy and it should work fine, but it doesnt!
Such a simple task and having mega issues... GRR [root@enzu2 ~]# cd /etc/init.d [root@enzu2 init.d]# chmod +x /etc/init.d/3proxyx [root@enzu2 init.d]# service 3proxyx restart Stopping 3Proxy 3proxy: no process killed Starting 3Proxy [root@enzu2 init.d]# service 3proxyx restart Stopping 3Proxy Starting 3Proxy [root@enzu2 init.d]# cp /etc/init.d/3proxyx /etc/init.d/3proxy [root@enzu2 init.d]# chmod +x /etc/init.d/3proxy [root@enzu2 init.d]# service 3proxy restart Stopping 3Proxy /sbin/service: line 66: 23299 Terminated env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" ${OPTIONS} [root@enzu2 init.d]# service 3proxy start Starting 3Proxy [root@enzu2 init.d]# service 3proxy stop Stopping 3Proxy /sbin/service: line 66: 23317 Terminated env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" ${OPTIONS} [root@enzu2 init.d]# service 3proxy restart Stopping 3Proxy /sbin/service: line 66: 23324 Terminated env -i LANG="$LANG" PATH="$PATH" TERM="$TERM" "${SERVICEDIR}/${SERVICE}" ${OPTIONS} [root@enzu2 init.d]# SEE MY ERROR? -bash: SEE: command not found [root@enzu2 init.d]# here is /etc/init.d/3proxyx Code:
#!/bin/sh |
I think that your "killall 3proxy" in "stop" command killed your service utility (/etc/init.d/3proxy) which has also name "3proxy". Better is using pids for that.
|
I fully agree with eSelix's analysis.
There are two methods I've used in service scripts, to solve the problem (of stopping a service reliably). First looks up the PIDs using ps -C 3proxy -o pid= , and kills only those: Code:
CMDNAME=3proxy This procedure lets the service catch the TERM signal, do whatever cleanup it sees necessary, and then exit, by its own volition. The KILL signal will forcibly terminate the process immediately (unless it is blocked in some kernel call). The other method is the more typical one. The service processes save the main PID in a pid file, usually /var/run/name.pid . (I do not know if 3proxy creates a pid file or not, and I'm too lazy to find out. Sorry.) The service script should check if that file exists. If not, the service is not running. If the file specifies a PID that is no longer running (or runs a different binary), then the service has crashed. Only if the PID is still running (and has the proper name, since PIDs can be reused after a while), the service is still up. For example, to stop the service, you might use Code:
CMDNAME=3proxy I hope this helps, |
All times are GMT -5. The time now is 09:02 PM. |