#! /bin/sh # # Copyright (C) 2016 Marko Myllynen # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # for more details. # . $PCP_DIR/etc/pcp.env . $PCP_SHARE_DIR/lib/pmdaproc.sh # Note that root cannot attach to other users' JVMs due to Java limitations. # For details, see https://bugzilla.redhat.com/show_bug.cgi?id=1311638 iam=jmx domain=498 perl_opt=true daemon_opt=false forced_restart=true # Get os_user eval `perl $PCP_PMDAS_DIR/$iam/pmda$iam.pl --config` id -g $os_user > /dev/null 2>&1 if test $? -ne 0; then echo "Cannot change user to $os_user, sorry this is fatal" exit 1 fi mkdir -p "$PCP_VAR_DIR/config/pmda" 2> /dev/null indoms="0" for indom in $indoms do failed=false touch "$PCP_VAR_DIR/config/pmda/$domain.$indom" > /dev/null 2>&1 [ $? -ne 0 ] && failed=true chown $os_user "$PCP_VAR_DIR/config/pmda/$domain.$indom" [ $? -ne 0 ] && failed=true if $failed; then echo "Cannot create indom persistance files for user $user" echo "Failed on: $PCP_VAR_DIR/config/pmda/$domain.$indom" exit 1 fi done pmdaSetup pmdaInstall exit 0