unary operator expected?
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
Very strange! Thanks for the report, we'll see if we can reproduce this.
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 & @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.
Thanks @dmyerscough!