֪ͨ���̣߳�����һ������ */
| 120 | |
| 121 | /* ֪ͨ���̣߳�����һ������ */ |
| 122 | static int proctl_monitor_cmd_start(ACL_VSTREAM *client, |
| 123 | const char *filepath, const char *args) |
| 124 | { |
| 125 | const char *myname = "proctl_monitor_cmd_start"; |
| 126 | ACL_VSTRING *cmdline; |
| 127 | PROCTL_SERVICE *service; |
| 128 | PROCTL_MSG *msg; |
| 129 | |
| 130 | if (filepath[0] == 0) { |
| 131 | acl_vstream_fprintf(client, "-ERR|filepath null\r\n"); |
| 132 | acl_msg_error("%s(%d): no filepath", myname, __LINE__); |
| 133 | return (-1); |
| 134 | } |
| 135 | |
| 136 | if (proctl_service_exist(filepath)) { |
| 137 | acl_msg_error("%s(%d): child(%s) maybe be running!", |
| 138 | myname, __LINE__, filepath); |
| 139 | acl_vstream_fprintf(client, "-ERR|child(%s) maybe be running!\r\n", |
| 140 | filepath); |
| 141 | return (-1); |
| 142 | } |
| 143 | |
| 144 | cmdline = acl_vstring_alloc(256); |
| 145 | acl_vstring_strcpy(cmdline, "\""); |
| 146 | acl_vstring_strcat(cmdline, filepath); |
| 147 | acl_vstring_strcat(cmdline, "\""); |
| 148 | if (args && *args) { |
| 149 | acl_vstring_strcat(cmdline, " "); |
| 150 | acl_vstring_strcat(cmdline, args); |
| 151 | } |
| 152 | service = proctl_service_alloc(filepath, cmdline); |
| 153 | msg = proctl_msg_new(PROCTL_MSG_START); |
| 154 | msg->service = service; |
| 155 | proctl_msg_push(msg); |
| 156 | return (0); |
| 157 | } |
| 158 | |
| 159 | /* ֹͣ���еķ����˳��������ƽ��� */ |
| 160 | static void proctl_monitor_cmd_quit(ACL_VSTREAM *client) |
no test coverage detected
searching dependent graphs…