minor fixes

Change-Id: I16d16df9db05219fefd918d2c977e6ee6cc9f5f0
Signed-off-by: SJ <sj@acts.hu>
This commit is contained in:
SJ 2016-11-26 11:49:08 +01:00
parent 0b95fc19ac
commit 1a68d37a36
3 changed files with 13 additions and 2 deletions

View File

@ -17,8 +17,12 @@ NAME=piler
OPTIONS=""
PID_FILE=`SBINDIR/pilerconf $OPTIONS -q pidfile | cut -f2 -d=`
PID_NUMBER=`test -f ${PID_FILE} && cat ${PID_FILE}`
PILER_SMTP_PID=$(ps uaxw | grep -w piler-smtp | grep -v grep | awk '{print $2}')
start() {
echo "starting piler-smtp . . . "
SBINDIR/piler-smtp -d
echo "starting $NAME . . ."
SBINDIR/piler -d $OPTIONS
}
@ -26,10 +30,18 @@ start() {
stop() {
echo "stopping $NAME"
kill ${PID_NUMBER}
if [ $PILER_SMTP_PID != '' ]; then echo "stopping piler-smtp"; kill $PILER_SMTP_PID; fi
}
check_status(){
test -f /proc/${PID_NUMBER}/status
if [ "${PILER_SMTP_PID}" != '' ]; then
echo "piler-smtp is running, pid: ${PILER_SMTP_PID}";
else
echo "piler-smtp is NOT running";
fi
}
case "$1" in

View File

@ -272,7 +272,7 @@ int main(int argc, char **argv){
else
readlen = read(events[i].data.fd, (char*)&readbuf[0], sizeof(readbuf)-1);
if(cfg.verbosity >= _LOG_DEBUG) syslog(LOG_PRIORITY, "got %ld bytes to read", readlen);
if(cfg.verbosity >= _LOG_DEBUG && readlen > 0) syslog(LOG_PRIORITY, "got %ld bytes to read", readlen);
if(readlen == -1){
/* If errno == EAGAIN, that means we have read all data. So go back to the main loop. */

View File

@ -174,7 +174,6 @@ void handle_data(struct smtp_session *session, char *readbuf, int readlen){
// process other SMTP commands
else {
//printf("len=%d, buf=*%s*\n\n\n", readlen, readbuf);
if(session->buflen > 0){
snprintf(puf, sizeof(puf)-1, "%s%s", session->buf, readbuf);