Lines Matching refs:daemon

301 apply_settings(struct daemon* daemon, struct config_file* cfg,  in apply_settings()  argument
311 daemon_apply_cfg(daemon, cfg); in apply_settings()
435 if(daemon(1, 0) != 0) in detach()
468 perform_setup(struct daemon* daemon, struct config_file* cfg, int debug_mode, in perform_setup() argument
478 if(!daemon_privileged(daemon)) in perform_setup()
493 if(!(daemon->rc = daemon_remote_create(cfg))) in perform_setup()
496 if(!(daemon->listen_sslctx = listen_sslctx_create( in perform_setup()
500 if (!SSL_CTX_set_cipher_list(daemon->listen_sslctx, cfg->tls_ciphers)) { in perform_setup()
506 if (!SSL_CTX_set_ciphersuites(daemon->listen_sslctx, cfg->tls_ciphersuites)) { in perform_setup()
513 if(!listen_sslctx_setup_ticket_keys(daemon->listen_sslctx, cfg->tls_session_ticket_keys.first)) { in perform_setup()
518 if(!(daemon->connect_sslctx = connect_sslctx_create(NULL, NULL, in perform_setup()
545 daemon->pidfile = strdup(cfg->pidfile); in perform_setup()
546 else daemon->pidfile = fname_after_chroot(cfg->pidfile, in perform_setup()
548 if(!daemon->pidfile) in perform_setup()
558 checkoldpid(daemon->pidfile, pidinchroot); in perform_setup()
570 writepid(daemon->pidfile, getpid()); in perform_setup()
573 (void)daemon; in perform_setup()
614 if(daemon->pidfile && daemon->pidfile[0] && in perform_setup()
615 strncmp(daemon->pidfile, cfg->chrootdir, in perform_setup()
617 char* old = daemon->pidfile; in perform_setup()
618 daemon->pidfile = strdup(old+strlen(cfg->chrootdir)); in perform_setup()
620 if(!daemon->pidfile) in perform_setup()
623 daemon->chroot = strdup(cfg->chrootdir); in perform_setup()
624 if(!daemon->chroot) in perform_setup()
698 struct daemon* daemon = NULL; in run_daemon() local
701 if(!(daemon = daemon_init())) in run_daemon()
703 while(!daemon->need_to_exit) { in run_daemon()
711 if(!config_read(cfg, cfgfile, daemon->chroot)) { in run_daemon()
719 apply_settings(daemon, cfg, cmdline_verbose, debug_mode); in run_daemon()
724 if(!daemon_open_shared_ports(daemon)) in run_daemon()
727 perform_setup(daemon, cfg, debug_mode, &cfgfile, need_pidfile); in run_daemon()
735 daemon_fork(daemon); in run_daemon()
739 daemon_cleanup(daemon); in run_daemon()
745 if(daemon->pidfile) { in run_daemon()
748 fd = open(daemon->pidfile, O_WRONLY | O_TRUNC in run_daemon()
756 unlink(daemon->pidfile); in run_daemon()
758 daemon_delete(daemon); in run_daemon()