Bash script for log rotation
Shellcheck points out this one:

pid=&quot;$(pidof $procname)&quot;
if [[ ! $? == 0 ]]
then


We can write that more clearly
if ! pid=&quot;$(pidof $procname)&quot;
then

Shortly after that is:

# don't rotate anything if the application is not running
echo &quot;$procname process not running&quot;


That looks like an error message - redirect that to &amp;2.
I'm a little concerned about

# find the active logfile (should be the last one) and delete it from the array


If the daemon didn't get around to opening a new file by the time we reach here, then we'll be out of sync.  That said, it probably doesn't matter - we'll just have one more unrotated file around until we next run, which isn't a big concern.
Take care with commands like this:

gzip &quot;${list[@]}&quot;


It's a good idea to use -- so we can be sure that filenames beginning with - aren't interpreted as options.
Also, commands such as gzip can fail - do we really want to keep going if they do?  (This question isn't so simple to answer, as one of the likely reasons is &quot;no space on device&quot;, and in that case we do want to delete some files!)