ln -s /var/log/$SERVICE_NAME $RPM_INSTALL_PREFIX/logs || :
In the rpm specification file, each line ends with || : || :
|| :
What is the meaning of || : || : and why is it?
This ignores any error, so the rpm operation is not canceled.
|| forces the next command to run if the previous command failed, and : always succeeds.
||
:
He swallows the exit code.
|| does a thing after it if the thing before its failure (i.e. has a non-zero exit code). : - do nothing command. Combine them together ...
`||` is OR operator. `:` means "do nothing".
Your statement says: βMake a soft link or do nothingβ
I know that others answered, but I prefer to put:
command || /bin/true
IMHO, which makes it much more obvious to the next person who reads the bash script / spec file.
It just means OR. You can try a little testing like this
ls nofile-here-like || echo 'Not here'
If the file will not be displayed, an echo will be printed. Try with an existing file, it will not