Teonet library  0.4.7
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
daemon.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <signal.h>
#include <syslog.h>
#include "daemon.h"
#include "pidfile.h"
#include "utils/utils.h"
#include "config/conf.h"
#include "config/config.h"

Functions

void kill_other (char **argv, int other_pid)
 Kill started application in daemon mode. More...
 
void start_stop_daemon (char **argv, teonet_cfg *conf)
 Start or stop daemon mode. More...
 

Detailed Description

Author
Kirill Scherba kiril.nosp@m.l@sc.nosp@m.herba.nosp@m..ru

Start stop daemon mode for application.

Created on September 4, 2015, 11:20 PM

Function Documentation

void kill_other ( char **  argv,
int  other_pid 
)

Kill started application in daemon mode.

Parameters
argvApplication argv argument
other_pidProcess ID

Referenced by start_stop_daemon().

void start_stop_daemon ( char **  argv,
teonet_cfg conf 
)

Start or stop daemon mode.

Parameters
argvApplication argv argument
confPointer to teonet_cfg structure

References check_pid(), teonet_cfg::dflag, ERROR_M, FALSE, init_pidfile(), teonet_cfg::kflag, kill_other(), kill_pidfile(), ksnet_printf(), teonet_cfg::port, read_pidfile(), remove_pidfile(), and write_pidfile().

Referenced by ksnet_optRead().