diff options
Diffstat (limited to 'src/pies.c')
-rw-r--r-- | src/pies.c | 115 |
1 files changed, 59 insertions, 56 deletions
@@ -134,3 +134,3 @@ config_file_remove (const char *name) | |||
134 | struct grecs_list_entry *ep; | 134 | struct grecs_list_entry *ep; |
135 | 135 | ||
136 | for (ep = config_list->head; ep; ep = ep->next) | 136 | for (ep = config_list->head; ep; ep = ep->next) |
@@ -158,3 +158,3 @@ config_file_list_serialize (struct json_value *ar) | |||
158 | struct grecs_list_entry *ep; | 158 | struct grecs_list_entry *ep; |
159 | 159 | ||
160 | for (ep = config_list->head; ep; ep = ep->next) | 160 | for (ep = config_list->head; ep; ep = ep->next) |
@@ -329,3 +329,3 @@ action_free (struct action *act) | |||
329 | free (act->command); | 329 | free (act->command); |
330 | 330 | ||
331 | free (act); | 331 | free (act); |
@@ -361,3 +361,3 @@ create_action (struct component *comp, | |||
361 | size_t len = strlen (arg); | 361 | size_t len = strlen (arg); |
362 | 362 | ||
363 | if (isdigit (arg[0])) | 363 | if (isdigit (arg[0])) |
@@ -396,3 +396,3 @@ create_action (struct component *comp, | |||
396 | } | 396 | } |
397 | 397 | ||
398 | /* Alles in ordnung */ | 398 | /* Alles in ordnung */ |
@@ -401,3 +401,3 @@ create_action (struct component *comp, | |||
401 | } | 401 | } |
402 | 402 | ||
403 | if (retc == 0 && !allflag) | 403 | if (retc == 0 && !allflag) |
@@ -474,3 +474,3 @@ return_code_section_parser (enum grecs_callback_command cmd, | |||
474 | } | 474 | } |
475 | 475 | ||
476 | switch (value->type) | 476 | switch (value->type) |
@@ -480,3 +480,3 @@ return_code_section_parser (enum grecs_callback_command cmd, | |||
480 | break; | 480 | break; |
481 | 481 | ||
482 | case GRECS_TYPE_ARRAY: | 482 | case GRECS_TYPE_ARRAY: |
@@ -485,3 +485,3 @@ return_code_section_parser (enum grecs_callback_command cmd, | |||
485 | break; | 485 | break; |
486 | 486 | ||
487 | case GRECS_TYPE_LIST: | 487 | case GRECS_TYPE_LIST: |
@@ -494,3 +494,3 @@ return_code_section_parser (enum grecs_callback_command cmd, | |||
494 | break; | 494 | break; |
495 | 495 | ||
496 | case grecs_callback_section_end: | 496 | case grecs_callback_section_end: |
@@ -544,3 +544,3 @@ _cb_command (enum grecs_callback_command cmd, | |||
544 | break; | 544 | break; |
545 | 545 | ||
546 | case GRECS_TYPE_ARRAY: | 546 | case GRECS_TYPE_ARRAY: |
@@ -704,3 +704,3 @@ _cb_redir (enum grecs_callback_command cmd, | |||
704 | int res; | 704 | int res; |
705 | 705 | ||
706 | switch (value->type) | 706 | switch (value->type) |
@@ -721,3 +721,3 @@ _cb_redir (enum grecs_callback_command cmd, | |||
721 | break; | 721 | break; |
722 | 722 | ||
723 | case GRECS_TYPE_ARRAY: | 723 | case GRECS_TYPE_ARRAY: |
@@ -741,3 +741,3 @@ _cb_redir (enum grecs_callback_command cmd, | |||
741 | return 0; | 741 | return 0; |
742 | 742 | ||
743 | switch (res) | 743 | switch (res) |
@@ -746,3 +746,3 @@ _cb_redir (enum grecs_callback_command cmd, | |||
746 | break; | 746 | break; |
747 | 747 | ||
748 | case redir_syslog: | 748 | case redir_syslog: |
@@ -757,3 +757,3 @@ _cb_redir (enum grecs_callback_command cmd, | |||
757 | break; | 757 | break; |
758 | 758 | ||
759 | case redir_file: | 759 | case redir_file: |
@@ -766,3 +766,3 @@ _cb_redir (enum grecs_callback_command cmd, | |||
766 | break; | 766 | break; |
767 | 767 | ||
768 | default: | 768 | default: |
@@ -770,3 +770,3 @@ _cb_redir (enum grecs_callback_command cmd, | |||
770 | } | 770 | } |
771 | 771 | ||
772 | return 0; | 772 | return 0; |
@@ -775,4 +775,4 @@ _cb_redir (enum grecs_callback_command cmd, | |||
775 | static struct tokendef socktype_xtab[] = { | 775 | static struct tokendef socktype_xtab[] = { |
776 | { "stream", SOCK_STREAM }, | 776 | { "stream", SOCK_STREAM }, |
777 | { "dgram", SOCK_DGRAM }, | 777 | { "dgram", SOCK_DGRAM }, |
778 | { "seqpacket", SOCK_SEQPACKET }, | 778 | { "seqpacket", SOCK_SEQPACKET }, |
@@ -822,2 +822,4 @@ static struct tokendef modetab[] = { | |||
822 | {"pass", pies_comp_pass_fd}, | 822 | {"pass", pies_comp_pass_fd}, |
823 | {"startup", pies_comp_startup}, | ||
824 | {"shutdown", pies_comp_shutdown}, | ||
823 | {"boot", pies_comp_boot}, | 825 | {"boot", pies_comp_boot}, |
@@ -827,3 +829,3 @@ static struct tokendef modetab[] = { | |||
827 | {"powerokwait", pies_comp_powerokwait}, | 829 | {"powerokwait", pies_comp_powerokwait}, |
828 | {"ctrlaltdel", pies_comp_ctrlaltdel}, | 830 | {"ctrlaltdel", pies_comp_ctrlaltdel}, |
829 | {"ondemand", pies_comp_ondemand}, | 831 | {"ondemand", pies_comp_ondemand}, |
@@ -922,3 +924,3 @@ _cb_flags (enum grecs_callback_command cmd, | |||
922 | break; | 924 | break; |
923 | 925 | ||
924 | case GRECS_TYPE_LIST: | 926 | case GRECS_TYPE_LIST: |
@@ -926,3 +928,3 @@ _cb_flags (enum grecs_callback_command cmd, | |||
926 | struct grecs_list_entry *ep; | 928 | struct grecs_list_entry *ep; |
927 | 929 | ||
928 | for (ep = value->v.list->head; ep; ep = ep->next) | 930 | for (ep = value->v.list->head; ep; ep = ep->next) |
@@ -941,3 +943,3 @@ _cb_flags (enum grecs_callback_command cmd, | |||
941 | break; | 943 | break; |
942 | 944 | ||
943 | case GRECS_TYPE_ARRAY: | 945 | case GRECS_TYPE_ARRAY: |
@@ -1230,3 +1232,3 @@ find_component_keyword (const char *ident) | |||
1230 | struct grecs_keyword *kwp; | 1232 | struct grecs_keyword *kwp; |
1231 | 1233 | ||
1232 | for (kwp = component_keywords; kwp->ident; kwp++) | 1234 | for (kwp = component_keywords; kwp->ident; kwp++) |
@@ -1258,3 +1260,3 @@ component_section_parser (enum grecs_callback_command cmd, | |||
1258 | break; | 1260 | break; |
1259 | 1261 | ||
1260 | case grecs_callback_set_value: | 1262 | case grecs_callback_set_value: |
@@ -1536,3 +1538,3 @@ pies_config_parse (char const *name) | |||
1536 | return 1; | 1538 | return 1; |
1537 | 1539 | ||
1538 | for (node = tree; node; node = node->next) | 1540 | for (node = tree; node; node = node->next) |
@@ -1552,3 +1554,3 @@ pies_config_parse (char const *name) | |||
1552 | return 1; | 1554 | return 1; |
1553 | 1555 | ||
1554 | return 0; | 1556 | return 0; |
@@ -1575,3 +1577,3 @@ pies_read_config (void) | |||
1575 | component_config_begin (); | 1577 | component_config_begin (); |
1576 | 1578 | ||
1577 | for (ep = config_list->head; ep; ep = ep->next) | 1579 | for (ep = config_list->head; ep; ep = ep->next) |
@@ -1585,6 +1587,6 @@ pies_read_config (void) | |||
1585 | err = 0; | 1587 | err = 0; |
1586 | 1588 | ||
1587 | if (err) | 1589 | if (err) |
1588 | component_config_rollback (); | 1590 | component_config_rollback (); |
1589 | 1591 | ||
1590 | return err; | 1592 | return err; |
@@ -1658,3 +1660,3 @@ setsigvhan (RETSIGTYPE (*handler) (int signo), int *sigv, int sigc) | |||
1658 | struct sigaction act; | 1660 | struct sigaction act; |
1659 | 1661 | ||
1660 | act.sa_flags = 0; | 1662 | act.sa_flags = 0; |
@@ -1781,3 +1783,3 @@ request_restart_components (size_t cc, char **cv) | |||
1781 | size_t i, j; | 1783 | size_t i, j; |
1782 | 1784 | ||
1783 | argv = grecs_calloc (5 + 3 * cc - 1, sizeof (*argv)); | 1785 | argv = grecs_calloc (5 + 3 * cc - 1, sizeof (*argv)); |
@@ -1805,3 +1807,3 @@ list_components (void) | |||
1805 | char *argv[5]; | 1807 | char *argv[5]; |
1806 | 1808 | ||
1807 | argv[0] = "piesctl"; | 1809 | argv[0] = "piesctl"; |
@@ -1944,3 +1946,3 @@ set_mailer_argcv (void) | |||
1944 | struct wordsplit ws; | 1946 | struct wordsplit ws; |
1945 | 1947 | ||
1946 | if (wordsplit (mailer_command_line, &ws, WRDSF_DEFFLAGS)) | 1948 | if (wordsplit (mailer_command_line, &ws, WRDSF_DEFFLAGS)) |
@@ -2035,3 +2037,3 @@ main (int argc, char **argv) | |||
2035 | int i; | 2037 | int i; |
2036 | 2038 | ||
2037 | set_program_name (argv[0]); | 2039 | set_program_name (argv[0]); |
@@ -2045,6 +2047,6 @@ main (int argc, char **argv) | |||
2045 | grecs_print_diag_fun = pies_diag_printer; | 2047 | grecs_print_diag_fun = pies_diag_printer; |
2046 | 2048 | ||
2047 | pies_master_argc = argc; | 2049 | pies_master_argc = argc; |
2048 | pies_master_argv = argv; | 2050 | pies_master_argv = argv; |
2049 | 2051 | ||
2050 | set_quoting_style (NULL, shell_quoting_style); | 2052 | set_quoting_style (NULL, shell_quoting_style); |
@@ -2060,3 +2062,3 @@ main (int argc, char **argv) | |||
2060 | } | 2062 | } |
2061 | 2063 | ||
2062 | /* Set default logging */ | 2064 | /* Set default logging */ |
@@ -2069,5 +2071,5 @@ main (int argc, char **argv) | |||
2069 | diag_flags = DIAG_TO_SYSLOG | (stderr_closed_p () ? 0 : DIAG_TO_STDERR); | 2071 | diag_flags = DIAG_TO_SYSLOG | (stderr_closed_p () ? 0 : DIAG_TO_STDERR); |
2070 | 2072 | ||
2071 | diag_setup (diag_flags); | 2073 | diag_setup (diag_flags); |
2072 | 2074 | ||
2073 | config_init (); | 2075 | config_init (); |
@@ -2075,3 +2077,3 @@ main (int argc, char **argv) | |||
2075 | parse_options (&argc, &argv); | 2077 | parse_options (&argc, &argv); |
2076 | 2078 | ||
2077 | if (argc && !(command == COM_RESTART_COMPONENT | 2079 | if (argc && !(command == COM_RESTART_COMPONENT |
@@ -2083,3 +2085,3 @@ main (int argc, char **argv) | |||
2083 | } | 2085 | } |
2084 | 2086 | ||
2085 | if (!instance) | 2087 | if (!instance) |
@@ -2121,3 +2123,3 @@ main (int argc, char **argv) | |||
2121 | set_mailer_argcv (); | 2123 | set_mailer_argcv (); |
2122 | 2124 | ||
2123 | if (lint_mode) | 2125 | if (lint_mode) |
@@ -2127,3 +2129,3 @@ main (int argc, char **argv) | |||
2127 | diag_setup (log_to_stderr_only ? DIAG_TO_STDERR : 0); | 2129 | diag_setup (log_to_stderr_only ? DIAG_TO_STDERR : 0); |
2128 | 2130 | ||
2129 | if (!control.url) | 2131 | if (!control.url) |
@@ -2139,3 +2141,3 @@ main (int argc, char **argv) | |||
2139 | } | 2141 | } |
2140 | 2142 | ||
2141 | switch (command) | 2143 | switch (command) |
@@ -2147,3 +2149,3 @@ main (int argc, char **argv) | |||
2147 | exit (request_restart_components (argc, argv)); | 2149 | exit (request_restart_components (argc, argv)); |
2148 | 2150 | ||
2149 | case COM_RELOAD: | 2151 | case COM_RELOAD: |
@@ -2164,7 +2166,7 @@ main (int argc, char **argv) | |||
2164 | exit (0); | 2166 | exit (0); |
2165 | 2167 | ||
2166 | case COM_TRACE_PREREQ: | 2168 | case COM_TRACE_PREREQ: |
2167 | components_trace (argv, depmap_col); | 2169 | components_trace (argv, depmap_col); |
2168 | exit (0); | 2170 | exit (0); |
2169 | 2171 | ||
2170 | default: | 2172 | default: |
@@ -2195,3 +2197,3 @@ main (int argc, char **argv) | |||
2195 | break; | 2197 | break; |
2196 | 2198 | ||
2197 | case pies_status_running: | 2199 | case pies_status_running: |
@@ -2201,3 +2203,3 @@ main (int argc, char **argv) | |||
2201 | } | 2203 | } |
2202 | 2204 | ||
2203 | if (!foreground) | 2205 | if (!foreground) |
@@ -2214,3 +2216,3 @@ main (int argc, char **argv) | |||
2214 | logmsg (LOG_INFO, _("%s %s starting"), proginfo.package, proginfo.version); | 2216 |