mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
SysV init script for rpm: get and show unique PIDs only
This commit is contained in:
parent
8ff68c4128
commit
c94e798b8a
1 changed files with 6 additions and 4 deletions
|
@ -33,9 +33,9 @@
|
|||
SALTMINION="${SALTMINION_BINDIR}/salt-minion"
|
||||
SALTCALL="${SALTMINION_BINDIR}/salt-call"
|
||||
# SALTMINION_CONFIGS are newline-separated entries of: MINION_USER CONFIG_DIR
|
||||
: ${SALTMINION_CONFIGS:="
|
||||
: "${SALTMINION_CONFIGS:="
|
||||
$USER ${SALTMINION_SYSCONFDIR}/salt
|
||||
"}
|
||||
"}"
|
||||
SALTMINION_ARGS=""
|
||||
SALTMINION_TIMEOUT=30
|
||||
SALTMINION_TICK=1
|
||||
|
@ -68,7 +68,8 @@ _su_cmd() {
|
|||
|
||||
_get_pid() {
|
||||
netstat $NS_NOTRIM -ap --protocol=unix 2>$ERROR_TO_DEVNULL \
|
||||
| sed -r -e "\|\s${SOCK_DIR}/minion_event_${MINION_ID_HASH}_pub\.ipc$|"'!d; s|/.*||; s/.*\s//;'
|
||||
| sed -r -e "\|\s${SOCK_DIR}/minion_event_${MINION_ID_HASH}_pub\.ipc$|"'!d; s|/.*||; s/.*\s//;' \
|
||||
| uniq
|
||||
}
|
||||
|
||||
|
||||
|
@ -218,7 +219,8 @@ status() {
|
|||
local pid="$(_get_pid)"
|
||||
|
||||
if [ -n "$pid" ]; then
|
||||
echo "$SERVICE:$MINION_USER:$MINION_ID is running: $pid"
|
||||
# Unquote $pid here to display multiple PIDs in one line
|
||||
echo "$SERVICE:$MINION_USER:$MINION_ID is running:" $pid
|
||||
else
|
||||
retval=3
|
||||
echo "$SERVICE:$MINION_USER:$MINION_ID is stopped."
|
||||
|
|
Loading…
Add table
Reference in a new issue