summaryrefslogtreecommitdiff
path: root/include/wolf/daemon/daemon.h
blob: ef6e7d2e26019f32ce679e646a555375ae7a279f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef WOLF_DAEMON_H
#define WOLF_DAEMON_H

#include "errors.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct daemon_t *daemon_p;

typedef struct daemon_params_t {
	const char *daemon_name;		/**< name of the daemon (used for setproctitle,
						     default name of the  pidfile, logfile) */
	const char *pid_filename;		/**< name of the pid/lock file */
	const char *group_name;			/**< group of the effective user */
	const char *user_name;			/**< name of the effective user */
} daemon_params_t;
		
daemon_p daemon_new( daemon_params_t params,
		     wolf_error_t *error );

void daemon_free( daemon_p demon );

wolf_error_t daemon_start( daemon_p demon );

void daemon_exit( daemon_p demon );

#ifdef __cplusplus
}
#endif

#endif /* ifndef WOLF_DAEMON_H */