|
|
SMS Server Tools 3 Community |
Welcome, Guest. The forum is currently read-only, but will open soon. |
Sat Mar 15, 2025 00:01 |
Page: 1
Keywords: Mode: All keywords (AND) |
Mon May 18, 2009 11:21
|
simix: Sounds like a good idea. May I suggest to call it MASTER instead of MAINPROCESS because it's a well known name for a main daemon process with many projects.
|
Mon May 18, 2009 05:54
|
simix: When logging to syslog, smstools is missing the correct program name in certain situations while logging to a file looks fine.
Log to file:
2009-03-01 04:02:22,2, smsd: Smsd v3.1.3 started.
2009-03-06 18:12:41,5, GSM1: SMS received, From: 00000000000
2009-03-06 18:12:41,5, GSM1: Wrote an incoming message file: /var/spool/sms/incoming/GSM1.dAif8Z
Log to syslog:
May 16 16:26:14 delta smsd: Smsd v3.1.3 started.
May 16 16:28:06 delta GSM1: GSM1: SMS received, From: 00000000000
May 16 16:28:06 delta GSM1: GSM1: Wrote an incoming message file: /var/spool/sms/incoming/GSM1.ZCRRFG
The patch below makes it log the way I expected it, like so:
May 16 17:20:24 delta smsd: Smsd v3.1.5beta9 started.
May 16 17:20:43 delta smsd: GSM1: SMS received, From: 00000000000
May 16 17:20:43 delta smsd: GSM1: Wrote an incoming message file: /var/spool/sms/incoming/GSM1.ZCRRFG
Regards,
Simon
diff -Naur smstools3.orig/src/logging.c smstools3/src/logging.c
--- smstools3.orig/src/logging.c 2009-05-05 18:29:48.000000000 +0200
+++ smstools3/src/logging.c 2009-05-16 17:15:03.000000000 +0200
@@ -28,12 +28,12 @@
int Filehandle = -1;
int Level;
-int openlogfile(char* filename,char* progname,int facility,int level)
+int openlogfile(char* filename,int facility,int level)
{
Level=level;
if (filename==0 || filename[0]==0 || strcmp(filename,"syslog")==0 || strcmp(filename,"0")==0)
{
- openlog(progname,LOG_CONS,facility);
+ openlog("smsd",LOG_CONS,facility);
Filehandle=-1;
return 0;
}
diff -Naur smstools3.orig/src/logging.h smstools3/src/logging.h
--- smstools3.orig/src/logging.h 2009-05-05 18:30:34.000000000 +0200
+++ smstools3/src/logging.h 2009-05-16 17:15:20.000000000 +0200
@@ -16,7 +16,7 @@
#ifndef LOGGING_H
#define LOGGING_H
-int openlogfile(char* filename,char* progname,int facility,int level);
+int openlogfile(char* filename,int facility,int level);
// if filename if 0, "" or "syslog": opens syslog. Level is ignored.
// else: opens a log file. Facility is not used. Level specifies the verbosity (9=highest).
diff -Naur smstools3.orig/src/smsd.c smstools3/src/smsd.c
--- smstools3.orig/src/smsd.c 2009-05-11 18:25:07.000000000 +0200
+++ smstools3/src/smsd.c 2009-05-16 17:16:27.000000000 +0200
@@ -5616,7 +5616,7 @@
exit(EXIT_FAILURE);
}
- logfilehandle = openlogfile(logfile, process_title, LOG_DAEMON, loglevel);
+ logfilehandle = openlogfile(logfile, LOG_DAEMON, loglevel);
writelogfile(LOG_CRIT, "Smsd v%s started.", smsd_version);
pwd = getpwuid(getuid());
@@ -5769,7 +5769,7 @@
{
if (devices[process_id].loglevel != -1)
loglevel = devices[process_id].loglevel;
- logfilehandle = openlogfile(devices[process_id].logfile, process_title, LOG_DAEMON, loglevel);
+ logfilehandle = openlogfile(devices[process_id].logfile, LOG_DAEMON, loglevel);
}
if (talk_with_modem(process_id) == 0)
@@ -5885,7 +5885,7 @@
{
if (devices[process_id].loglevel != -1)
loglevel = devices[process_id].loglevel;
- logfilehandle = openlogfile(devices[process_id].logfile, process_title, LOG_DAEMON, loglevel);
+ logfilehandle = openlogfile(devices[process_id].logfile, LOG_DAEMON, loglevel);
}
devicespooler(process_id, &modem);
|
Mon May 18, 2009 05:48
|
simix: Smstools doesn't compile on old GCC. The patch below fixed it.
Regards,
Simon
diff -Naur smstools3.orig/src/modeminit.c smstools3/src/modeminit.c
--- smstools3.orig/src/modeminit.c 2009-05-05 18:29:52.000000000 +0200
+++ smstools3/src/modeminit.c 2009-05-16 16:44:12.000000000 +0200
@@ -1267,6 +1267,7 @@
int retries = 0;
int registration_denied = 0;
static int registration_ok = 0;
+ char *p;
writelogfile(LOG_INFO, "Checking if Modem is registered to the network");
@@ -1284,7 +1285,6 @@
put_command(modem, device, "AT+CREG?\r", answer, sizeof(answer), 2, "(\\+CREG:.*OK)|(ERROR)");
// 3.1.1: Some modem include spaces in the response:
- char *p;
while ((p = strchr(answer, ' ')))
strcpy(p, p +1);
diff -Naur smstools3.orig/src/smsd_cfg.c smstools3/src/smsd_cfg.c
--- smstools3.orig/src/smsd_cfg.c 2009-05-11 18:06:35.000000000 +0200
+++ smstools3/src/smsd_cfg.c 2009-05-16 16:43:36.000000000 +0200
@@ -1317,6 +1317,7 @@
void parsearguments(int argc,char** argv)
{
int result;
+ int i;
strcpy(configfile,"/etc/smsd.conf");
printstatus=0;
arg_infofile[0] = 0;
@@ -1328,8 +1329,6 @@
communicate[0] = 0;
// 3.1.1: Start and stop options are provided by the script, not by the daemon:
- int i;
-
for (i = 1; i < argc; i++)
{
if (!strcasecmp(argv, "START") || !strcasecmp(argv, "STOP"))
|
Page: 1
Time in this board is UTC.
|
|
|
 |
|
 |
|