12
#include "glusterd-utils.h"
13
#include "glusterd-snapd-svc-helper.h"
16
glusterd_svc_build_snapd_rundir(glusterd_volinfo_t *volinfo, char *path,
19
char workdir[PATH_MAX] = {
22
glusterd_conf_t *priv = THIS->private;
24
GLUSTERD_GET_VOLUME_PID_DIR(workdir, volinfo, priv);
25
snprintf(path, path_len, "%s", workdir);
29
glusterd_svc_build_snapd_socket_filepath(glusterd_volinfo_t *volinfo,
30
char *path, int path_len)
32
char sockfilepath[PATH_MAX] = {
35
char rundir[PATH_MAX] = {
40
glusterd_svc_build_snapd_rundir(volinfo, rundir, sizeof(rundir));
41
len = snprintf(sockfilepath, sizeof(sockfilepath), "%s/run-%s", rundir,
43
if ((len < 0) || (len >= sizeof(sockfilepath))) {
47
glusterd_set_socket_filepath(sockfilepath, path, path_len);
51
glusterd_svc_build_snapd_pidfile(glusterd_volinfo_t *volinfo, char *path,
54
char rundir[PATH_MAX] = {
58
glusterd_svc_build_snapd_rundir(volinfo, rundir, sizeof(rundir));
60
snprintf(path, path_len, "%s/%s-snapd.pid", rundir, volinfo->volname);
64
glusterd_svc_build_snapd_volfile(glusterd_volinfo_t *volinfo, char *path,
67
char workdir[PATH_MAX] = {
70
glusterd_conf_t *priv = THIS->private;
72
GLUSTERD_GET_VOLUME_DIR(workdir, volinfo, priv);
74
snprintf(path, path_len, "%s/%s-snapd.vol", workdir, volinfo->volname);