i found documentation for logger stating one can use --id=$$ to log the pid of the calling script. unfortunatly this is not working with logger in centos7.
what is the proper way of logging pid to syslog in centos7?
i found documentation for logger stating one can use --id=$$ to log the pid of the calling script. unfortunatly this is not working with logger in centos7.
what is the proper way of logging pid to syslog in centos7?
Your issues seems to be down a slight difference in what the man page you link to says is supported, and what your logger actually supports.
I just checked a centOS7 system, and I can replicate your issue:
$ sudo logger --help
Usage:
logger [options] [message]
Options:
-T, --tcp use TCP only
-d, --udp use UDP only
-i, --id log the process ID too
<snip>
$ sudo logger --id=11 test
logger: option '--id' doesn't allow an argument
So on centOS7, logger will only allow you to include (or not) the PPID, it does not allow you to set the PID to something arbitrary.
So logger --id some msg
will NOT work, and is NOT equivalent to what logger --id=$$ some msg
would have done.
I should have checked the output more thoroughly before suggesting it was, thanks @user3347114 for correcting me.