Made scripts executable.

This commit is contained in:
Tristan B. Kildaire 2020-04-30 19:43:20 +02:00
parent 5204274a76
commit 9e6f42cdeb
6 changed files with 21 additions and 7 deletions

View File

@ -16,8 +16,8 @@
"handlers" : { "handlers" : {
"availableTypes" : ["type1", "type2"], "availableTypes" : ["type1", "type2"],
"typeMap" : { "typeMap" : {
"type1" : {"handlerBinary" : "aBin", "unixDomainSocketPath" : "aSock"}, "type1" : {"handlerBinary" : "./testing/unixSock.py", "unixDomainSocketPath" : "aSock"},
"type2" : {"handlerBinary" : "bBin", "unixDomainSocketPath" : "bSock"} "type2" : {"handlerBinary" : "./testing/unixSock2.py", "unixDomainSocketPath" : "bSock"}
} }
}, },
"admin" : { "admin" : {

View File

@ -8,6 +8,7 @@ import handlers.response;
import base.net; import base.net;
import connection.message; import connection.message;
import server.server : BesterServer; import server.server : BesterServer;
import std.process : spawnProcess, Pid;
public final class MessageHandler public final class MessageHandler
{ {
@ -26,6 +27,9 @@ public final class MessageHandler
/* The BesterServer being used */ /* The BesterServer being used */
public BesterServer server; public BesterServer server;
/* The PID of the process */
private Pid pid;
public Socket getSocket() public Socket getSocket()
{ {
return domainSocket; return domainSocket;
@ -36,14 +40,19 @@ public final class MessageHandler
/* Set the plugin name */ /* Set the plugin name */
this.pluginName = pluginName; this.pluginName = pluginName;
/* Initialize the socket */
//initializeUNIXSocket(socketPath);
/* Set the socket path */ /* Set the socket path */
this.socketPath = socketPath; this.socketPath = socketPath;
/* Set the server this handler is associated with */ /* Set the server this handler is associated with */
this.server = server; this.server = server;
/* Start the message handler */
startHandlerExecutable();
}
private void startHandlerExecutable()
{
// pid = spawnProcess(executablePath);
} }
public string getPluginName() public string getPluginName()

View File

@ -2,14 +2,15 @@ module utils.debugging;
import std.stdio : writeln; import std.stdio : writeln;
import std.process : environment; import std.process : environment;
import std.conv : to;
alias dprint = debugPrint; alias dprint = debugPrint;
void debugPrint(string message) void debugPrint(MessageType)(MessageType message)
{ {
/* Check if the environment variable for `B_DEBUG` exists */ /* Check if the environment variable for `B_DEBUG` exists */
if(!(environment.get("B_DEBUG") is null)) if(!(environment.get("B_DEBUG") is null))
{ {
writeln("[DEBUG] " ~ message); writeln("[DEBUG] " ~ to!(string)(message));
} }
} }

2
testing/unixSock.py Normal file → Executable file
View File

@ -1,3 +1,5 @@
#!/bin/python3
import socket import socket
import json import json

2
testing/unixSock2.py Normal file → Executable file
View File

@ -1,3 +1,5 @@
#!/bin/python3
import socket import socket
import json import json

0
testing/unixSockBackup.py Normal file → Executable file
View File