The /etc/init.d/zm script runs $ZM_PATH_BIN/zmpkg.pl start, which in turn runs zmdc.pl check, which is run via the execute() function. This runs the given command using the ZM_WEB_USER user (in my case, apache). The output of the command is returned as text.
The problem is that it is checking for 'stopped' in order to start all the daemons. When using su, other text may appear before the output of the command, like "You password will expire in 6 days" (which is what happened in my case).
To fix my problem, I merely turned off password expiration for that user, however I see it being something that may bite people.
I'm not sure what the best solution would be...
(a) use status =~ insetad of status eq
(b) make the zmdc.pl status command return something more unique and use =~
(c) take only the last word of the text
(d) implement a better mechanism to determine if it is running
Luke