salt icon indicating copy to clipboard operation
salt copied to clipboard

unary operator expected?

Open shantanub opened this issue 12 years ago • 4 comments

I seem to have come across a weird bug in 17.4. I can't tell yet if it's impacting anything but whenever I have a state execute on a minion I'm greeted with the following error message (no matter the state):

/etc/init.d/salt-minion: line 67: [: 25051: unary operator expected

line 67 of the my salt-minion init script is the following:

if [ $(pidofproc $PROCESS) ]; then

shantanub avatar Dec 31 '13 16:12 shantanub

Very strange! Thanks for the report, we'll see if we can reproduce this.

basepi avatar Jan 03 '14 21:01 basepi

I have started seeing almost the same error at the same location: line 67 of /etc/init.d/salt-minion. But my error is "56078: unary operator expected" and it happens whenever I restart the minion.

Fierozen avatar Jan 04 '14 18:01 Fierozen

@Fierozen & @basepi This error is because the if statement is comparing multiple PID's. This needs to be changed to:-

if $(pidofproc $PROCESS) ; then

This will only check the exit status and not the multiple PID's. I can submit a Pull request shortly.

dmyerscough avatar Jan 06 '14 15:01 dmyerscough

Thanks @dmyerscough!

terminalmage avatar Jan 06 '14 17:01 terminalmage