]> git.meshlink.io Git - meshlink/blobdiff - src/process.c
Merge branch 'master' of git://tinc-vpn.org/tinc into 1.1
[meshlink] / src / process.c
index 89678349c0f97821deddcad58826d3cfe572bd55..a7d0f260ec448a07850c861e66b23fcb698afbca 100644 (file)
@@ -26,6 +26,7 @@
 #include "device.h"
 #include "edge.h"
 #include "logger.h"
+#include "net.h"
 #include "node.h"
 #include "process.h"
 #include "subnet.h"
@@ -52,7 +53,7 @@ static SC_HANDLE service = NULL;
 static SERVICE_STATUS status = {0};
 static SERVICE_STATUS_HANDLE statushandle = 0;
 
-bool install_service(void) {
+static bool install_service(void) {
        char command[4096] = "\"";
        char **argp;
        bool space;
@@ -112,35 +113,6 @@ bool install_service(void) {
        return true;
 }
 
-bool remove_service(void) {
-       manager = OpenSCManager(NULL, NULL, SC_MANAGER_ALL_ACCESS);
-       if(!manager) {
-               logger(LOG_ERR, "Could not open service manager: %s", winerror(GetLastError()));
-               return false;
-       }
-
-       service = OpenService(manager, identname, SERVICE_ALL_ACCESS);
-
-       if(!service) {
-               logger(LOG_ERR, "Could not open %s service: %s", identname, winerror(GetLastError()));
-               return false;
-       }
-
-       if(!ControlService(service, SERVICE_CONTROL_STOP, &status))
-               logger(LOG_ERR, "Could not stop %s service: %s", identname, winerror(GetLastError()));
-       else
-               logger(LOG_INFO, "%s service stopped", identname);
-
-       if(!DeleteService(service)) {
-               logger(LOG_ERR, "Could not remove %s service: %s", identname, winerror(GetLastError()));
-               return false;
-       }
-
-       logger(LOG_INFO, "%s service removed", identname);
-
-       return true;
-}
-
 DWORD WINAPI controlhandler(DWORD request, DWORD type, LPVOID boe, LPVOID bah) {
        switch(request) {
                case SERVICE_CONTROL_INTERROGATE:
@@ -223,8 +195,10 @@ bool init_service(void) {
 */
 bool detach(void) {
 #ifndef HAVE_MINGW
-       signal(SIGALRM, SIG_IGN);
-       signal(SIGCHLD, SIG_IGN);
+       signal(SIGPIPE, SIG_IGN);
+       signal(SIGUSR1, SIG_IGN);
+       signal(SIGUSR2, SIG_IGN);
+       signal(SIGWINCH, SIG_IGN);
 
        closelogger();
 #endif