(*obj->logout)();
dsi_close(dsi);
+
+ /* UAM had syslog control; afpd needs to reassert itself */
+ openlog( "afpd", LOG_NDELAY|LOG_PID, LOG_DAEMON);
syslog(LOG_INFO, "%.2fKB read, %.2fKB written",
dsi->read_count/1024.0, dsi->write_count/1024.0);
}
{
dsi_attention(child.obj->handle, AFPATTN_SHUTDOWN);
afp_dsi_close(child.obj);
- if (sig == SIGTERM || sig == SIGALRM)
+ if (sig) /* if no signal, assume dieing because logins are disabled &
+ don't log it (maintenance mode)*/
+ syslog (LOG_INFO, "Connection terminated");
+ if (sig == SIGTERM || sig == SIGALRM) {
exit( 0 );
- else
+ }
+ else {
exit(sig);
+ }
}
static void afp_dsi_timedown()
}
}
+#ifdef SERVERTEXT
+static void afp_dsi_getmesg (int sig)
+{
+ readmessage();
+ dsi_attention(child.obj->handle, AFPATTN_MESG | AFPATTN_TIME(5));
+}
+#endif
+
static void alarm_handler()
{
/* if we're in the midst of processing something,
afp_dsi_die(1);
}
+#ifdef SERVERTEXT
+ /* Added for server message support */
+ action.sa_handler = afp_dsi_getmesg;
+ sigemptyset( &action.sa_mask );
+ sigaddset(&action.sa_mask, SIGUSR2);
+ action.sa_flags = SA_RESTART;
+ if ( sigaction( SIGUSR2, &action, 0) < 0 ) {
+ syslog( LOG_ERR, "afp_over_dsi: sigaction: %m" );
+ afp_dsi_die(1);
+ }
+#endif
+
/* tickle handler */
action.sa_handler = alarm_handler;
sigemptyset(&action.sa_mask);