Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
3 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/***********************************************************************************************************************************
Start Command
***********************************************************************************************************************************/
#include <build.h>
 
#include "command/control/common.h"
#include "command/control/start.h"
#include "common/debug.h"
#include "config/config.h"
#include "storage/helper.h"
#include "storage/storage.h"
 
/**********************************************************************************************************************************/
FN_EXTERN void
cmdStart(void)
{
    FUNCTION_LOG_VOID(logLevelDebug);
 
    MEM_CONTEXT_TEMP_BEGIN()
    {
        // Remove the stop file so processes can run
        const String *const stopFile = lockStopFileName(cfgOptionStrNull(cfgOptStanza));
 
        // If the stop file exists, then remove it
        if (storageExistsP(storageLocal(), stopFile))
        {
            // If the file cannot be removed, storageRemove() will throw an error if the error is not ENOENT
            storageRemoveP(storageLocalWrite(), stopFile);
        }
        else
        {
            LOG_WARN_FMT(
                "stop file does not exist%s",
                (cfgOptionTest(cfgOptStanza) ? zNewFmt(" for stanza %s", strZ(cfgOptionDisplay(cfgOptStanza))) : ""));
        }
    }
    MEM_CONTEXT_TEMP_END();
 
    FUNCTION_LOG_RETURN_VOID();
}