MXS-759: Attempt to create PID directory

When MaxScale is started, it will attempt to create the PID directory. If
the directory does not exist and MaxScale is able to create it, MaxScale
will successfully start whereas it previously failed to do so.

If MaxScale lacks the permissions to create the directory, an error
message is printed to the user explaining the reason why MaxScale fails to
start.
This commit is contained in:
Markus Mäkelä 2017-03-02 09:46:47 +02:00
parent da5edadcda
commit 3bafcae343

View File

@ -2277,6 +2277,12 @@ bool pid_file_exists()
static int write_pid_file()
{
if (!mxs_mkdir_all(get_piddir(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH))
{
MXS_ERROR("Failed to create PID directory.");
return 1;
}
char logbuf[STRING_BUFFER_SIZE + PATH_MAX];
char pidstr[STRING_BUFFER_SIZE];