+ struct sockaddr_un local;
+ local.sun_family = AF_UNIX;
+ strcpy(local.sun_path, path); // TODO: strlen ???
+ unlink(local.sun_path);
+ int len = SUN_LEN(&local);
+ int ret = bind(fd, (struct sockaddr*)&local, len);
+ if(ret) {
+ log_printf(ERROR, "unable to bind to '%s': %s", local.sun_path, strerror(errno));
+ return -1;
+ }
+
+ ret = listen(fd, 4);
+ if(ret) {
+ log_printf(ERROR, "unable to listen on command socket: %s", local.sun_path, strerror(errno));
+ return -1;
+ }
+
+ log_printf(INFO, "now listening on %s for incoming commands", path);
+
+ return fd;
+}
+
+int process_cmd(int fd)
+{
+ static char* buffer[100];