2 # Find ps argument for Amanda::Process
4 AC_DEFUN([AMANDA_PS_ARGUMENT],
7 AC_MSG_CHECKING([ps argument to use])
10 # ps is *very* non-portable, and across many systems, the same option
11 # (e.g., -e) can mean different things. So this macro tries to
12 # special-case most known systems, and makes an effort to detect unknown
16 PS_ARGUMENT="-eo pid,ppid,comm"
17 PS_ARGUMENT_ARGS="-eo pid,ppid,comm"
21 PS_ARGUMENT="-eo pid,ppid,command"
22 PS_ARGUMENT_ARGS="-eo pid,ppid,command"
26 PS_ARGUMENT="-axo pid,ppid,command"
27 PS_ARGUMENT_ARGS="-axo pid,ppid,command"
31 PS_ARGUMENT="-aAco pid,ppid,command"
32 PS_ARGUMENT_ARGS="-aAo pid,ppid,command"
36 # Cygwin is special-cased in Amanda::Process
38 PS_ARGUMENT_ARGS="-ef"
42 # HPUX's 'PS' needs the env var UNIX95 to run in "xpg4" mode
44 PS_ARGUMENT="-eo pid,ppid,comm"
45 PS_ARGUMENT_ARGS="-eo pid,ppid,comm"
50 "-axo pid,ppid,command" \
51 "-aAco pid,ppid,command" \
54 ps $try >/dev/null 2>/dev/null
55 if test $? -eq 0; then
61 "-axo pid,ppid,command" \
62 "-aAo pid,ppid,command" \
65 ps $try >/dev/null 2>/dev/null
66 if test $? -eq 0; then
67 PS_ARGUMENT_ARGS="$try"
71 if test -z "$PS_ARGUMENT" -o -z "$PS_ARGUMENT_ARGS"; then
72 AC_MSG_ERROR([Can't find ps argument to use.])
77 AC_MSG_RESULT($PS_ARGUMENT)
79 AC_MSG_RESULT($PS_ARGUMENT_ARGS)
80 AC_SUBST(PS_ARGUMENT_ARGS)