I wrote a small init script for proftpd (latest stable version, compiled myself) and am noticing that the executable exits with status 0 even if server fails to start (in my case, for example, due to SSH port conflict).
- Shouldn’t it exit with > 0? Or,
- How can a script detect whether startup was successful short of sleeping for arbitrary time and checking for PID?
# ./proftpd # echo $? //returns 0
…but in /var/log/messages:
Jan 27 12:20:15 staging3 proftpd[9103]: - Failed binding to 0.0.0.0, port 22: Address already in use Jan 27 12:20:15 staging3 proftpd[9103]: - Check the ServerType directive to ensure you are configured correctly.
Thanks -nikita