Comment 5 for bug 1263476

Revision history for this message
Raghavendra D Prabhu (raghavendra-prabhu) wrote :

@Ryan,

Thanks for the details.

a)
The lsof I had provided was for linux so may not have matched
correctly.

The requirement is that it should see if there is a listening
process named either socat or nc on that $PORT.

Now:
 lsof -o $PORT | grep -qE 'socat|nc' && break

 Is there a way to check if the $PORT is a listening one?

b)
 Regarding /opt, in general, the FHS states that any standard
 binaries/packages have to be in /usr, /bin, /sbin etc. and /opt
 is reserved for custom installed ones - http://www.pathname.com/fhs/2.2/fhs-3.12.html

 Don't /bin|/sbin|/usr/bin etc. not have grep, lsof etc.?

 In any case, for now, I suggest symlinking or updating the PATH
 for daemon (which will be passed to script) or having them in
 $basedir/bin (mysql basedir).