[
https://issues.apache.org/jira/browse/KARAF-6290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16844620#comment-16844620
]
Baptiste DA ROIT edited comment on KARAF-6290 at 5/21/19 8:21 AM:
------------------------------------------------------------------
Service file can be improved to better manage such situations using _*pargs*_
or *_/usr/ucb/ps_* (if available) on Solaris.
{code:java}
# pargs 6043
6043:
/opt/smartcollector-dev2/smartcollector-dist-5.7.5-SNAPSHOT/bin/smartcollector-
argv[0]:
/opt/smartcollector-dev2/smartcollector-dist-5.7.5-SNAPSHOT/bin/smartcollector-dev2-wrapper
argv[1]:
/opt/smartcollector-dev2/smartcollector-dist-5.7.5-SNAPSHOT/etc/smartcollector-dev2-wrapper.conf
argv[2]: wrapper.syslog.ident=smartcollector-dev2
argv[3]:
wrapper.pidfile=/opt/smartcollector-dev2/smartcollector-dist-5.7.5-SNAPSHOT/smartcollector-dev2.wrapper.pid
argv[4]: wrapper.daemonize=TRUE
# /usr/ucb/ps -auxwww 2651
USER PID %CPU %MEM SZ RSS TT S START TIME COMMAND
smcdev2 2651 0.1 0.1 3516 1404 ? S 19:38:09 0:01
/u01/apps/smartcollector/smartcollector-dist-5.7.5-SNAPSHOT/bin/smartcollector-wrapper
/u01/apps/smartcollector/smartcollector-dist-5.7.5-SNAPSHOT/etc/smartcollector-wrapper.conf
wrapper.syslog.ident=smartcollector
wrapper.pidfile=/u01/apps/smartcollector/smartcollector-dist-5.7.5-SNAPSHOT/smartcollector.wrapper.pid
wrapper.daemonize=TRUE
{code}
Also, *_ps_* command on HP-UX platforms has recently be patched to add a _*-x*_
option which will allow to get more characters on the output.
{code:sh}
# ps -p 26065 -x
PID TTY TIME COMMAND
26065 ? 1:31
/opt/smartcollector-dev2/smartcollector-dist-5.7.5-SNAPSHOT/bin/smartcollector-dev2-wrapper
/opt/smartcollector-dev2/smartcollector-dist-5.7.5-SNAPSHOT/etc/smartcollector-dev2-wrapper.conf
wrapper.syslog.ident=smartcollector-dev2
wrapper.pidfile=/opt/smartcollector-dev2/smartcollector-dist-5.7.5-SNAPSHOT/smartcollector-dev2.wrapper.pid
wrapper.daemonize=TRUE
{code}
I can make a PR to adapt the script.
was (Author: baptistedaroit):
Service file can be improved to better manage such situations using _*pargs*_
or *_/usr/ucb/ps_* (if available) on Solaris.
Also, *_ps_* command on HP-UX platforms has recently be patched to add a _*-x*_
option which will allow to get more characters on the output.
I can make a PR to adapt the script.
> Karaf Wrapper does not properly manage process on Solaris
> ---------------------------------------------------------
>
> Key: KARAF-6290
> URL: https://issues.apache.org/jira/browse/KARAF-6290
> Project: Karaf
> Issue Type: Bug
> Components: karaf
> Affects Versions: 4.2.5
> Environment: Solaris
> HP
> Reporter: Baptiste DA ROIT
> Priority: Major
>
> On Solaris platform, the restriction of ps command does not allow the Karaf
> Service Wrapper to properly manage associated karaf process:
> {code}
> [root ~] # cat
> /opt/smartcollector-dev2/smartcollector-dist-5.7.5-SNAPSHOT/smartcollector-dev2.wrapper.pid
> 6043
> [root ~] # ps -p 6043 -o comm
> COMMAND
> /opt/smartcollector-dev2/smartcollector-dist-5.7.5-SNAPSHOT/bin/smartcollector-
> {code}
> As we can see, if the path to wrapper executable is too long, il will cause
> the service to fail to stop associated karaf instance, as detailed below:
> {code}
> [root ~] # /etc/init.d/smartcollector-dev2 status
> Removed stale pid file:
> /opt/smartcollector-dev2/smartcollector-dist-5.7.5-SNAPSHOT/smartcollector-dev2.wrapper.pid
> smartcollector-dev2 is not running.
> [root ~] # ps -ef | grep smartco
> smcdev 6043 1 0 02:20:27 ? 0:01
> /opt/smartcollector-dev2/smartcollector-dist-5.7.5-SNAPSHOT/bin/smartcollector-
> smcdev 6044 6043 0 02:20:28 ? 4:11
> /opt/smartcollector-dev2/smartcollector-java/bin/java
> -Djava.endorsed.dirs=/opt
> [root ~] # /etc/init.d/smartcollector-dev2 stop
> Stopping smartcollector-dev2...
> smartcollector-dev2 was not running.
> [root ~] # ps -ef | grep smartco
> smcdev 6043 1 0 02:20:27 ? 0:01
> /opt/smartcollector-dev2/smartcollector-dist-5.7.5-SNAPSHOT/bin/smartcollector-
> smcdev 6044 6043 0 02:20:28 ? 4:11
> /opt/smartcollector-dev2/smartcollector-java/bin/java
> -Djava.endorsed.dirs=/opt
> {code}
> This issue can also appears on HP-UX platform, where default ps command is
> also limited to a certain amount of characters (it seems to be 128).
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)