debug of systemd service and logfile search
This commit is contained in:
parent
2f03f2fcdd
commit
104539f763
6
main.c
6
main.c
@ -140,6 +140,7 @@ int readconfig( struct config * cfg )
|
||||
strcpy(cfg->logfile, "/dev/null");
|
||||
retval += 2;
|
||||
}
|
||||
printf("logfile not found, defaulting to %s\n", cfg->logfile);
|
||||
}
|
||||
if (cfg->hostname[0] == 0 )
|
||||
{
|
||||
@ -151,16 +152,18 @@ int readconfig( struct config * cfg )
|
||||
{
|
||||
strcpy(cfg->hostname, HOSTNAME);
|
||||
}
|
||||
printf("hostname not found, defaulting to %s\n", cfg->hostname);
|
||||
}
|
||||
if (cfg->commande[0] == 0)
|
||||
{
|
||||
if (debug >=1) printf("command not found in config file: no command will be executed\n");
|
||||
printf("command not found in config file: no command will be executed\n");
|
||||
retval += 4;
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
//test if pid is in list of known sshd processus
|
||||
// return number of pid
|
||||
int isinarray( int pid, int array[], int n )
|
||||
{
|
||||
int x;
|
||||
@ -174,6 +177,7 @@ int isinarray( int pid, int array[], int n )
|
||||
return 0;
|
||||
}
|
||||
|
||||
// return date in localized format
|
||||
char* frtime(const time_t timet)
|
||||
{
|
||||
struct tm *date_tm;
|
||||
|
@ -4,10 +4,7 @@ After=sshd.service
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
|
||||
User=daemon
|
||||
Group=daemon
|
||||
|
||||
WorkingDirectory=/root
|
||||
ExecStart=/usr/bin/sshdetect
|
||||
|
||||
Restart=always
|
||||
|
Reference in New Issue
Block a user