Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unary operator expected? #9511

Closed
shantanub opened this issue Dec 31, 2013 · 4 comments
Closed

unary operator expected? #9511

shantanub opened this issue Dec 31, 2013 · 4 comments
Labels
Bug broken, incorrect, or confusing behavior

Comments

@shantanub
Copy link

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
@basepi
Copy link
Contributor

basepi commented Jan 3, 2014

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

@Fierozen
Copy link

Fierozen commented Jan 4, 2014

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.

@dmyerscough
Copy link
Contributor

@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 added a commit to dmyerscough/salt that referenced this issue Jan 6, 2014
@terminalmage
Copy link
Contributor

Thanks @dmyerscough!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior
Projects
None yet
Development

No branches or pull requests

5 participants